ode; zero input response; drawing the function in matlab

hello
in the context of ordinary differential equations and system modelling, an example of how to determine the zero-input response from a system modelled by q(D) is
for which the answer is supposed to be
So when trying to prove to myself that the resulting plot for q(D) really was a constant 0, I tried this in matlab:
syms x
y = exp(-x) * (cos(2*x) + 2*sin(2*x));
qD = (diff(y) + y)^2 + 4*y;
diffy = diff(y);
hold on
fplot(y, [0 5])
fplot(qD, [0 5])
fplot(diffy, [0 5])
legend ('y', 'qD', 'diffy')
but the resulting curve for 'qD' is anything but 0;
so is my formula for the 'qD' curve wrong? or is the solution to the exercise wrong?
regards, Danny.

 채택된 답변

Alan Stevens
Alan Stevens 2020년 11월 13일
편집: Alan Stevens 2020년 11월 13일

0 개 추천

I think you should interpret (D+1)^2y as D^2y + 2Dy + y; i.e. d^2y/dt^2 + 2dy/dt + y
Currently you have it as (dy/dt)^2 +2dy/dt + y

댓글 수: 1

indeed
qD = diff(y,2) + 2*diff(y) + 5*y;
does give me constant 0 result, thanks!!!

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Symbolic Math Toolbox에 대해 자세히 알아보기

제품

릴리스

R2020a

태그

질문:

2020년 11월 13일

편집:

2020년 11월 13일

Community Treasure Hunt

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

Start Hunting!

Translated by