Re: Re: Linear Differential Equations with Matrices
- To: mathgroup at smc.vnet.net
- Subject: [mg59622] Re: [mg59461] Re: [mg59413] Linear Differential Equations with Matrices
- From: Chris Chiasson <chris.chiasson at gmail.com>
- Date: Sun, 14 Aug 2005 04:38:08 -0400 (EDT)
- References: <200508090730.DAA19044@smc.vnet.net> <200508100656.CAA04520@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
an shorter way to specify the elements of the P matrix: P[t]=Array[p[##][t]&,{3,3}] (if you are willing to refer to your functions as p[1,1][t], p[1,2][t], etc -- otherwise you could combine the above approach with ToString and ToExpression) On 8/10/05, Selwyn Hollis <sh2.7183 at earthlink.net> wrote: > > On Aug 9, 2005, at 3:30 AM, David Boily wrote: > > > How can I solve this system with mathematica: > > > > <<LinearAlgebra`MatrixManipulation` > > > > A = {{-F1, 0, 0}, {0, -F2, 0}, {1, -1, 0}} > > Q = {{0, 0, 0}, {0, 0, 0}, {0, 0, 1}} > > Z = ZeroMatrix[3] > > > > DSolve[{P'[t] + Transpose[A].P[t] + P[t].A + Q == Z, R'[t] + > > Transpose[A].R[t] + P[t] == Z, P[T]==Z, R[T]==Z}, {P, R}, t] > > > > where P and R are 3x3 matrix functions of t. Mathematica tells me: > > > > Solve::eqf: {{-F1, 0, 1}, <<2>>} . R[t] + <<2>> == {{0, <<2>>}, <<2>>} > > is not a well-formed equation. > > > > shouldn't this be possible without going the long way and defining > > > > P[t_]:={{p11[t], p12[t], p13[t]}, {p21[t], p22[t], p23[t]}, {p31 > > [t],p32[t], p33[t]}} > > R[t_]:={{r11[t], r12[t], r13[t]}, {r21[t], r22[t], r23[t]}, {r31 > > [t],r32[t], r33[t]}} > > > > Thanks, > > > > David Boily > > Centre for Intelligent Machines > > McGill University > > Montreal, Quebec > > > > > It would be nice, but unless I'm mistaken the only way to do it is to > provide DSolve with a flat list of scalar equations. Anyhow, the > following does the trick: > > << "LinearAlgebra`MatrixManipulation`" > A = {{-F1, 0, 0}, {0, -F2, 0}, {1, -1, 0}}; > Q = {{0, 0, 0}, {0, 0, 0}, {0, 0, 1}}; > Z = ZeroMatrix[3]; > > P[t_] := {{p11[t], p12[t], p13[t]}, {p21[t], p22[t], p23[t]}, {p31 > [t], p32[t], p33[t]}} > R[t_] := {{r11[t], r12[t], r13[t]}, {r21[t], r22[t], r23[t]}, {r31 > [t], r32[t], r33[t]}} > > deqns = Flatten[ Thread /@ Flatten[ Thread /@ > {P'[t] + Transpose[A].P[t] + P[t].A + Q == Z, > R'[t] + Transpose[A].R[t] + P[t] == Z, > P[T] == Z, R[T] == Z} ] ]; > > vars = Flatten[{P[t], R[t]}]; > > solnrules = DSolve[deqns, vars, t]//First//Simplify > > MatrixForm[ Psoln = P[t] /. solnrules ] > > MatrixForm[ Rsoln = R[t] /. solnrules ] > > > ---------------------- > Selwyn Hollis > http://www.appliedsymbols.com > > -- Chris Chiasson http://chrischiasson.com/ 1 (810) 265-3161
- References:
- Linear Differential Equations with Matrices
- From: David Boily <dsboily@fastmail.ca>
- Re: Linear Differential Equations with Matrices
- From: Selwyn Hollis <sh2.7183@earthlink.net>
- Linear Differential Equations with Matrices