PDA

View Full Version : Calculation system of differential equations in mathcad


unforgiven_davs
Apr 28, 2012, 12:32 PM
I would like to learn to solve system of differential equation in MathCad like this one:
dI(t)/dt = coeff * I(t) * S(t)

dS(t)/dt = -coeff * I(t) * S(t)

N = S(t) + I(t)

where 'N' and 'coeff' are user specified coefficients

In MathCad I did:
( coeff * y0 * y1 )
D(t, y) := ( )
( -coeff * y0 * y1 )

( 1 )
ic := ( )
( 9 )

But :
S := rkfixed (ic, 0, 10, 100, D)

returns: D - this function can't be used here.

And I don't know how and where insert N=S(t) + I(t) equation :(

Chic_Bowdrie
May 15, 2012, 12:13 PM
I don't have MathCad, but the solution is straight forward by substituting S = N - L into the deritative equation dL/dt. Separate the variables, L on one side and dt on the other, then integrate both sides of the following:

dL/(L(N-L)) = Cdt

C is the coeff in your differential equations. The integration gives you t as a function of the log of L. The solution for L is

L= N/(1-e^N^(^C^t^-^x^))

where x is an integration constant. Do the same for dS/dt and you get

S= N/(1-e^-^N^(^C^t^-^x^))