optimization of delayed differential equations (dde)
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Malgorzata Wieteska
am 9 Mai 2022
Kommentiert: Torsten
am 14 Mär. 2024
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 Kommentar
Akzeptierte Antwort
Torsten
am 9 Mai 2022
Bearbeitet: Torsten
am 9 Mai 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 Kommentare
Priya Verma
am 14 Mär. 2024
how to plot graphs between lags and variables for dde ?...please reply ..
Torsten
am 14 Mär. 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 ?
Weitere Antworten (1)
Siehe auch
Kategorien
Mehr zu Startup and Shutdown finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!