Solving a First Order Linear ODE System with a Constraint

Click For Summary

Discussion Overview

The discussion revolves around solving a first order linear ordinary differential equation (ODE) system with a constraint. Participants explore methods for incorporating the constraint A + B + C = 1 into the system of equations, while also addressing the broader context of working with multiple equations and variables in MATLAB.

Discussion Character

  • Exploratory
  • Technical explanation
  • Homework-related
  • Mathematical reasoning

Main Points Raised

  • One participant presents a system of ODEs and seeks guidance on including the constraint A + B + C = 1.
  • Another participant suggests that the constraint can be expressed as dA/dt + dB/dt + dC/dt = 0.
  • A different approach is proposed, where C is substituted with 1 - A - B in the original equations, leading to modified equations for A and B.
  • A participant expresses a need for a more general analytical approach to handle multiple equations in MATLAB, rather than solving them algebraically by hand.
  • Matrix exponentials are introduced as a method to represent the system, with suggestions on diagonalizing the matrix for easier solutions.
  • Clarification is sought regarding the notation used, specifically whether T refers to the transpose of the matrix.
  • One participant reflects on their initial misunderstanding, stating that the constraint was unnecessary for their specific application involving a Markov model.
  • Another participant inquires if the original poster can now solve the system without issues, to which the original poster confirms that the constraint is not needed.

Areas of Agreement / Disagreement

Participants do not reach a consensus on the necessity of the constraint, as one participant concludes it is unnecessary while others discuss methods to incorporate it. The discussion includes various approaches and acknowledges differing levels of understanding regarding the ODEs.

Contextual Notes

Participants express uncertainty about the applicability of certain methods and the implications of the constraint on their specific problems. There is also mention of initial errors in modeling that influenced the understanding of the system.

mykat
Messages
6
Reaction score
0
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?
 
Physics news on Phys.org
welcome to pf!

hello mykat! welcome to pf! :smile:
mykat said:
Now I would like to include the constraint that A + B + C = 1. How do I do this mathematically?

dA/dt + dB/dt + dC/dt = 0 :wink:
 
Or, just write C=1-A-B and insert it in the first two equations to obtain:
dA/dt=3A+2B-1
dB/dt=2A+3B-1
 
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?
 
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:
[tex] \frac{d\mathbf{X}}{dt}=\mathbf{J}\mathbf{X}[/tex]
From here you can diagonalise your J and then solve it very easily. Can can be automatically done in matlab.
 
Last edited:
Exponentials of matrices, so if you write in your example X=(A,B,C)T, the, you can write your equations in the form:
dXdt=JX

From here you can diagonalise your J and then solve it very easily. Can can be automatically done in matlab.

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.
 
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?
 
Only 7 equations.
 
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.
 
  • #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.
 
  • #11
So you can solve the system without any problems now?
 
  • #12
Sure. Solving it was never the issue, it was including the unity condition, which as it happens is not necessary.
 

Similar threads

  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 3 ·
Replies
3
Views
3K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 2 ·
Replies
2
Views
4K
  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
Replies
3
Views
3K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 9 ·
Replies
9
Views
3K