Solving System differential equation

Hi, I am new to matlab. I have a very simple question. How can I solve the following differential equation dx/dt = [1,2;3,4]*[x1;x2]+[0;1]?
Thank you very much.

댓글 수: 2

MoHizzel
MoHizzel 2015년 4월 13일
How can I modify this so the answer is a general equation of x in terms of t? So something like x(t)=5e^t[1;1]
Torsten
Torsten 2015년 4월 14일
help dsolve
Best wishes
Torsten.

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

답변 (1개)

Sadra
Sadra 2015년 4월 13일
편집: Sadra 2015년 4월 13일

0 개 추천

you could solve it with ODE45
your function is:
function dy = my_ODE(t,y)
dy=zeros(2,1);
dy=[1 2;3 4]*[y(1);y(2)]+[0;1];
end
and you should solve it with ODE45 with this script :
Time=2; %2seconds
InitialValues=[0;0];
[t,y]=ode45(@my_ODE,[0 Time],InitialValues)
plot(t,y(1),'-',t,y(2),'-.')
legend('y(1)','y(2)')

댓글 수: 3

MoHizzel
MoHizzel 2015년 4월 13일
Thank you. How can I modify this so the answer is a general equation of x in terms of t? So something like x(t)=5e^t[1;1]
Star Strider
Star Strider 2015년 4월 13일
Also see the documentation for the matrix exponential, expm.
Sadra
Sadra 2015년 4월 14일
you should write your equations in state space ( Y_dot=f(x,t) ) form.
for extra details and exapmle see the documaentation for ODE

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

카테고리

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

질문:

2015년 4월 13일

댓글:

2015년 4월 14일

Community Treasure Hunt

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

Start Hunting!

Translated by