Message Boards Message Boards

0
|
3900 Views
|
6 Replies
|
0 Total Likes
View groups...
Share
Share this post:

Solve a group of 3 differential equations?

Posted 3 years ago

This is my 1st or 2nd time using Mathematica actually. As a synthetic chemistry major PhD, I really don't have many equations to solve so I have very little experience in this. I tried to expand someone else's code about solving a group of 2 differential equations to a group of 3. The original code run well but mine seems to always fail with the following error:

DSolve::nolist: "List encountered within ...... There should be no lists on either side of the equations."

The documentation suggests deleting some braces in the code but I don't know which ones to delete. Deeply appreciate if someone could help.

a = {{k2, 0, 0}, {-k2, 0, 0}, {0, 0, k2}}
b = {{-k1*c}, {0}, {-k3*c}}
c = 0.01
DSolve[{{Derivative[1][y1][t], Derivative[1][y2][t], 
    Derivative[1][y3][t]} == a.{y1[t], y2[t], y3[t]} + b, y1[0] == 0, 
  y2[0] == 0, y3[0] == 0}, {y1[t], y2[t], y3[t]}, {t}]
POSTED BY: Suonan Du
6 Replies

Ok.

But I think if you want to describe a series of 1st order reactions a -> b -> c you should reformulate your equations.

sol = DSolve[{
    D[fa[t], t] == - k1 fa[t],
    D[fb[t], t] == -k2 fb[t] + k1 fa[t],
    D[fc[t], t] == k2 fb[t],
    fa[0] == 1,
    fb[0] == 0,
    fc[0] == 0
    },
   {fa, fb, fc},
   t] // Flatten
fff[t_, k1_, k2_] := Evaluate[{fa[t], fb[t], fc[t]} /. sol]
Manipulate[
 Plot[
  Evaluate[fff[t, k1, k2]], {t, .00001, 10}, 
  PlotStyle -> {Red, Blue, Black}],
 {k1, 0, 3}, {k2, .00002, 3}]
POSTED BY: Hans Dolhaine
Posted 3 years ago

Thanks for your answer.

POSTED BY: Suonan Du

That is an interesting problem. I assume you want to describe the kinetics of a reacting system.

But your solutions seem to tend to Infinity, which is not realistic. Would you mind to describe your reactions?

POSTED BY: Hans Dolhaine
Posted 3 years ago

Hi,

They are 1st order kinetics equations for a series of reactions. I have just found out I don't have enough experimental data to get an answer to this problem so I just decide to give up on it.

POSTED BY: Suonan Du
Posted 3 years ago

You have to change the expression for b:

b = {-k1*c, 0, -k3*c}
POSTED BY: Michael Helmle
Posted 3 years ago

Thanks a lot.

POSTED BY: Suonan Du
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