필터 지우기
필터 지우기

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 CenterFile Exchange에서 Scope 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