Filter löschen
Filter löschen

Differential equations on MATLAB

3 Ansichten (letzte 30 Tage)
Lina Baquero
Lina Baquero am 28 Nov. 2012
I have this exercise but I'm stock:
A =[5 1 0 0; 1 5 0 0; 0 0 1 -2; 0 0 2 1]
a)solve dx/dt = Ax using the differential equation solving commands of MATLAB b) calculate e^(At) c) put the four LI solutions in a 4 x 4 matrix of functions X and solve e^(At)B=X for B
I know if it possible to find the eigenvectors and eigenvalues and the solve for c (the coefficients) but I don;t know if this would be using the differenctial equation solving commands of MATLAB.

Antworten (2)

Ryan G
Ryan G am 28 Nov. 2012
I believe ODE45 may be what you're looking for. Have a look at that documentation, give it a shot and then if you get stuck you can ask a new question.
I will give you 1 hint, you want to breakup the matrix into a system of equations:
x1' = 5*x1 + x2
x2' = x1 + 5x2'
etc
and then format it so it works for the solver in MATLAB.

Azzi Abdelmalek
Azzi Abdelmalek am 28 Nov. 2012
function dx=my_eq1(t,x)
dx=zeros(4,1);
A =[5 1 0 0; 1 5 0 0; 0 0 1 -2; 0 0 2 1]
dx=A*x
%call your function
xinitial=[1 1 -1 2];
[t,y]=ode45(@my_eq1, [0 10],xinitial)

Kategorien

Mehr zu Programming finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by