필터 지우기
필터 지우기

Global optimization of parameters in ode

조회 수: 2 (최근 30일)
Bibek Dhami
Bibek Dhami 2020년 2월 24일
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개)

카테고리

Help CenterFile Exchange에서 Solver Outputs and Iterative Display에 대해 자세히 알아보기

제품

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by