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

To resolve issues starting MATLAB on Mac OS X 10.10 (Yosemite) visit: http://www.mathworks.com/matlabcentral/answers/159016

Help: numerical solution for first order differential (OD) equations

Asked by Dushyant on 15 Sep 2013

I need some guidance regarding numerical ordinary differential equation

I have nine simultaneous first order differential (OD) equations which can be combinedly written as: dY/dt = A*Y + b where Y is a vector consisting of 9 terms and A is a matrix of size 9,3.

Can someone suggest me how should I start?

The paper that, I am looking at, briefly explains the procedure as: “The problem can be analytically without further simplification with the use of Matlab built-in function of matrix left division (\) and matrix power (expm 1) “ Regards, DK

1 Comment

Azzi Abdelmalek on 15 Sep 2013

If Y is 9x1 array and A is 9x3 array, how can you do A*Y ?

Dushyant

Products

No products are associated with this question.

1 Answer

Answer by Azzi Abdelmalek on 15 Sep 2013
A should be a 9x9 array

write and save this function as myeq.m

function dY=myeq(t,Y)
A=randi(9,9,9) ; % Example
b=1;
dY=zeros(9,1)   ;
dY = A*Y + b;

Then call it

y0=zeros(9,1)% Initial conditions
tspan=[0 10];
[t,y]=ode45(@myeq2,tspan,y0)

1 Comment

Azzi Abdelmalek on 16 Sep 2013

[ Dushyant commented]

Thanks.

Sorry, I mistakenly wrote wrong dimension for A.

Regards, Dushyant

Azzi Abdelmalek

Contact us