Sunteți pe pagina 1din 3

Sample Problem and Solution for System of ODEs

1) In a solution mixing situation described by Fig. 1, two tanks, T1 and T2 are used to mix salt
water. T1 initially contains 100 L of water, while T2 initially contains 100 L of water in
which 150 kg of salt are dissolved. The inflow into T1 is 4 L/min from T2 and 12 L/min
with 1 kg/L salt from the outside. The inflow into T2 is 16 L/min from T1. The outflow
from T2 is 4 + 12 = 16 L/min, as shown in Fig. 1.

Fig. 1: Mixing problem as a system of ODE.

Obtain the two equations which form the system of ODE to be solved. Then, solve the
system of ODE using Laplace transform to obtain salt contents 𝑦1 (𝑡) and 𝑦2 (𝑡) in T1 and
T2 respectively.

Solutions:

The system of two ODEs can be obtained by considering:

Salt content in T1 (Tank 1) = y1(t) Salt content in T2 (Tank 2) = y2(t)

And the flow concept: ‘rate of change of content = inflow rate – outflow rate’
4 16
For T1: 𝑦1 ′ = 100 𝑦2 + 12 − 100 𝑦1
16 4 12
For T2: 𝑦2 ′ = 100 𝑦1 − 100 𝑦2 − 100 𝑦2

Note the equations have dimension (unit) of kg/min

Rearrange for more systematic form:

𝑦1 ′ + 0.16𝑦1 − 0.04𝑦2 − 12 = 0
𝑦2 ′ − 0.16𝑦1 + 0.16𝑦2 = 0

Apply Laplace transform to both equations:


12
𝑠𝑌1 − 𝑦1 (0) + 0.16𝑌1 − 0.04𝑌2 − 𝑠 = 0
𝑠𝑌2 − 𝑦2 (0) − 0.16𝑌1 + 0.16𝑌2 = 0

Substituting the initial values (y1(0) = 0, y2(0) = 150) and collecting similar terms give:
12
(𝑠 + 0.16)𝑌1 − 0.04𝑌2 =
𝑠
−0.16𝑌1 + (𝑠 + 0.16)𝑌2 = 150

This can be re-written in matrix form for better clarity:


12
𝑠 + 0.16 −0.04 𝑌1
[ ][ ] = [ 𝑠 ]
−0.16 𝑠 + 0.16 𝑌2 150

The set of equations can be solved by any suitable method (e.g. elimination method,
Cramer’s rule, etc.). Solution by Cramer’s rule is shown here:

Finding determinants, let:

𝑠 + 0.16 −0.04
𝐷=| | = 𝑠 2 + 0.32𝑠 + 0.0192 = (𝑠 + 0.08)(𝑠 + 0.24)
−0.16 𝑠 + 0.16
12
−0.04 18𝑠+1.92
𝐷1 = | 𝑠 |= 𝑠
150 𝑠 + 0.16
12
𝑠 + 0.16 150𝑠2 +24𝑠+1.92
𝐷2 = | 𝑠 |= 𝑠
−0.16 150

Y1 can be found by D1 / D:
18𝑠+1.92 𝐴 𝐵 𝐶
𝑌1 (𝑠) = 𝑠(𝑠+0.08)(𝑠+0.24) = 𝑠 + 𝑠+0.08 + 𝑠+0.24

We solve the partial fraction unknowns by comparing the numerators of both sides:

𝐴(𝑠 + 0.08)(𝑠 + 0.24) + 𝐵(𝑠)(𝑠 + 0.24) + 𝐶(𝑠)(𝑠 + 0.08) = 18𝑠 + 1.92

𝐴(𝑠 2 + 0.32𝑠 + 0.0192) + 𝐵(𝑠 2 + 0.24𝑠) + 𝐶(𝑠 2 + 0.08𝑠) = 18𝑠 + 1.92

(𝐴 + 𝐵 + 𝐶)𝑠 2 + (0.32𝐴 + 0.24𝐵 + 0.08𝐶)𝑠 + (0.0192𝐴) = 18𝑠 + 1.92

Equating the coefficients: Note: A, B, C can be found more quickly by


testing with s = 0, s = -0.08, s = -0.24
respectively.
0.0192𝐴 = 1.92, so A = 100

0.32(100) + 0.24𝐵 + 0.08𝐶 = 18


0.24𝐵 + 0.08𝐶 = −14 … E1

100 + 𝐵 + 𝐶 = 0
𝐵 + 𝐶 = −100 … E2

Solve E1 & E2 to get C = -62.5, B = -37.5

So Y1 in partial fraction form is:


100 37.5 62.5
𝑌1 (𝑠) = − 𝑠+0.08 − 𝑠+0.24
𝑠

Take inverse Laplace transform:

𝑦1 (𝑡) = 100 − 37.5𝑒 −0.08𝑡 − 62.5𝑒 −0.24𝑡

Similarly, Y2 can be found by D2 / D:

150𝑠2 +24𝑠+1.92 𝐴 𝐵 𝐶
𝑌2 (𝑠) = 𝑠(𝑠+0.08)(𝑠+0.24) = 𝑠 + 𝑠+0.08 + 𝑠+0.24

We solve the partial fraction unknowns by comparing the numerators of both sides:

𝐴(𝑠 + 0.08)(𝑠 + 0.24) + 𝐵(𝑠)(𝑠 + 0.24) + 𝐶(𝑠)(𝑠 + 0.08) = 150𝑠 2 + 24𝑠 + 1.92

𝐴(𝑠 2 + 0.32𝑠 + 0.0192) + 𝐵(𝑠 2 + 0.24𝑠) + 𝐶(𝑠 2 + 0.08𝑠) = 150𝑠 2 + 24𝑠 + 1.92

(𝐴 + 𝐵 + 𝐶)𝑠 2 + (0.32𝐴 + 0.24𝐵 + 0.08𝐶)𝑠 + (0.0192𝐴) = 150𝑠 2 + 24𝑠 + 1.92

Equating the coefficients:


Note: A, B, C can be found more quickly by
testing with s = 0, s = -0.08, s = -0.24
0.0192𝐴 = 1.92, so A = 100 respectively.

0.32(100) + 0.24𝐵 + 0.08𝐶 = 24


0.24𝐵 + 0.08𝐶 = −8 … E1

100 + 𝐵 + 𝐶 = 150
𝐵 + 𝐶 = 50 … E2

Solve E1 & E2 to get C = 125, B = -75

So Y2 in partial fraction form is:


100 75 125
𝑌2 (𝑠) = − 𝑠+0.08 + 𝑠+0.24
𝑠

Take inverse Laplace transform:

𝑦2 (𝑡) = 100 − 75𝑒 −0.08𝑡 + 125𝑒 −0.24𝑡

S-ar putea să vă placă și