Re: Vector components as functions in DSolve
- To: mathgroup at smc.vnet.net
- Subject: [mg42438] Re: Vector components as functions in DSolve
- From: bobhanlon at aol.com (Bob Hanlon)
- Date: Tue, 8 Jul 2003 04:37:19 -0400 (EDT)
- References: <beb6a7$66o$1@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
L=3; s = f[#][t]& /@ Range[L]; 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 at smc.vnet.net>, "Dr. Wolfgang Hintze" <weh at snafu.de> wrote: << I would like to generalize to an arbitrary number L of dimensions the following simple procedure in two dimensions: 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?