General Solution Methods Colorado School of Mines CHEN403

advertisement
Colorado School of Mines CHEN403
General Solution Methods
General Solution Methods ................................................................................................................................. 1
Summary of Topics............................................................................................................................................... 1
References ............................................................................................................................................................... 1
Direct Integration of Separable Equations.................................................................................................. 1
Linear Valve Characteristics ........................................................................................................................ 2
Non-Linear Valve Characteristics .............................................................................................................. 3
Integration Factor................................................................................................................................................. 4
Higher Order Linear ODEs................................................................................................................................. 5
Solution of Coupled ODEs .................................................................................................................................. 7
Summary of Topics
•
•
•
Separation of variables for linear & non-linear ODES.
Homogeneous & non-homogeneous solutions of higher order linear ODES.
Solving coupled ODEs.
References
Elementary Differential Equations &
Boundary Value Problems, 3rd ed.
William Boyce & Richard DiPrima
John Wiley & Sons, 1977
Process Systems Analysis & Control, 2nd ed.
Donald R. Coughanowr
McGraw-Hill, 1965
Process Control — Designing Processes &
Control Systems for Dynamic Performance
Thomas E. Marlin
McGraw-Hill, 1995
We would like to find the analytical solution to the ODEs (ordinary differential equations)
that result from the material & energy balances.
Direct Integration of Separable Equations
Sometimes we can algebraically rearrange the ODE so that all of the expressions with one
variable are on one side of the equation and all of the variables with the time dependency
are on the other. In this case the ODE can be directly integrated. This separation of
variables techniques can be applied equally to linear and non-linear ODEs. The real
limitation is whether there are analytic forms for the resulting integrals.
General Solution Methods
-1-
December 21, 2008
Colorado School of Mines CHEN403
For example, let’s consider the liquid flow from a tank in which the flow through the outlet
valve is dependent upon the liquid level in the tank:
A1
dh1
= F0 − F1 where F1 = F1 ( h1 ) .
dt
We would like an expression for h1 ( t ) for various F0 ( t ) .
Linear Valve Characteristics
If the valve has linear valve characteristics:
A1
dh1
= F0 − C v h1 with the initial condition F0 ( 0 ) = F0* ≠ F0 ( t > 0 )
dt
then the ODE can be rearranged as:
A1
dh1
= dt .
F0 − C v h1
If F0 is not a function of t (other than a change at t = 0 ) then the variables have been
separated and both sides can be integrated. For a step change F0 ≠ F0* :
h1
t
dh1
= ∫ dt
F − C v h1 0
h* 0
A1 ∫
1
h1
 1

A1  − ln ( F0 − C v h1 )  = t
 Cv
 h1*
A1  F0 − Cv h1 
ln 
 = −t
C v  F0 − Cv h1* 
 Ct
F0 − C v h1
= exp  − v 
*
F0 − C v h1
 A1 
h1 =

 Ct
F0  F0
−  − h1*  exp  − v 
Cv  Cv
 A1 

=
 Cvt 
F0  F0 − F0* 
−
 exp  −

Cv  C v 
 A1 
Notice that one of the limits of integration is the initial level, h1* . And how do we determine
this initial h1* ? Set the time derivative to zero for the steady state condition (remember, at
steady state there is no accumulation) & insert the initial steady state values:
General Solution Methods
-2-
December 21, 2008
Colorado School of Mines CHEN403
A1
F*
dh1
= F0 − C v h1 ⇒ 0 = F0* − C v h1* ⇒ h1* = 0 at the initial steady state.
dt
Cv
Non-Linear Valve Characteristics
As a 2nd example, for the tank with non-linear valve characteristics:
A1
dh1
= F0 − C v h1 with the initial condition F0 ( 0 ) = F0* ≠ F0 ( t > 0 )
dt
Again, the initial h1* can be determined by setting the time derivative to zero & inserting the
initial steady state values:
2
 F0* 
dh1
*
*
*
A1
= F0 − Cv h1 ⇒ 0 = F0 − C v h1 ⇒ h1 =   at the initial steady state.
dt
 Cv 
Also again, if F0 is not a function of t (other than a change at t = 0 ) then the variables can
be separated and both sides can be integrated:
A1
dh1
F0 − C v h1
h1
A1 ∫
h1*
= dt
t
dh1
F0 − C v h1
= ∫ dt
0
h1
 2 h1 2F0

A1  −
− 2 ln F0 − Cv h1  = t
Cv
 C v
 h1*
(
 2
A1  −


(
h1 − h1*
Cv
)
) − 2F ln  F − C
C
0
2
v
0
v
 F −C
v
 0

h1  
 =t
h1*  

F0  F0 − C v h1 
Ct
=− v
ln 
*
C v  F0 − C v h1 
2 A1



F0*  F0  F0 − C v h1 
Ct
−
h
=− v
 1
 + ln 
*
C v  C v  F0 − F0 
2 A1

(
)
h1 − h1* +
Notice that we have not found an explicit solution h1 ( t ) but rather an implicit one. When
plotting, it is easier to calculate t ( h1 ) for the range h1* ≤ h1 ≤ (F0 / C v )2 .
General Solution Methods
-3-
December 21, 2008
Colorado School of Mines CHEN403
Integration Factor
The integrating factor can be used to integrate a 1st order linear ODE where the
coefficients can be functions of t . Consider:
a (t )
dY
+ b ( t )Y = c ( t )
dt
When a ( t ) ≠ 0 over the range of interest, then the equation can be rearranged to give:
dY
+ f ( t )Y = g ( t )
dt
where g ( t ) is the forcing function. The ODE is linear but not separable. However, we can
make it separable by defining an integrating factor:
F ≡ exp
( ∫ f (t ) dt )
If we multiply the ODE by the integrating factor:
exp
+ f ( t ) exp ( ∫ f ( t ) dt )Y = g ( t ) exp ( ∫ f ( t ) dt )
( ∫ f (t ) dt ) dY
dt
The left-hand side of this equation can be recognized as the expansion of the derivative of
the product:
d 
exp
dt 
+ f ( t ) exp ( ∫ f ( t ) dt )Y
( ∫ f (t ) dt )Y  = exp ( ∫ f (t ) dt ) dY
dt
So, the ODE is now:
d 
exp
dt 
( ∫ f (t ) dt )Y  = g (t ) exp ( ∫ f (t ) dt )
and can be solved to give:
∫ d exp ( ∫ f (t ) dt )Y  = ∫ g (t ) exp ( ∫ f (t ) dt ) dt
exp ( ∫ f ( t ) dt )Y = ∫ g ( t ) exp ( ∫ f ( t ) dt ) dt + I
Y = exp ( − ∫ f ( t ) dt ) ∫ g ( t ) exp ( ∫ f ( t ) dt ) dt + I exp ( − ∫ f ( t ) dt )
o
o
General Solution Methods
-4-
December 21, 2008
Colorado School of Mines CHEN403
where Io is a constant of integration to be determined from the initial conditions. Let’s
apply this to the tank flow with linear valve characteristics problem:
dh1
= F0 − C v h1 with the initial condition F0 ( 0 ) = F0* ≠ F0 ( t > 0 )
dt
dh1 C v
F
+ h1 = 0
dt A1
A1
A1
here: f ( t ) =
Cv
⇒ exp
A1
( ∫ f (t ) dt ) = exp CAt 
v
1
F
g (t ) = 0
A1
and:
 C vt  t F0
 Cv t 
 Cvt 
*
h1 = exp  −
 ∫ exp 
 dt + h1 exp  −

 A1  0 A1
 A1 
 A1 
 C t F 
C t  
 Ct
h1 = exp  − v  0 exp  v  − 1 + h1* exp  − v 
 A1  Cv 
 A1  
 A1 
 Cv t   *
 Cvt 
F0 
1 − exp  −
  + h1 exp  −

Cv 
 A1  
 A1 

 Ct
F F
h1 = 0 −  0 − h1*  exp  − v 
Cv  C v

 A1 
h1 =
This is the same result as found previously.
Higher Order Linear ODEs
When the coefficients are constant, then the solution can be determined in two parts: the
general homogeneous solution and the specific non-homogeneous part. Let’s assume we
have the homogeneous problem:
a
d 2Y
dY
+b
+ cY = 0
2
dt
dt
Let’s assume a solution of the form Y ( t ) = e rt . Then:
(
) ( ) ( )
a r 2e rt + b re rt + c e rt = 0
e ar + br + c  = 0
rt
2
General Solution Methods
-5-
December 21, 2008
Colorado School of Mines CHEN403
Since e rt ≠ 0 then:
ar 2 + br + c = 0
There will actually be two roots (which we can get using the quadratic equation rule):
r1 =
−b + b2 − 4ac
−b − b2 − 4ac
and r2 =
2a
2a
The total solution will be a linear combination of these two particular solutions:
Y ( t ) = C1e r1t + C2er2t
where the constants are determined from the boundary conditions.
Note that the form of the solution will be different if there are repeated roots. (This will not
be discussed here, though.)
If we have the general non-homogeneous problem:
a
d 2Y
dY
+b
+ cY = f ( t )
2
dt
dt
then the solution process is more complex. There are two steps:
1. Find the solution to the homogeneous problem, Yc ( t ) .
2. Find a particular solution to the full problem, Yp ( t ) . This can be done with the
method of undetermined coefficients.
3. The general solution to the full problem will be the sum of these two,
Y ( t ) = Yc ( t ) + Yp ( t ) .
For example, let’s find the solution to:
d 2Y
dY
−3
− 4Y = 4t 2
2
dt
dt
(1) The homogeneous solution comes from the roots of:
r 2 − 3r − 4 = 0 ⇒ r1 , r2 = 4, −1 ⇒ Yc ( t ) = C1e 4t + C2e −t .
(2) Next, let’s assume a particular solution of the form Yp ( t ) = At 2 + Bt + C . (It should
have the highest order of the polynomial present & all lower order terms.) Then:
General Solution Methods
-6-
December 21, 2008
Colorado School of Mines CHEN403
(2 A ) − 3(2 At + B ) − 4 ( At 2 + Bt + C ) = 4t 2
(2 A − 3B − 4C ) − (6 A + 4B ) t − ( 4 A ) t 2 = 4t 2
Comparing terms gives us three equations:
−4 A = 4
6 A + 4B = 0
2 A − 3B − 4C = 0
We have the solution A = −1 , B = 3/2 , and C = −13/8 . This gives the particular
solution:
3 13
Yp ( t ) = −t 2 + t −
2
8
(3) Finally we add these two together to get the total solution:
3 13
Y ( t ) = C 1e 4 t + C 2e − t − t 2 + t − .
2
8
There are various rules for picking the form of the particular solution when f ( t ) has the
following forms:
Pn ( t ) = a0t n + a1t n−1 + ⋯ + an

e αt Pn ( t )

f (t ) = 
e αt Pn ( t ) sin β t


e αt Pn ( t ) cos β t

but we will not discuss these here.
Solution of Coupled ODEs
We have seen cases where there are two or more variables that must be solved
simultaneously since the variables are in each equation. The goal is to do some type of
algebraic and/or calculus manipulation so that an equation can be created that only
depends upon one variable.
Let’s assume we have the ODEs:
General Solution Methods
-7-
December 21, 2008
Colorado School of Mines CHEN403
dY1
= 10 − 7Y1 + Y2
dt
.
dY2
= −6Y2 + 2Y1
dt
Solve the 2nd ODE for Y1 :
Y1 =
1 dY2
+ 3Y2
2 dt
and differentiate once:
dY1 1 d 2Y2
dY
=
+3 2 .
2
dt 2 dt
dt
Insert these expressions (the original & the differentiated form) into the 1st ODE:
 1 d 2Y2
dY 
 1 dY2

+ 3 2  = 10 − 7 
+ 3Y2  + Y2 .

2
dt 
 2 dt

 2 dt
2
d Y2
dY
+ 13 2 + 40Y2 = 20 .
2
dt
dt
This 2nd order ODE can be solved:
Y2 = C1e −8t + C2e −5t +
1
2
Y1 can then be obtained from the manipulated form of the original 2nd ODE:
Y1 =
1 dY2
1
1

+ 3Y2 = −8C1e −8t − 5C2e −5t + 3 C1e −8t + C2e −5t + 
2 dt
2
2

1
3
= −C1e −8t + C2e −5t +
2
2
General Solution Methods
(
)
-8-
December 21, 2008
Download