Streeter Pheps Equations

조회 수: 3 (최근 30일)
Carlos Gomes
Carlos Gomes 2012년 5월 22일
I need to do a program in Matlab with two first-order differential equations with the Streeter Phelps model. Please help me.
BOD: dL/dt=-(k1+ks)L+B
DO: d(D)/dt=k1L-k2D-P

답변 (2개)

Matt Kindig
Matt Kindig 2012년 5월 22일
What have you done so far? To get you started, look at the documentation for ode45 (and the other ODE solvers). The documentation gives really clear examples of how to set up your equations into the form required by the solvers. For first-order systems like this, it is almost trivial.
doc ode45
  댓글 수: 1
Carlos Gomes
Carlos Gomes 2012년 5월 22일
I need to put these two equations in Matlab by creating a Script and a Function. At the end I have to obtain a graph of these two equations. So I want you to explain me that :/

댓글을 달려면 로그인하십시오.


Walter Roberson
Walter Roberson 2012년 5월 22일
I have renamed your "D" to "Df" in order to prevent confusion with differentiation.
The Maple syntax would be
dsolve( [diff(L(t), t) = -(k1+ks)*L(t)+B, diff(Df(t), t) = k1*L(t)-k2*Df(t)-P ])
with result
Df(t) = (-k1 * k2 * C2 * (k1+ks) * exp(-t * (-k2+k1+ks)) + ((-P * ks + (B-P) * k1) * exp(k2*t) + C1 * k2 * (k1+ks)) * (-k2+k1+ks)) * exp(-k2*t) / ((k1+ks) * k2 * (-k2+k1+ks))
L(t) = B / (k1+ks) + exp(-(k1+ks) * t) * C2
In the above, C1 and C2 are constants of integration
  댓글 수: 2
Carlos Gomes
Carlos Gomes 2012년 5월 22일
I need to put these two equations in Matlab by creating a Script and a Function. At the end I have to obtain a graph of these two equations. So I want you to explain me that :/
Walter Roberson
Walter Roberson 2012년 5월 22일
http://www.mathworks.com/matlabcentral/answers/8026-best-way-s-to-master-matlab

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Ordinary Differential Equations에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by