- #1
brydustin
- 205
- 0
Matrix Systems of ODEs -- Mathematica
I'm trying to solve the classic "systemm of linear ODEs" of the form: Y(t)' = X*Y(t)
Its homogenous, so it wouldn't hurt to rewrite it as Y(t)' - X*Y(t) = 0 (if that helps?)
so here is my attempt at the solution
solExp == NDSolve[Y'[t] == X.Y[t] && Y[0] = P, X, {t, 0, 10}]
where P is a vector of numbers (they are each fixed) -- its my list of initial conditions, because each equation is first order, each eq-n needs one initial condition.
you can imagine the situation of:
(dy1/dt)= x1,1*y1(t) + x1,2*y2(t) + ... x1,N*yN(t)
(dy2/dt)= x2,1*y1(t) + x2,2*y2(t) + ... x2,N*yN(t)
.
.
.
(dyN/dt) = xN,1*y1(t) + xN,2*y2(t) + ... xN,N*yN(t)
we are given the intial condition that the set Y[t=0] = P = {y1(0), y2(0),...yN(0)}
I can't seem to get this to work using matrix notation... although I know how to do it explicitly for a few equations, where you list each on in the code... the thing is: I am dealing with a LARGE set of equations and so this wouldn't be practical.
Thanks
I'm trying to solve the classic "systemm of linear ODEs" of the form: Y(t)' = X*Y(t)
Its homogenous, so it wouldn't hurt to rewrite it as Y(t)' - X*Y(t) = 0 (if that helps?)
so here is my attempt at the solution
solExp == NDSolve[Y'[t] == X.Y[t] && Y[0] = P, X, {t, 0, 10}]
where P is a vector of numbers (they are each fixed) -- its my list of initial conditions, because each equation is first order, each eq-n needs one initial condition.
you can imagine the situation of:
(dy1/dt)= x1,1*y1(t) + x1,2*y2(t) + ... x1,N*yN(t)
(dy2/dt)= x2,1*y1(t) + x2,2*y2(t) + ... x2,N*yN(t)
.
.
.
(dyN/dt) = xN,1*y1(t) + xN,2*y2(t) + ... xN,N*yN(t)
we are given the intial condition that the set Y[t=0] = P = {y1(0), y2(0),...yN(0)}
I can't seem to get this to work using matrix notation... although I know how to do it explicitly for a few equations, where you list each on in the code... the thing is: I am dealing with a LARGE set of equations and so this wouldn't be practical.
Thanks