Extract delayed variable from dde23 solver
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
I'm aiming to simulate the following system in continuous time via MATLAB:
I have indeed found a dde23 to accomplish this, however I seem to be unable to get it to output the value of y(t).
sol = dde23(@(t,x,Z)ddex1de(t,x,Z),[12],@ddex1hist,[0, 100]);
figure;
plot(sol.x,sol.y)
xlabel('time t');
ylabel('solution y');
% --------------------------------------------------------------------------
function s = ddex1hist(t)
% Constant history function for DDEX1.
s = zeros(1,1);
% --------------------------------------------------------------------------
end
function [dxdt] = ddex1de(t,x,Z)
% Differential equations function for DDEX1.
y = 2*Z(:,1);
dxdt = [-2*y(1)+3;];
end
However while this code will indeed make use of the lagged variable x, it will not allow me to output y which is the a scaled and delayed version of x. Indeed if I place it in the dxdt variable this will be integrated which is not my aim.
How can I have dde23 to output and hence extract the delayed variable?
0 comentarios
Respuestas (0)
Ver también
Categorías
Más información sobre Numerical Integration and Differential Equations en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!