Global optimization of parameters in ode
조회 수: 2 (최근 30일)
이전 댓글 표시
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
답변 (0개)
참고 항목
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!