Re: System of ODE
- To: mathgroup at smc.vnet.net
- Subject: [mg42074] Re: System of ODE
- From: "Will Self" <wself at msubillings.edu>
- Date: Wed, 18 Jun 2003 02:10:47 -0400 (EDT)
- References: <bcjtaj$hlt$1@smc.vnet.net> <bcmqfd$stm$1@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
"Amedeo" <wallpeer at libero.it> wrote in message news:bcmqfd$stm$1 at smc.vnet.net... > > NDSolve doesn't understand equations in matrix form, primarily because > > Equal isn't Listable. > > > > Here's the form you need: > > > > NDSolve[Flatten[Thread /@ {A'[t] == M[t].A[t] + 2*C, A[0] == {0, 0}}], > > A[t], {t, 0, 300}] > > > > Note that you can't use D as a variable name, and matrix multiplication > > is done with Dot, not *. And with such a long time interval, you'll > > likely need to use the MaxSteps option. > > > > ----- > > solution=NDSolve[Flatten[Thread/@{B'[t]\[Equal]A[t].B[t],B[0]\[Equal]{0,0}}] > , > B[t],{t,0,300}] > > NDSolve::ndnco: The number of constraints (2) (initial conditions) is not \ > equal to the total differential order of the system (1). > > NDSolve::ndnco: The number of constraints (2) (initial conditions) is not \ > equal to the total differential order of the system (1). > > why this problem? This will work if first you type B[t_]={x[t],y[t]}. The solution is given in rule form. You need to use the rule to create an actual usable solution. I suggest some cautions. Stop using capital letters. Certain capital letters like C, N, and D are reserved in Mathematica. If you use caps, sooner or later you will forget and cause yourself problems. Notice that the solution to your system is going to be B[t] identically 0, because of the initial condition. When you try to plot it you may wonder where the graph is.