Message Boards Message Boards

Analytically solving a large number of differential equations using DSolve?

I have 11 simultaneous first order differential equations to be solved analytically. I know the initial conditions as well. I tried using DSolve but it does not give an answer. No errors are indicated as well.

A simple example code is given below where I am trying to solve 4 equations simultaneously instead of 11. Even then I can not get an answer. DSolve just outputs the set of equations I am giving without solving them.

e

qn1 = D[x[t], t] == x[t] + y[t] + z[t]a[t];

eqn2 = D[y[t], t] == 2 x[t] - y[t] + z[t];

eqn3 = D[z[t], t] == x[t] - z[t] + 2 y[t] + 2 a[t];

eqn4 = D[a[t], t] == x[t]y[t] + 2 z[t] - 3 a[t];

init1 = x[0] == 1;

init2 = y[0] == 1;

init3 = z[0] == 0;

init4 = a[0] == 1;

sol = DSolve[{eqn1, eqn2, eqn3, eqn4, init1, init2, init3, init4}, {x[t], y[t], z[t], a[t]}, t]

Is there any way to tackle this problem? Or is there any limit to the number of differential equations that can be solved analytically in Mathematica? I am new to Mathematica and a clear answer will be much appreciated. Thank you.

2 Replies

Curiously, NDSolve does work for your equations. (Note that the e of eqn1 for the first line is outside your code block in the post).

POSTED BY: Frank Kampas
Posted 7 years ago

I think the product terms x[t] y[t] and z[t] a[t] are giving it trouble. DSolve can be hit or miss, though maybe someone else has a trick.

NDSolve can do it though. Note your solutions go to infinity rather quickly.

eqn1 = D[x[t], t] == x[t] + y[t] + z[t] a[t];
eqn2 = D[y[t], t] == 2 x[t] - y[t] + z[t];
eqn3 = D[z[t], t] == x[t] - z[t] + 2 y[t] + 2 a[t];
eqn4 = D[a[t], t] == x[t] y[t] + 2 z[t] - 3 a[t];
init1 = x[0] == 1;
init2 = y[0] == 1;
init3 = z[0] == 0;
init4 = a[0] == 1;
sol = NDSolve[{eqn1, eqn2, eqn3, eqn4, init1, init2, init3, 
    init4}, {x, y, z, a}, {t, 0, 1}];
Plot[{x[t], y[t], z[t], a[t]} /. sol, {t, 0, 1}]

enter image description here

Eric

POSTED BY: Eric Meyers
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