Global optimization of parameters in ode
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Hi
I want to fit the solution of differential equation
dy/dt= -ay-by^2-cy^3
to my experimental data to optimize globally constants a, b and c .
I have used lsqcurvefit to do show but I cannot get these values of constant matching with the earlier values so I need to fit them globally by using Genetic algoritm.
How can I define the fit function (objective function)??
Here is the code I have so far.
% % % % % % % % experimental values
A=load('data.csv');
time=(A(1,150:end));
B=(A(691,150:end))';
data=B./min(B);
plot(time,data,'or')
% % % % % % % % % % Solving the differential equation and plotting experimental data vs solution of ode
tspan = [0 3000];
y0 = 1;
y01=1;
a=0.001;b=0.001;c=0.0001;
[t,y] = ode45(@(t,y) -a*y^3-b*y^2-c*y, tspan, y0);
plot(time,data,'or','Markersize',2)
hold on
plot(t,y,'-k','Color','magenta')
hold off
xlim([0 3000]);
legend('data','ode45')
0 commentaires
Réponses (0)
Voir également
Catégories
En savoir plus sur Solver Outputs and Iterative Display dans Help Center et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!