フィルターのクリア

Extract delayed variable from dde23 solver

1 回表示 (過去 30 日間)
Jpk
Jpk 2021 年 1 月 28 日
編集済み: Jpk 2021 年 1 月 28 日
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 件)

カテゴリ

Help Center および File ExchangeScope Variables and Generate Names についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by