Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: diff eq
Replies: 8   Last Post: Apr 11, 2013 2:27 AM

 Messages: [ Previous | Next ]
 Guest
diff eq
Posted: Apr 7, 2013 9:33 AM

I am trying to use ode45 to to solve a system of first order linear diff eq
They are a set of 4 diff eq
X'=AX where
X' is a 4x1 column matrix of dx_i/dt where i= 1,2,3 or 4
A is 4x4 matrix of time independent values (ie coefficient values)
X is a 4x1 column matrix of x_i(t) where i= 1,2,3 or 4

this is what I am typing into MATLAB:
function dx = system_ex(t,x)
dx = zeros(4,1);
dx(1) = -2.4712*x(1) + 0.005*x(2) + 0.56*x(3)+ 0.1*x(4);
dx(2) = 0.385*x(1) - 0.1002*x(2)
dx(3) = 0.002*x(2) - 0.6462*x(3)
dx(4) = 0.007*a(2) - 0.2042*x(4)
[T,X] = ode45(@systems_ex,[0 10],[1 0 0 0])
plot(t,x(:,1))

and it is returning
'Input argument "x" is undefined'
and
dx(1) = -2.4712*x(1) + 0.005*x(2) + 0.56*x(3)+ 0.1*x(4); error in line 3 of my code

I am not understanding the 'input arg x is undefined
I am trying to let the x_i's to be activities in compartments of a biological system as a function of time, which I am trying to solve for in the diff eq. How would I let MATLAB know this?

any help will be appreciated

Date Subject Author
4/7/13 Guest
4/8/13 Bruno Luong
4/10/13 Guest
4/10/13 Torsten
4/10/13 Guest
4/10/13 Torsten
4/10/13 Bart
4/11/13 Torsten
4/10/13 richard