Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

ODE System Help

  1. Jun 21, 2011 #1
    Hello all,
    I don't have much experience with ODEs.

    I have a simple system, which I believe is first order linear, similar to the following:

    dA/dt = 2A + 3B - C

    dB/dt = A + 2B - C

    dC/dt = -2A + 5B - 2C

    Now I would like to include the constraint that A + B + C = 1. How do I do this mathematically?
  2. jcsd
  3. Jun 21, 2011 #2


    User Avatar
    Science Advisor
    Homework Helper

    welcome to pf!

    hello mykat! welcome to pf! :smile:
    dA/dt + dB/dt + dC/dt = 0 :wink:
  4. Jun 21, 2011 #3


    User Avatar
    Homework Helper

    Or, just write C=1-A-B and insert it in the first two equations to obtain:
  5. Jun 21, 2011 #4
    Thank you for the replies. I appreciate the input, I had thought to use a similar method but I wasn't sure if it was applicable.

    Unfortunately, I have 7 equations and 7 variables, and as I am working with matlab, I need to have them each in the form similar to dA/dt = 3A + 4B...

    Is there a more general analytical approach, rather than algebraically working out all of the equations by hand?
  6. Jun 21, 2011 #5


    User Avatar
    Homework Helper

    Exponentials of matrices, so if you write in your example [itex]\mathbf{X}=(A,B,C)^{T}[/itex], the, you can write your equations in the form:
    From here you can diagonalise your J and then solve it very easily. Can can be automatically done in matlab.
    Last edited: Jun 21, 2011
  7. Jun 21, 2011 #6
    By T do you mean transpose? If so, I initially had the matrices in that form. After that I wanted to add the A + B + C = 1 condition, without working out and modifying each line by hand. Is there a way to do this?

    Sorry if I've completely misunderstood you.
  8. Jun 21, 2011 #7


    User Avatar
    Homework Helper

    T does mean transpose. As for the A+B+C=1 condition, it's only 7 equations, or do you mean to increase it later?
  9. Jun 21, 2011 #8
    Only 7 equations.
  10. Jun 21, 2011 #9


    User Avatar
    Homework Helper

    Then it's not that bad then, once you've done that little hardship then you can apply my method as a quick way of solving the system.
  11. Jun 22, 2011 #10
    As it turns out, the constraint was completely unnecessary. The time I wasted on this problem yesterday reflects my poor understanding of differential equations.

    I am actually working with a Markov model, where the initial conditions dictate that state 1 has probability = 1 and all others are zero. Based on the nature of differential equations, probability is conserved when the system is modeled correctly.

    Initially I had made a small error in the model, which gave me strange results and the false idea that I had to include a constraint. This was a great learning experience. I only wish the class I took on diff eq 2 years ago were this useful to me.

    Thanks for the help anyway.
  12. Jun 22, 2011 #11


    User Avatar
    Homework Helper

    So you can solve the system without any problems now?
  13. Jun 22, 2011 #12
    Sure. Solving it was never the issue, it was including the unity condition, which as it happens is not necessary.
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Similar Discussions: ODE System Help
  1. System of ODEs (Replies: 2)

  2. Systems ODE (Replies: 1)

  3. System of ODE (Replies: 0)

  4. System of ODE (Replies: 0)