22
1 5. DIFFERENTIAL EQUATIONS The most common mathematical structure employed in mathematical models of chemical engineering profession involve differential equations. These equations describe the rate of change of a dependent variable with respect to an independent variable. They can be expressed in any of the three coordinate systems mentioned earlier in Section 2.1.2. The independent variables may also include time as the fourth element in the description of a problem. Let’s first discuss the mathematical origin of differential equations. 5.1. Mathematical origin of differential equations An algebraic equation that involves a parameter describes a family of curves. For example, equation 5 .1 describes the family of curves shown in Figure 1. (5.1) -4 -3 -2 -1 0 1 2 3 4 -4 -3 -2 -1 0 1 2 3 4 c=4 c=-4 1 0.5 0.25 -1 -0.5 -0.25 Figure 1 Family of curves for the algebraic equation (Mickley, Sherwood & Reed) Process Modeling and Analysis – ECH 6412 - RG & NG 2001

Process Analysis and Modeling - University of South …natasha.eng.usf.edu › gilbert › courses › modelandanaly… · Web viewIn differential equations of first order and first

  • Upload
    others

  • View
    2

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Process Analysis and Modeling - University of South …natasha.eng.usf.edu › gilbert › courses › modelandanaly… · Web viewIn differential equations of first order and first

1

5. DIFFERENTIAL EQUATIONS

The most common mathematical structure employed in mathematical models of chemical engineering profession involve differential equations. These equations describe the rate of change of a dependent variable with respect to an independent variable. They can be expressed in any of the three coordinate systems mentioned earlier in Section 2.1.2. The independent variables may also include time as the fourth element in the description of a problem. Let’s first discuss the mathematical origin of differential equations.

5.1. Mathematical origin of differential equations

An algebraic equation that involves a parameter describes a family of curves. For example, equation 5.1 describes the family of curves shown in Figure 1.

(5.1)

-4 -3 -2 -1 0 1 2 3 4-4

-3

-2

-1

0

1

2

3

4c=4

c=-4

1 0.5

0.25

-1 -0.5

-0.25

Figure 1 Family of curves for the algebraic equation (Mickley, Sherwood & Reed)

Using differentiation and algebraic manipulation equation 5.1 can be expressed as a differential equaiton free of the parameter c. Let’s take the derivative of both sides with respect to x in this equation.

(5.2)

Process Modeling and Analysis – ECH 6412 - RG & NG 2001

Page 2: Process Analysis and Modeling - University of South …natasha.eng.usf.edu › gilbert › courses › modelandanaly… · Web viewIn differential equations of first order and first

2

Substituting the value of c, ,obtained from the original equation, the family of curves is expressed as

(5.3)

Equation 5.1 is known as the primitive of the differential equation represented by equation 5.3. If there are two parameters in the primitive equation we need to differentiate twice to eliminate the two parameters. Solving a differential equation means finding the primitive either by analytical or numerical means. So, usually during a modeling exercise the modeler comes up with one or more differential equations that describes the system. These equations are then solved to obtain the algebraic representation, the primitive equation, for the model.

Q.5.1 What is the equivalent differential equation describing the primitive equation expressed by ?

5.2. Definition of terms

There are several important terms used in the context of differential equations. These terms classify the various differential equations into groups according to certain features. Most of the time, this classification enables one to select a suitable solution method.

5.2.1. Order

The order of a differential equation is the order of the highest derivative in the equation.

5.2.2. Degree

The degree is the power the highest order derivative is raised after the equation is cleared of fractions and rationalized.

5.2.3. General solution

The solution of a differential equation that involves constants is the general solution. In the previous section, equation 5.1 is the general solution or the primitive to differential equation 5.3. Applying various boundary and/or initial conditions the particular curve out of the family of curves can be specified. The order of a differential equation determines how many separate initial and boundary values can be specified. For example, a second order differential equation needs either one initial and one boundary value or two boundary values. If there are more than that the problem might be overspecified.

5.2.4. Particular solution

When all the initial and boundary values are applied to a general solution, the constants are specified and a particular solution is obtained. For example, is a particular solution to the differential equation 5.3.

5.3. Classification of differential equations

Page 3: Process Analysis and Modeling - University of South …natasha.eng.usf.edu › gilbert › courses › modelandanaly… · Web viewIn differential equations of first order and first

3

The two top most classes for differential equations are Ordinary Differential Equations (ODE) and Partial Differential Equations (PDE). An ODE is a differential equation that has only one independent variable in its definition, whereas a PDE has more than one. Examination of the physical setting and problem description usually gives clues about the system and hint if the system should be modeled by ODEs or PDEs. In this chapter we will concentrate on ODEs. The most general form of an ODE with one independent variable x and one dependent variable y can be expressed as

(5.4)

Any y value that satisfies equation 5.4 is said to be the solution of the differential equation. The most general algebraic solution to this differential equation that ties y and x is

(5.5)

It is mathematically proven that each equation of the form 5.4 must have a solution of the form 5.5, whether we are able to find it or not. Let’s examine the solution methods for first order ODEs.

5.3.1. First order and first degree ODEs

Any first oder and first degree ODE can be expressed as

(5.6)

Depending on the functional form of M(x,y) and N(x,y) in equation 5.6, there are various solution methods.

5.3.1.1. Separable equations

If M and N in equation 5.6 are functions of only x and y, respectively, the equation can be restated as

(5.7)

The solution to equation 5.7 is obtained simply by integrating both sides of the equation.

(5.8)

5.3.1.2. Equations that become separable after change of variable

There is no universal method that can find the right variable change and transforms the problem to a simpler form. However, let’s illustrate the idea with an example. Consider the equation below

(5.9)

Equation 5.9 can be easily solved by the use of variable change xy=v.

Q.5.2 What is the solution to equation 5.9 after the variable change xy=v?

Page 4: Process Analysis and Modeling - University of South …natasha.eng.usf.edu › gilbert › courses › modelandanaly… · Web viewIn differential equations of first order and first

4

5.3.1.3. Homogeneous equations

A function f(x) is said to be homogeneous of the n-th degree if when x multiplied by a value t results in a funtional value . Simillarly, If a function is homogeneous in x and y the below equation should hold.

(5.10)

For the differential equation 5.6 where M(x,y) and N(x,y) are both homogeneous functions in x and y of the same degree the change of variable y=ux leads to a solution as shown.

(5.11)

Q.5.3 Show the derivation of equation 5.11 with the substitution y=ux.

5.3.1.4. First order first degree equations with linear coefficients

If M(x,y) and N(x,y) are linear functions of x and y so that equation 5.6 can expressed as

(5.12)

the following substitutions usually transforms equation 5.12 to a homogeneous one.

(5.13)

The constants m and n are found solving the following equations

(5.14)

Q.5.4 This method would fail if . If this is the case one can eliminate y from equation 5.12 by subtituting . The resulting equaion would be separable in x and w. Proove this method and suggest a general solution.

5.3.1.5. Exact equations

If the partial deriatives of M(x,y) and N(x,y) with respect to y and x, respectively, are the same, the left hand side of equation 5.6 is said to be an exact differential. The solution can be expressed by

(5.15)

or

Page 5: Process Analysis and Modeling - University of South …natasha.eng.usf.edu › gilbert › courses › modelandanaly… · Web viewIn differential equations of first order and first

5

(5.16)

Q.5.4 Consider the following differential equation

a) Proove that the left hand side forms an exact differential.b) What is the general solution?

5.3.1.6. Equations solvable by integrating factors

An integrating factor transforms a differential equation into an equation where the left hand side is an exact differential. Consider the below differential equation

(5.17)

The left hand side of Equation 5.17 forms an exact differential. However, the same equation can also be simplified by dividind both sides by 2y to give

(5.18)

Equation 5.18 does not have an exact differential on its left. To solve it we need to realize that 2y is an integrating factor that transforms the left hand side to an exact differential.

5.3.1.7. First order linear equations

The form of these type of differential equations can be rewritten as

(5.19)

where P and Q are either constants or functions of x only. is an integrating factor for this differential equationand the solution is

(5.20)

5.3.1.8. Bernoulli’s equation

The form of these type of differential equations can be expressed as

(5.21)

where P and Q are either constants or functions of x only. When equation 5.21 is divided by and the substitution is used it becomes a linear first order equation and can be solved as described in section 5.3.1.7.

5.3.1.9. Other integrating factors

Finding an integrating factor is usually a difficult task. However, there several standard forms which have known integrating factors. Three of these forms are below.

Page 6: Process Analysis and Modeling - University of South …natasha.eng.usf.edu › gilbert › courses › modelandanaly… · Web viewIn differential equations of first order and first

6

If is true, then is an integrating factor.

If is true, then is an integrating factor.

If and hold, then is an integrating factor.

5.3.1.10. Equations of the first order and higher degree

Equations of the first order and higher degree have the following form

(5.22)

Equation 5.22 can be solvable for dy/dx, y or x. Depending on this criterion there 3 cases to be considered for solution .

Case I. Eqations solvable for dy/dx.

Let’s investigate this case with an example. A typical equation is as follows

(5.23)

Equation 5.23 can be rewritten as

(5.24)

Equation 5.24 has the following two solutions

(5.25)

These two solutions can be combined by multiplication to give the final solution as

(5.26)

In differential equations of first order and first degree for every value of the independent variable there is only one corresponding slope at that point. However, for equations of n-th degree there are n slopes specified at every point.

Case II. Eqations solvable for y.

Differential equations solvable for y has the general form of

Page 7: Process Analysis and Modeling - University of South …natasha.eng.usf.edu › gilbert › courses › modelandanaly… · Web viewIn differential equations of first order and first

7

(5.27)

For solution first use the substitution dy/dx=p and then differentiate with respect to x. The result would have the general form

(5.28)

If equation 5.28 can be integrated to give an algebraic relation in x, p and c as

(5.29)

the final solution can be expressed after eliminating p between equations 5.27 and 5.29. If equation 5.28 is difficult to integrate, it is also possible to express the final solution as a parametric one by equations 5.27 and 5.29 where p is the parameter that specifies x and y.

Case III. Eqations solvable for x.

Differential equations solvable for x has the general form of

(5.30)

A more convenient version of equation 5.30 is obtained after differentiating with respect to y and substituting dx/dy=1/p.

(5.31)

After the manipulation the solution method outlined in the second case should be followed to obtain either a parametric or algebraic solution.

Q.5.5 Consider the following differential equation of first order and second degree

a) Which of the three cases are applicable for this ODE?b) Which case results into an easier solution path?

5.3.1.11. Clairaut’s equation

These ODEs have the general form of

(5.32)

Page 8: Process Analysis and Modeling - University of South …natasha.eng.usf.edu › gilbert › courses › modelandanaly… · Web viewIn differential equations of first order and first

8

Equation 5.32 resembles to Case II studied in Section 5.3.1.10. Following a similar approach let’s differentiate with respect to x and make the substitution dy/dx=p.

(5.33)

Equation 5.33 rearranged to

(5.34)

For equation 5.34 to hold either x+f’(p) or dp/dx should equal 0. The case dp/dx=0 leads to the fact p=constant. In that case the general case becomes

(5.35)

The second solution can be obtained by eliminating p from x+f’(p)=0 and equation 5.32. This solution will satisfy equation 5.32. So, it is a solution to the original ODE. However, as it does not contain any arbitrary constants, it cannot be the general solution. This type of solution is called the singular solution.

5.3.2. Second order and first degree ODEs

The general form of the this type of equations is

(5.36)

It is impossible to discuss all the possible equations that conform to equation 5.36 and suggest a solution method. However, there are several standard forms of equation 5.36 that are important in chemical engineering. These standard forms have well established solution methods. We will first consider equations with missing terms and then second order linear ODEs with constant coefficients.

Case I. Equations not containing y.

1) If dy/dx is not present, the form has to be

(5.37)

The solution can be found by integrating f(x) twice with respect to x.

2) If dy/dx is present, the form has to be

(5.38)

The substittion dy/dx=p will create a new first order ODE in p and x that can be solved by previously discussed methods. Please note that d2y/dx2=dp/dx.

Page 9: Process Analysis and Modeling - University of South …natasha.eng.usf.edu › gilbert › courses › modelandanaly… · Web viewIn differential equations of first order and first

9

Q.5.6 Consider the following ODE of second order and first degree

What is the solution for this ODE?

Case II. Equations not containing x.

These ODEs would have the following general form

(5.39)

Using the substitution p=dy/dx ODE should be first reduced to one of the first order. However, the ODE will be easier to solve if d2y/dx2 is expressed as follows

(5.40)

Q.5.6 Consider the following ODE of second order and first degree

What is the solution for this ODE?

Case III. Linear ODEs of second order and first degree with constant coefficients.

Actually, in the next section we will discuss the generalized linear ODEs. However, as ODEs of second order and first degree with constant coefficients play an important role in the chemical engineering control theory, we found it appropriae to discuss this class here in greater detail. Following the notation we used until now the ODE’s general form can be expressed as

(5.41)

However, it is a better idea to adopt time, t, as the independent variable and to follow the notation used in the control theory. The general form of the ODE is now expressed by

(5.42)

The parameters ζ and are called the damping coefficient and time constant, respectively. The function m(t) is said to be the forcing function. It is better to express the coefficients this way as they both relate to some specific physical facts in the control theory. In this section the details of solution methods are not given. The details will be pieced together when the general linear differential equations are discussed in the next section. For now let’s just concentrate on the tabulated solutions for the five critical regions of ζ around zero and unity. The full solution to the ODE in equation 5.42 requires the complementary solution first. Complementary solution is the solution for the case where the forcing function m(t) is assumed to be zero as shown below.

(5.43)

Page 10: Process Analysis and Modeling - University of South …natasha.eng.usf.edu › gilbert › courses › modelandanaly… · Web viewIn differential equations of first order and first

10

This equation, hence the complementary solution, describes the system’s response when there are no external disturbances. When the differential operator D is substituted for the derivative of y with respect to t, the characteristic equation for the ODE is obtained as

(5.44)

The roots of this characteristic equation determines what the complementary solution will be. Table Table 1 tabulates the five possible cases. For a system to be stable the damping coefficient has to be greater than zero. If it is equal to zero then the system is said to be undamped. It will sustain continuous oscillations. If the damping coefficient is less than one but greater than zero, then the system is underdamped. An underdamped system will go to its stable point through some oscillations. If the damping coefficient is greater than unity the system is called overdamped. An overdamped system will go to its stable point with no oscillations.

Table 1 Solutions for second order linear ODEs with constant coefficients

Name ζ Roots, r1 and r2 Solution, y(t)

Overdamped system ζ >1

Critically damped system

ζ =1

Underdamped system ζ <1

Undamped system ζ =0

Unstable system ζ <0

Q.5.7 Consider two identical, isothermal, constant volume CSTRs in series with a first order irreversible reaction .Develop and solve the system of simultaneous ODEs describing the system. (Hint: You can express simultaneous ODEs as a higher order ODE)

Page 11: Process Analysis and Modeling - University of South …natasha.eng.usf.edu › gilbert › courses › modelandanaly… · Web viewIn differential equations of first order and first

11

5.3.3. Linear ordinary differential equations

A general n-th order linear ODE can be written as

(5.45)

where a0, a1, … ,an are consant coefficients and h(x) is an arbitrary function of x. If D is defined as the differential operator D≡d/dx, equation 5.45 can be rewritten as follows

(5.46)

If p is a particular solution to equation 5.46 then the general solution y can be expressed as the sum of the particular solution yp and a complementary solution yc.

(5.47)

Let’s combine the equations 5.46 and 5.47.

(5.48)

Now, note that yp was a solution and therefore term 1 must equal to h(x). So, term 2 must equal 0.

(5.49)

In other words, the complementary solution of a linear ODE is the solution to the ODE where h(x) is replaced by 0, the homogeneous form of the original ODE. This solution summed with a particular solution gives the full solution to the ODE.

5.3.3.1. Determining the complementary function

Equation 5.49 is a polynomial in D with n roots r1, r2, … , rn and can be represented as follows.

(5.50)

Depending on the type of roots there are three cases:

Case I. Roots are real and distinct.

The solution is

(5.51)

Case II. Two or more roots are equal.

If there are m equal roots r, the part of the complementary solution due to these roots is

Page 12: Process Analysis and Modeling - University of South …natasha.eng.usf.edu › gilbert › courses › modelandanaly… · Web viewIn differential equations of first order and first

12

(5.52)

The other (n-m) distinct roots follow the pattern in equation 5.51.

Case III. One or more conjugate pairs of complex roots.

Let’s assume that conjugate pairs of complex roots have the following form α±βi. If there are m conjugate pairs of complex roots, the complementary solution would be.

(5.53)

Using the following trigonometric relations

(5.54)

equation 5.53 is usually written as

(5.55)

For other trigonometric relations that might be helpful in this type of ODE problems please refer to page 152 in Mickley, Sherwood & Reed, 1957.

Q.5.6 Consider the following general second order ODE with real constant coefficients.

What are the possible complementary functions?

5.3.3.2. Determining the particular solution

There are two common methods for finding the particular solution yp. The first one is “method of undetermined coefficients”. This method is easy to use, however, it requires h(x) to be of certain functional form. It also applies only to the constant coefficient linear ODEs. The second method is called “variation of parameters”. This method can be applied to cases where the coefficients are functions of x and h(x) is complex.

I. Method of undetermined coefficients.

In chemical engineering applications, the function h(x) in equation 5.45 is usually the sum of one more of five simple functional relations. These functional relations are: constant, xn, erx, cos kx, sin kx. It is possible to show mathematically that according to the functional form of h(x) one can predict the general form of the particular solution it should have. As this particular solution has to satisfy the original differential equation, one can substitute the predicted form of the particular solution into the ODE and find out what the coefficients should be.

Table 2 shows what the general form of the particular solution should be according to the above mentioned common h(x) terms.

Page 13: Process Analysis and Modeling - University of South …natasha.eng.usf.edu › gilbert › courses › modelandanaly… · Web viewIn differential equations of first order and first

13

Table 2 Form of particular solution (adapted from Mickley, Sherwood & Reed, 1957)

h(x) form of yp

constant a constant A

Page 14: Process Analysis and Modeling - University of South …natasha.eng.usf.edu › gilbert › courses › modelandanaly… · Web viewIn differential equations of first order and first

14

The following two rules apply for building the predicted form of the particular soulution.

1. When h(x) is the sum of two or more terms, the general form of the particular solution is the sum of the corresponding terms matching the individual forms from Table 2.

2. If any of the suggested terms by Table 2 is already present in the complementary solution, then the form needs to be multiplied by x to form the final form of the particular solution.

Example 1.

Let’s solve a constant coefficient linear ODE of fourth order to illustrate the method of undetermined coefficients. Consider the following ODE

(5.56)

In differential operator D, the characteristic equation is

(5.57)

After factoring the characteristic equation can written as

(5.58)

With the roots r1=r2=0, r3=1 and r4=2, the complementary solution, yc, is found as

(5.59)

As h(x) is x, from Table 2, the particular solution, yp, is predicted as

(5.60)

However, as there are already a constant term and a term with first power of x in the complementary solution, we need to multiply equation 5.60 with x2 to get final form of the general particular solution as

(5.61)

Let’s substitute equation 5.61 into equation 5.56

(5.62)

Some basic manipulation yields

(5.63)

After equating the like powers, the coefficients are found as A1 = 1/12 and A0 = -3/8 so the particular solution is

Page 15: Process Analysis and Modeling - University of South …natasha.eng.usf.edu › gilbert › courses › modelandanaly… · Web viewIn differential equations of first order and first

15

(5.64)

As the final solution is the sum of complementary and particular solutions, the results is

(5.65)

II. Variation of parameters.

The method of endetermined coefficients is applicable to linear ODEs where the coefficients are constant. This second method is more relaxed in that sense and allows one to solve higher order linear ODEs with variable coefficients. The procedure will be discussed for a general second order ODE with the following form

(5.66)

Let’s assume that the complementary solution to equation 5.66 is known and has the following form

(5.67)

Then the particular solution can be will have the following generaş form.

(5.68)

We have now one equation and three unknowns, yp, u(x) and v(x). We need two more equations. The first one results from the fact the particular solution must satisfy the original ODE.

(5.69)

The second equation is arbitrary and can be set by the modeler. However, if

(5.70)

is selected, the resulting equations will easier.

(5.71)

Combining equations 5.66 and 5.68-5.71 yields

Page 16: Process Analysis and Modeling - University of South …natasha.eng.usf.edu › gilbert › courses › modelandanaly… · Web viewIn differential equations of first order and first

16

(5.72)

The two expressions in the brackets should be zero as y1(x) and y2(x) are soultions of the homogeneous equation and part of the complementary solution.

(5.73)

When equations 5.70 and 5.73 are solved two integral expressions are obtained for u and v as

(5.74)

(5.75)

With the functional froms of u(x) and v(x), the particular solution is constructed substituting them into equation 5.68.

5.3.4. The Euler equation

The general form of the Euler equation is

(5.76)

This equation can be reduced to a linear ODE with constant coefficients using the subtitution x=ez.

5.3.5. System of linear differential equations with constant coefficients

The solution of systems of linear ODEs with constant coefficiens will be discussed using sample second order linear ODE. Consider the following system

(5.77)

(5.78)

The solution technique starts with converting the ODEs into the operational form with differential operator D.

(5.79)

Page 17: Process Analysis and Modeling - University of South …natasha.eng.usf.edu › gilbert › courses › modelandanaly… · Web viewIn differential equations of first order and first

17

(5.80)

Now manipulate the two equations to eliminate y and find an ODE in terms of z. As the operators of y are identical, we need to subtract equation 5.80 from 5.79 to do that. The result is

(5.81)

The complementary solution to equation 5.81 is

(5.82)

The form of the particular solution from Table XXX is a constant. However, there is already a constant term in the complementary solution. Therefore, we need to multiply the suggested constant term with x to obtain the general form of the particular solution as

(5.83)

Using the method of undetermined coefficients we substitute the resulting particular solution into equation 5.81. This yields a value of –4 for B. The final solution for z is now

(5.84)

Let’s follow a similar procedure to find a solution for y. To eliminate z from equations 5.79 and 5.80 mutiply them with (D+1) and (2D+1), respectively.

(5.85)

(5.86)

When the top equation is subtracted from the bottom one

(5.87)

After manipulation the equation becomes

(5.88)

The complementary solution to equation 5.88 is

(5.89)

The particular soluttion is found as described in the previous case as

(5.90)

The general solution is now

(5.91)

Page 18: Process Analysis and Modeling - University of South …natasha.eng.usf.edu › gilbert › courses › modelandanaly… · Web viewIn differential equations of first order and first

18

We are almost there. We have the equations for z and y as

(5.92)

(5.93)

Originally we had two first order ODEs but we ended up having three arbitrary constants. One of them is too many and should be stated in terms of the others. To find it let’s use one of the original ODEs, say equation 5.79, and substitute the equations for y and z into it.

(5.94)

Applying the differential operators yield

(5.95)

After some manipulation B is stated as

(5.96)

The final solution becomes

(5.97)

(5.98)

Now with two boundary conditions the remaining arbitary constants can be determined to give problem specific solution. For example, if in a specific problem at x=0 y and z values has to be 0, as well, then in the final final solution A and D would be 0 and –3, respectively.