optimization of delayed differential equations (dde)
5 次查看(过去 30 天)
显示 更早的评论
Hello,
I try to optimise (finding the parameter's value) in the system of dde, unfortunately I can't find any example how to do it. I used to optimization of ode using ode45 solver with lsqlin for instance. I will appreciate the help. The dde23 seems not to be working with lsqlin. I will appreciate any help.
1 个评论
采纳的回答
Torsten
2022-5-9
编辑:Torsten
2022-5-9
Make the best of it.
pTrue = [1 1 1 1 1 1 1 1 1];
time = 0:7;
Y = ...;
Am1=[1,1.1,1.4,0.7,0.8,1.6,2,1.5];
Bm1=[1.5,1.0,0.4,1.7,0.9,1.3,1.5,1.4];
Am=@(t)interp1(time,Am1,t)
Bm=@(t)interp1(time,Bm1,t)
p = lsqnonlin(@(p) Errors(p,time,Y,Am,Bm),0.8*pTrue)
function res = Errors(p,time,Y,Am,Bm)
lags=[1,2];
[T,SOL]=dde23(@(t,y,Z)ddefunEx(t,y,Z,p,Am,Bm), lags, [1,1,1,1], time);
res = Y-SOL;
res = res(:);
end
function dydt = ddefunEx(t,y,Z,p,Am,Bm)
ylag1 = Z(:,1);
ylag2 = Z(:,2);
E1p=y(1)
E2p=y(2)
A1=y(3)
B1=y(4)
n_A=p(1);%0.6;
n_B=p(2);%0.1;
KE1=p(3);%0.2;
KE2=p(4);%0.2;
Vp_A=p(5);%1.2;
Vp_B=p(6);%1.5;
alpha_p=p(7);%0.4;
kA=p(8);%0.4;
kB=p(9);%1.2;
%Auxiliary equations
ALPHA1=n_A*E1p*A1/(KE1*(1+A1))-A1;
ALPHA2=n_B*E2p*B1/(KE2*(1+B1))-B1;
dydt= [Vp_A*Am(t)-alpha_p*ylag1(1);
Vp_B*Bm(t)-alpha_p*ylag1(2);
kA*Am(t)-ylag2(3)-ALPHA1+ALPHA2;
kB*Bm(t)-ylag2(4)+ALPHA1-ALPHA2];
end
4 个评论
Torsten
2024-3-14
What do you mean by your question ? The line
[T,SOL]=dde23(@(t,y,Z)ddefunEx(t,y,Z,p,Am,Bm), lags, [1,1,1,1], time);
gives you a solution SOL at times T that you can plot. How do you think that the lags come into play ?
更多回答(1 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Stochastic Differential Equation (SDE) Models 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!