       Re: Vector of functions in ordinary differential equations

• To: mathgroup at smc.vnet.net
• Subject: [mg57140] Re: Vector of functions in ordinary differential equations
• From: "Dr. Wolfgang Hintze" <weh at snafu.de>
• Date: Thu, 19 May 2005 03:08:07 -0400 (EDT)
• References: <d69bi8\$5tn\$1@smc.vnet.net>
• Sender: owner-wri-mathgroup at wolfram.com

```Thanks for your suggestions.
I noticed that there is appreciable dependence on the Mathematica version (Windows)

Version 4.0: Examples 1 and 2 are ok, example 3 is not
Version 5.0: Examples 1 and 3 (using Thread) are ok, but example 2 is not

Regards,
Wolfgang

Dr. Wolfgang Hintze wrote:

> 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:=
> rv[t_] := {x[t], y[t]}
>
> In:= rv[t]
>
> Out= {x[t], y[t]}
>
> In:= M = {{a, b}, {c, d}}
>
> Out= {{a, b}, {c, d}}
>
> In:= eq = D[rv[t], t] == M . rv[t]
>
> Out= {Derivative[x][t], Derivative[y][t]} == {a*x[t] +
> b*y[t], c*x[t] + d*y[t]}
>
> In:= sm = DSolve[eq, rv[t], t];
>
> In:= x[t] /. sm
>
> Out= {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:= Clear[rv, M, n, x, k, eqm]
>
> In:= n = 2;
>
> In:= rv[t_, n_] := Table[x[k, t], {k, 1, n}]
>
> In:= rv[t, n]
>
> Out= {x[1, t], x[2, t]}
>
> In:= M[n_] := Table[Table[Random[], {n}], {n}]
>
> In:= MatrixForm[M[n]]
>
> Out//MatrixForm=
> MatrixForm[{{0.4129438091150023, 0.19074665264305043},
> {0.31296972444474486, 0.31543944991928186}}]
>
> In:= eqm = D[rv[t, n], t] == M[n] . rv[t, n]
>
> Out=
> {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:= DSolve[eqm, rv[t,n], t]
>
>  From In:= DSolve::"nvld" : "The description of the equations
> appears to be ambiguous or \
> invalid."
>
>  From In:= DSolve::"deqx" : "Supplied equations are not
> differential equations of the \
> given functions."
>
>  From In:= DSolve::"deqx" : "Supplied equations are not
> differential equations of the \
> given functions."
>
> Out= 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:= DSolve::"nvld" : "The description of the equations
> appears to be ambiguous or \
> invalid."
>
>  From In:= DSolve::"deqx" : "Supplied equations are not
> differential equations of the \
> given functions."
>
>  From In:= DSolve::"deqx" : "Supplied equations are not
> differential equations of the \
> given functions."
>
>

```

• Prev by Date: Re: bode diagram
• Next by Date: Help for an integral
• Previous by thread: Re: Vector of functions in ordinary differential equations
• Next by thread: OO System for Mathematica