How do I implement a genetic algorithm for parameter fitting to an already existing ODE system>
显示 更早的评论
So I am working on expanding an already working ODE system. I have my rate equations and fluxes for three additional differential equations. I would like to estimate 8 unique constants in the 3 rate equations which is all building upon a 20 equation ODE system. I also have vectorized how I would like my new 3 equations to behave for a specific input. How can I implement the genetic algorithm to focus on parameter fitting for this. I can't reveal specifically each portion of my code but i can put some filler code to demonstrate my issue. thanks in advance!
%raw data of how i want the model to behave
minutes = [10, 15, 20, 40, 60, 80]';
neweq1= [60,20,10,6,5,4.9 ]';
neweq2=[40,90,95,99,99.5]';
neweq3= [60,70,20,19.5,19]';
%fitfun= norm(fun(t)-expected value)
coeff= ga(fitfun,8);
function o= fitness (x,t,y)
y0=[200 0 .17 209.9 94.83 483.73 1.51 14.76 0 200 184.7 15.31 750 0 0 0 300 0 3000 0 100 0 0];
tspan=[0 100];
[t,y]=ode45 (@(t,y) fun, tspan, y0)
function dy=fun(t,y,input)
dy=zeros(23,0);
%20 rate equations
%my new 3 equations
%x is an array populated with the parameters i want to estimate and is a part of my new 3 equations
end
end
采纳的回答
更多回答(1 个)
Vinayak Choyyan
2022-10-14
0 个投票
Hi,
As per my understanding, you would like to implement a genetic algorithm to fit parameters.
Following are some resources that might help you with your issue.
- Genetic Algorithm - MATLAB & Simulink (mathworks.com)
- What Is a Genetic Algorithm? - Video - MATLAB (mathworks.com) - This contains how various approaches of genetic algorithm can be applied to given equations.
- Simple code for genetic algorithm - File Exchange - MATLAB Central (mathworks.com)- This contains a sample code which shows how genetic algorithm can be used to minimize or maximize equations.
类别
在 帮助中心 和 File Exchange 中查找有关 Genetic Algorithm 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
