Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Solve Coupled Linear Matrix DE

Asked by Matt beach on 19 Jul 2013

Hi, I'm trying to solve (either analytically or numerically) a coupled linear Matrix DE of the form dx/dt = A*x. where x and dx/dt are vectors and A a square matrix. I can generate the derivatives of x, (dx/dt) and x as symbols. but I cant get the syntax right to solve the eq. Here's the code

 syms t
 t=sym('t');
 L=1;
 A=rand((L+1)^2)
 %syms x(t)
 x = sym(zeros((L+1)^2,1));
 for k=1:(L+1)^2
     x(k) = sym(sprintf('x%d(t)', k));
 end
 S = dsolve('diff(x,t) == (A*x)',x)

Any help would be appreciated, thanks! Also how long do you think it would take to solve 132 coupled DEs? (currently stuck on 4...)

0 Comments

Matt beach

Products

0 Answers

Contact us