Re: Re: matrix diffential equations
- To: mathgroup at smc.vnet.net
- Subject: [mg27548] Re: [mg27517] Re: matrix diffential equations
- From: "Mark Harder" <harderm at ucs.orst.edu>
- Date: Wed, 7 Mar 2001 04:07:45 -0500 (EST)
- Sender: owner-wri-mathgroup at wolfram.com
Jens, I just tried your solution & I don't think it worked either: In[1145]:=NDSolve[eqns /. s -> 0, Flatten[yvec], {u, 0, 2}] Out[1145]= {{y[1, 1][u] -> InterpolatingFunction[][u], y[1, 2][u] -> InterpolatingFunction[][u], y[1, 3][u] -> InterpolatingFunction[][u], y[2, 1][u] -> InterpolatingFunction[][u], y[2, 2][u] -> InterpolatingFunction[][u], y[2, 3][u] -> InterpolatingFunction[][u], y[3, 1][u] -> InterpolatingFunction[][u], y[3, 2][u] -> InterpolatingFunction[][u], y[3, 3][u] -> InterpolatingFunction[][u]}} In[1146]:= yvec[.5] /. % Out[1146]= {{{InterpolatingFunction[][u], InterpolatingFunction[][u], InterpolatingFunction[][u]}, {InterpolatingFunction[][u], InterpolatingFunction[][u], InterpolatingFunction[][u]}, {InterpolatingFunction[][u], InterpolatingFunction[][u], InterpolatingFunction[][u]}}[0.5]} In[1147]:= y[1, 1][.5] Out[1147]= y[1, 1][0.5] -mark harder -----Original Message----- From: Jens-Peer Kuska <kuska at informatik.uni-leipzig.de> To: mathgroup at smc.vnet.net Subject: [mg27548] [mg27517] Re: matrix diffential equations >Hi, > >> Simple way to crash Mathematica is by writing >> y := Array[y, {3, 3}] >> Even Quit Kernel doesn't stop Mathematica, and I have experience application >> error and crashes (both in Mathematica dll and Mathematica.exe for simple >> programs) and in so cases Mathematica has to be closed from the Task Manager >> (Windows 2000). Regarding Mathematica exception coding, I'm not impressed, >> just IMHO. > >If you code a recursion you have to live with the result. >My personal opinion is that Mathemtica should format >the hard drive in such a case and overheat the CPU. >This will teach clever users to *think* before they >use a computer algebra. >A vector is typical not identical with it's components. > >> >> Just have to buss it out :-( >> >> My question is the following: Is there a simple way to define matrix >> diffential equation in Mathematica, I have tried something like: >> A[t_]:= {{1,1,1},{1,1,1},{1,1,1}}*t >> y := Array[ytmp, {3, 3}] >> eqns = {y'[u] == A[u]. y[u], y[s] == A[s]} >> NDSolve[eqns, y, {u, s, t}] >> >> But this is not the way. > >Perhaps ? > >yvec = Map[#[u] & , Array[y, {3, 3}], {2}] > >eqns = Flatten [ > Thread /@ Flatten[ > Thread[#, List] & /@ > {D[yvec, u] == A[u].yvec, > (yvec /. u -> s) == A[s]}]] > >NDSolve[eqns /. s -> 0, Flatten[yvec], {u, 0, 2}] > > >BTW is the SetDealyed[] in > >y := Array[ytmp, {3, 3}] > >a habit or has it deeper reasons. > >Regards > Jens >