Differential equations on MATLAB
7 views (last 30 days)
Show older comments
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.
0 Comments
Answers (2)
Ryan G
on 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.
0 Comments
Azzi Abdelmalek
on 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)
0 Comments
See Also
Categories
Find more on Mathematics and Optimization in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!