Re: Vector of functions in ordinary differential equations
- To: mathgroup at smc.vnet.net
- Subject: [mg57117] Re: [mg57109] Vector of functions in ordinary differential equations
- From: Bob Hanlon <hanlonr at cox.net>
- Date: Mon, 16 May 2005 07:14:05 -0400 (EDT)
- Reply-to: hanlonr at cox.net
- Sender: owner-wri-mathgroup at wolfram.com
rv[t_,n_Integer]:=Table[x[k,t],{k,1,n}]; M[n_Integer]:=Table[Random[],{n},{n}]; With[{n=2}, eqm=Thread[D[rv[t,n],t]==M[n].rv[t,n]]; DSolve[eqm,rv[t,n],t]] Bob Hanlon > > From: "Dr. Wolfgang Hintze" <weh at snafu.de> To: mathgroup at smc.vnet.net > Date: 2005/05/16 Mon AM 01:29:50 EDT > Subject: [mg57117] [mg57109] Vector of functions in ordinary differential equations > > Considering ordinary differential equations for more than one function > I'd like to have one differential equation for n functions in terms a > vector rnv[t] = {x[1,t], x[2,t], ... , x[n,t]} but I did not succeed in > expressing it in Mathematica. > > Any hints are greatly appreciated. > > Regards, > Wolfgang > > Here are the details: > > 1) There are no problems if I define the independent functions > explicitly like x[t], y[t], ... and write down a differential eqaution > for each component. > > 2) There are also no problems if the explicit components are collected > into a vector, e.g. rv[t] := {x[t], y[t]}. Then one differential > equation for the vector works fine. This is a example for a linear diffeq: > > In[103]:= > rv[t_] := {x[t], y[t]} > > In[104]:= rv[t] > > Out[104]= {x[t], y[t]} > > In[105]:= M = {{a, b}, {c, d}} > > Out[105]= {{a, b}, {c, d}} > > In[108]:= eq = D[rv[t], t] == M . rv[t] > > Out[108]= {Derivative[1][x][t], Derivative[1][y][t]} == {a*x[t] + > b*y[t], c*x[t] + d*y[t]} > > In[110]:= sm = DSolve[eq, rv[t], t]; > > In[74]:= x[t] /. sm > > Out[74]= {1/(2*Sqrt[a^2 + 4*b*c ... [snip] > > 3) Now, in the general case, I'd like to have n functions x[1,t], > x[2,t], ... , x[n,t]: there is the problem > > In[91]:= Clear[rv, M, n, x, k, eqm] > > In[92]:= n = 2; > > In[93]:= rv[t_, n_] := Table[x[k, t], {k, 1, n}] > > In[94]:= rv[t, n] > > Out[94]= {x[1, t], x[2, t]} > > In[95]:= M[n_] := Table[Table[Random[], {n}], {n}] > > In[96]:= MatrixForm[M[n]] > > Out[96]//MatrixForm= > MatrixForm[{{0.4129438091150023, 0.19074665264305043}, > {0.31296972444474486, 0.31543944991928186}}] > > In[99]:= eqm = D[rv[t, n], t] == M[n] . rv[t, n] > > Out[99]= > {Derivative[0, 1][x][1, t], Derivative[0, 1][x][2, t]} == > {0.8654946712834201*x[1, t] + 0.6944612611502227*x[2, t], > 0.7720429142604556*x[1, t] + 0.016353185110213362*x[2, t]} > > In[100]:= DSolve[eqm, rv[t,n], t] > > From In[100]:= DSolve::"nvld" : "The description of the equations > appears to be ambiguous or \ > invalid." > > From In[100]:= DSolve::"deqx" : "Supplied equations are not > differential equations of the \ > given functions." > > From In[100]:= DSolve::"deqx" : "Supplied equations are not > differential equations of the \ > given functions." > > Out[100]= DSolve[{Derivative[0, 1][x][1, t], Derivative[0, 1][x][2, t]} > == {0.8654946712834201*x[1, t] + 0.6944612611502227*x[2, t], > 0.7720429142604556*x[1, t] + 0.016353185110213362*x[2, t]}, {x[1, > t], x[2, t]}, t] > > From In[111]:= DSolve::"nvld" : "The description of the equations > appears to be ambiguous or \ > invalid." > > From In[111]:= DSolve::"deqx" : "Supplied equations are not > differential equations of the \ > given functions." > > From In[111]:= DSolve::"deqx" : "Supplied equations are not > differential equations of the \ > given functions." > >