Re: NDSolve and vector functions
- To: mathgroup at smc.vnet.net
- Subject: [mg87953] Re: NDSolve and vector functions
- From: dh <dh at metrohm.ch>
- Date: Mon, 21 Apr 2008 03:25:17 -0400 (EDT)
- References: <fu9vl0$ie2$1@smc.vnet.net>
HI, thank's a lot for the replies. I think the most practicable way is the solution due to Carl. He packs all vector valued constants into functions that only evaluate if the argument is numeric. I will play around with this to check if there are no surprises. thank's again, Daniel dh wrote: > Hello all, > > does anybody know a way to compute a vector valued function using > > NDSolve without explicitely specifying all vector components. Here is a > > simple example: Although NDSolve[{p'[t]==p[t],p[0]=={1,0}},p,{t,0,1}] works, > > NDSolve[{p'[t]==p[t]+{1,1},p[0]=={1,0}},p,{t,0,1}] > > does not work because p[t] in "p[t]+{1,1}" is treated as a scalar and > > the expression is evaluated to {1+p[t],1+p[t]} what is clearly not > > intended. Even in "IdentityMatrix[2].p[t]+{1,1}" > > "IdentityMatrix[2].p[t]" is treated like a scalar and added to the > > components of {1,1}. > > do I miss something??? > > Daniel > > >