Skip navigation
About Us Contact Us Software Support

Q: How can I solve a second-order differential equation?

A: This possibility can be useful for various kinds of metabolism and pharmacokinetic models. To write any first-order, linear or nonlinear, differential equation in SAAM II, please see the link: How can I solve a differential equation that cannot be written in compartmental form?

For the equation to be second-order, we need to go through a little algebra.

Suppose we have the following second-order (i.e., with a second derivative) equation:

d^2(q1)/dt^2 = 0.5 dq1/dt - 0.1

The transfer function relative to this system is

           NUM(s)
H(s) = --------
           DEN(s)

This equation can be written in state-space form, that is:

q(t) = Kq(t) + Bu(t)
s(t) = Cq(t) + Du(t)

This could be done with any matrix language, such as MATLAB (The MathWorks) or O-Matrix (Harmonic Software). The coefficients of the matrix K are:

0.5000 0 -0.1000
1.0000 0 0
0 1.0000 0

The other matrices are all the identity. The vector B is equal to:

[1 00]

The vector C is equal to:

[0 01]

The vector D is equal to:

[0]

The corresponding differential equations are:

q1(t) =+ 0.5 q1(t)- 0.1 q3(t)

q2(t) =+ 1.0 q1(t)

q3(t) =+ 1.0 q2(t)

This is not a compartmental system; however, it can be implemented in SAAM II (see the link How can I solve a differential equation that cannot be written in compartmental form?). The input should be a bolus input in compartment 1.

The output function s1 = q3provides the desired solution..

<< Back to Support Page