Defining a 2x2 matrix, e.g.
In[66]:=
A = {{0, -1}, {1, 0}};
and a vector of two functions of time t
In[67]:=
r[t] = {x[t], y[t]};
I put up a system of ordinary differential equations
In[77]:=
equ = D[r[t], t] == -A . r[t]
Out[77]=
{Derivative[1][x][t], Derivative[1][y][t]} ==
{y[t], -x[t]}
and solve it using DSolve
In[78]:=
DSolve[equ, r[t], t]
Out[78]=
{{x[t] -> C[1]*Cos[t] + C[2]*Sin[t],
y[t] -> C[2]*Cos[t] - C[1]*Sin[t]}}
The generalization of the vector r[t] should be something like
In[87]:=
L = 5; s = Array[f[t], {L}]
Out[87]=
{f[t][1], f[t][2], f[t][3], f[t][4], f[t][5]}
or
In[88]:=
L = 5; s = Array[f, {L}][t]
Out[88]=
{f[1], f[2], f[3], f[4], f[5]}[t]
I would then like to use
In[65]:=
DSolve[D[s, t] == A . s, s, t]
but nothing of the kind will work.
My question is simple: how do I treat a system of ordinary differential
equations of the form
d(Vector of functions of t)/dt
= function of the vector of functions of t)
in Mathematica?
Any hints welcome.
Wolfgang
A = Table[Random[Integer, {-1,1} ], {L},{L}]
{{0, 0, 0}, {0, -1, 1}, {-1, 0, 1}}
equ = Thread[D[s,t]==A.s];
DSolve[equ, s,t]
{{f[1][t] -> C[1], f[2][t] -> ((-(1/2))*C[1]*(-1 + E^t)^2)/
E^t + C[2]/E^t + ((1/2)*(-1 + E^(2*t))*C[3])/E^t,
f[3][t] -> (1 - E^t)*C[1] + E^t*C[3]}}
Bob Hanlon
In article <beb6a7$66o$1...@smc.vnet.net>, "Dr. Wolfgang Hintze" <w...@snafu.de>
wrote:
My DETools package extends DSolve and NDSolve so that they understand
*linear* systems in vector form. See
http://www.math.armstrong.edu/faculty/hollis/mmade.
Actually, I need to take that out for version 5.0, since it's
apparently not needed. See
http://www.wolfram.com/products/mathematica/newin5/numeric/ndsolve.html
-----
Selwyn Hollis
http://www.math.armstrong.edu/faculty/hollis
> Any hints welcome.
>
> Wolfgang
>
>