Re: Vector-valued DE's
- To: mathgroup at smc.vnet.net
- Subject: [mg16424] Re: Vector-valued DE's
- From: "Kevin J. McCann" <kevinmccann at Home.com>
- Date: Sat, 13 Mar 1999 02:21:40 -0500
- Organization: @Home Network
- References: <7c5bih$7ro@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
I think the following is what you are after:
Thread[{a,b,c}=={d,e,f}]
{a==d,b==e,c==f}
To use in DE's:
Your vector function:
z[t_]={a[t],b[t],c[t]}
and
rhs[t_]={d[t],e[t],f[t]}
Now
z''[t]==rhs[t]
doesn't quite work, but
Thread[z''[t]==rhs[t]]
{a''[t]==d[t],b''[t]==e[t],c''[t]==f[t]}
Similarly for the IC's, then just use Flatten to get a single list with DE +
IC.
Hope this helps,
Kevin
Dirk Kraaijpoel wrote in message <7c5bih$7ro at smc.vnet.net>...
>Hello out there!
>
>I am aware that this same question has been asked here before:
>
>* see
>*
>x14.dejanews.com/[ST_rn=ap]/getdoc.xp?AN=435165115&CONTEXT=920912797.927203
423&hitnum=0,
>*
>
>but apparently it has not been answered. I post it again because it does
>not
>seem too trivial or too hard.
>I would like for DSolve or NDSolve to solve a vector-valued differential
>equation,
>and I do not want to specify each equation separately.
>Basically I want to do
>
>NDSolve[{z'[t]==righthandside[z[t]],z[0]=incon},z,{t,0,1}]
>
>where z[_],righthandside[_] and incon are vector-valued.
>Unfortunately mathematica doesn't eat this, although it doesn't appear
>to
>be a fundamental problem for a function like NDSolve.
>
>Of course I could produce tables of equations for each vector element
>separately,
>but that would mean that righthandside[_] would be evaluated for each
>element in
>turn, which would be highly inefficient.
>
>Does anyone know an elegant way of solving this?
>
>Dirk Kraaijpoel
>