Message Boards Message Boards

0
|
4749 Views
|
1 Reply
|
2 Total Likes
View groups...
Share
Share this post:

Is Mathematica good for solving a large coupled differential equations sys?

Posted 10 years ago

I need to solve a 17 first-order coupled differential equations system (+17 initial values equations) for a reliability markovian chain, and I need to know if Mathematica a good program for solving them. I tested for a simpler system of 4 equations (+4 initial values) and it didn't returned any result. I can't seem to find any problem in my sintaxe or in the equations that would justify the lack of return, but in any case here is my input:

DSolve[
 {yP'[x] == -yP[x]*(lambdaA + lambdaB) + miA*yA[x] + miB*yB[x],
  yA'[x] == yP[x]*lambdaA - (miA + lambdaB)*yA[x],
  yB'[x] == yP[x]*lambdaB - (lambdaA + miB)*yB[x],
  yF'[x] == yA[x]*lambdaB + yB[x]*lambdaA,
  yP[0] == 1,
  yA[0] == 0,
  yB[0] == 0,
  yP[0] == 0},
 {yP, yA, yB, yF}, 
x]

where lambdaA/B and miA/B are pre-defined. I've already tried using NDSolve, but it wouldn't work either. I've read all the mathematica forums/helps i could find about coupled diff. eq. systems, but they never mention systems larger than 3 equations (+initial values). I apologize for any grammar mistake, and greatly thank every answer.

POSTED BY: Bruno Warth

Bruno,

In your code yP[0] == 0 is specified twice. Linear systems of ODEs with constant coefficients are handled well by DSolve[], if your system is nonlinear consider using NDSolve (in case DSolve[] fails). Also, linear systems with constant coefficients can be solved explicitly. Here is an example:

(* X' = A.X + F *)
A = {{1, 0, 0, 0, 0}, {1/2, 1, 0, 0, 0}, {1/2, 1/2, 1, 0, 0}, {0, 0, 
    0, 1, 1/2}, {-1, 0, 0, 0, 1}} ;
X = {x1, x2, x3, x4, x5} ;
X0 = {1, 0, 0, 0, 0} ;
F = {t, Sin[t], 0, Cos[t], DiracDelta[t - 1]} ;
(* DSolve *)
Through[X[t]] /. DSolve[ 
        {
          Thread[D[Through[Flatten[X][t]], t] == A.Through[X[t]] + F],
          Thread[Through[X[0]] == X0]
        },
        Through[X[t]],
        t
    ] // Flatten // Simplify
(* Explicit formular *)
MatrixExp[t A].X0 + 
  MatrixExp[t A].Integrate[
    Inverse[MatrixExp[x A]].(F /. t -> x), {x, 0, t}, 
    Assumptions -> Element[t, Reals]] // Simplify

I.M.

POSTED BY: Ivan Morozov
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract