optimization of delayed differential equations (dde)
2 views (last 30 days)
Show older comments
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 Comment
Accepted Answer
Torsten
on 9 May 2022
Edited: Torsten
on 9 May 2022
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 Comments
Priya Verma
on 14 Mar 2024
how to plot graphs between lags and variables for dde ?...please reply ..
Torsten
on 14 Mar 2024
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 ?
More Answers (1)
See Also
Categories
Find more on Startup and Shutdown in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!