0% found this document useful (0 votes)
35 views38 pages

Chap 1 - 2 - 3

Uploaded by

Cecilia Celine
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
35 views38 pages

Chap 1 - 2 - 3

Uploaded by

Cecilia Celine
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 38

Welcome to ME 2100

Engineering Mathematics

Ordinary Differential Equations


Pen-Ning Yu
[email protected]

1
• Modeling is a process that translate physical situation or some other
observation into a “mathematical model”
• A model containing derivatives of an unknown function is called a
differential equation 2 3
dy d2y d3y dy d y d y
• Notation: y = , y = 2 , y = 3 y = , y = 2 , y = 3
dt dt dt 𝑑𝑦 dx dx dx
• Calculus explains the meaning of , while ODEs put it into an equation
𝑑𝑡
and describe movement or motion (Mechanical Engineering).
• Ordinary differential equations (ODEs) are differential equations that
depend on a single variable. (PDEs for more variables will be covered next
semester)
• An ODE is said to be of order 𝑛 if the 𝑛th derivative of the unknown
function 𝑦 is the highest derivative of 𝑦 in the equation
• An ODE is called linear if it can be written in the form:
y(n) + pn−1(x)y(n−1) + … + p1(x)y’ + p0(x)y = r(x). 2
• Which of these differential equations are linear (in y)?
𝑑𝑦 𝑑𝑦 𝑑𝑦 𝑑𝑦
1 = 𝑦, 2 = −𝑦, 3 = 2𝑡𝑦, 4 = 𝑦2
𝑑𝑡 𝑑𝑡 𝑑𝑡 𝑑𝑡

• What are the orders of the following differential equations?

3
Modeling includes 3 steps: setting up a mathematical
model, mathematical solution and Interpretation
• An ODE, together with an initial condition, is called an initial value problem
• Example: Given an amount of a radioactive substance, say, 0.5 g (gram), find the
amount present at any later time. (textbook 1.1.5)
𝑑𝑦
1. Mathematical model: = −𝑘𝑦, 𝑦 0 = 0.5, 𝑘 = 1.5
𝑑𝑡
2. Mathematical solution: 𝑦 𝑡 = 0.5𝑒 −𝑘𝑡

3. Interpretation:

Suppose we find a sample where 60% of the radioactive


substance is gone (i.e. the carbon came from a tree).
How old is the sample?
4
Time(1000 years)
In many instances exact solutions cannot be found
and we must resort to numerical solutions
• ODE and initial condition:
𝑑𝑦
= 𝑓 𝑥, 𝑦 , 𝑦 𝑥0 = 𝑦0
𝑑𝑥
• Euler’s method is based on a Taylor series
expansion of the solution about 𝑥0 or

1 2 "
𝑦 𝑥0 + ℎ = 𝑦 𝑥0 + ℎ𝑦 𝑥0 + ℎ 𝑦 𝑥0 + ⋯ ,
2

Replace 𝑦 ′ 𝑥0 by 𝑓 𝑥0 , 𝑦0 and take the first two


terms
𝑦𝑖+1 = 𝑦𝑖 + ℎ𝑓 𝑥𝑖 , 𝑦𝑖

5

Euler method for 𝒚 = 𝒚 + 𝒙, 𝒚 𝟎 = 𝟎, for 𝒙 = 𝟎, … , 𝟏. 𝟎
with step 𝒉 = 𝟎. 𝟐 𝒏 𝒙 𝒚 𝒚(𝒙 ) Error
𝒏 𝒏 𝒏
0 0.0 0.000
1 0.2
• Exact solution: 𝑦 =𝑒𝑥 −𝑥−1 2 0.4
• Euler’s method: 𝑦𝑛+1 = 𝑦𝑛 + ℎ𝑓(𝑥𝑛 , 𝑦𝑛 ) 3 0.6 0.128 0.222 0.094
4 0.8 0.274 0.426 0.152
5 1.0 0.488 0.718 0.230

6
Separation of variables: reduce ODEs to the form g(y) y’ = f(x),
integrating on both sides, obtaining ∫g(y) y’dx = ∫f(x) dx + c
Integration table
• Examples: at the beginning of the textbook
• ODE: 𝑦 ′ = 1 + 𝑒 𝑥 න 𝑢𝑣 ′ 𝑑𝑥 = 𝑢𝑣 − න 𝑢′ 𝑣𝑑𝑥

𝑑𝑥 1 𝑥
න = arctan +𝑐
MATLAB: syms y(x); eqn = diff(y,x) == 1+exp(x); ySol(x) = dsolve(eqn) 𝑥 2 + 𝑎2 𝑎 𝑎
• ODE 𝑦 ′ = 1 + 𝑦 2 (textbook example 1.3.1)

MATLAB: syms y(x); eqn = diff(y,x) == 1+y^2; ySol(x) = dsolve(eqn)


• ODE 𝑦 ′ = 𝑥𝑒 𝑥

MATLAB: syms y(x); eqn = diff(y,x) == x*exp(x); ySol(x) = dsolve(eqn)


7
Changes of variables: a change of variable may transform a DE
into one of the known types
For equations
𝑦 ′ = 𝑓 𝑎𝑥 + 𝑏𝑦
Here, 𝑓 is any (differentiable) function, we make the substitution u =
𝑎𝑥 + 𝑏𝑦
Example: 𝑦 ′ = (𝑦 + 4𝑥)2 (textbook problem 1.3.8)

8
Changes of variables: a change of variable may transform a DE
into one of the known types
For equations
𝑦
𝑦′ =𝑓
𝑥
𝑦
Here, f is any (differentiable) function, we make the substitution 𝑢 =
𝑥
′ 2 2
Example: 2𝑥𝑦𝑦 = 𝑦 − 𝑥 (textbook example 1.3.8)

9
𝒅𝒚
The complete solution to a linear equation = 𝒂𝒚 + 𝒓(𝒕) is 𝒚 𝒕 =
𝒅𝒕
𝒚𝒉 𝒕 + 𝒚𝒑 (𝒕)
• All homogeneous/null solution 𝑦ℎ 𝑡 with no source: 𝑟 = 0
• One particular solution 𝑦𝑝 𝑡 with source 𝑟 𝑡
• The complete solution is 𝑦 𝑡 = (𝐚𝐥𝐥 𝑦ℎ 𝑡 ) + (𝐨𝐧𝐞 𝑦𝑝 (𝑡))

10
𝒅𝒚
An oscillating(sinusoid) input to = 𝒂𝒚 + 𝒓(𝒕) is commonly
𝒅𝒕
used for modeling
𝑑𝑦
• = 𝑎𝑦 + cos(𝑤𝑡), 𝑦 0 = 𝑐0
𝑑𝑡
• Look for 𝑦𝑝 𝑡 = M cos 𝑤𝑡 + 𝑁sin(𝑤𝑡)

11
𝒅𝒚
A step input to = 𝒂𝒚 + 𝒓(𝒕) is simply
𝒅𝒕
𝒅𝒚
= 𝒂𝒚 + 𝟏, 𝒚 𝟎 = 𝟎
𝒅𝒕
𝑑𝑦
• = 𝑎𝑦 + H(t)
𝑑𝑡

12
The delta function 𝜹(𝒕) is a point source completely
concentrated at 𝒕 = 𝟎, like a sudden shock

∞ ∞ ∞
‫׬‬−∞ 𝛿(𝑡) 𝑑𝑡 = 1, ‫׬‬−∞ 𝛿 𝑡 𝐹(𝑡)𝑑𝑡 = 𝐹(0) , ‫׬‬−∞ 𝛿 𝑡 − 𝑇 𝐹(𝑡)𝑑𝑡 = 𝐹(𝑇)

Impulse response of 𝑦 ′ − 𝑎𝑦 = 𝛿(𝑡) equals 𝑦 ′ − 𝑎𝑦 = 0 with 𝑦 0 = 1

13
• A second-order ODE is linear if it can be brought into the form of 𝒚" +
𝒑 𝒙 𝒚′ + 𝒒 𝒙 𝒚 = 𝒓(𝒙), and nonlinear if it cannot
• In engineering, 𝑟(𝑥) is frequently called the input, and y(𝑥) is called the
output.
• Linear ODE is homogeneous if 𝑟 𝑥 = 0 on some interval 𝑎 < 𝑥 < 𝑏, call it J
• Linear ODE is nonhomogeneous if 𝑟 𝑥 ≠ 0 on the interval J

• Examples: 𝑦 " + 𝑦 = 0, 𝑦 " + 𝑦 = 1, 𝑦 " 𝑦 − 𝑥𝑦 ′ = 0

14
Fundamental Theorem for the Homogeneous Linear ODE
For a homogeneous linear ODE y " + p x y ′ + q x y = 0, any linear combination
of two solutions on an open interval I is again a solution of the ODE on I. In
particular, for such an equation, sums and constant multiples of solutions are
again solutions. (textbook chapter 2 theorem 1)

• Proof:

15
These 𝒚𝟏 , 𝒚𝟐 are called a basis of solutions, which is a pair of
linearly independent solutions
• y” + y′ − 2𝑦 = 0
𝑦 = 𝑐1 𝑒 𝑥 + 𝑐2 𝑒 −2𝑥 is called a homogeneous solution
Observations:
basis of solutions:
𝑦1 = 𝑒 𝑥 , 𝑦2 = 𝑒 −2𝑥
𝑦1 = 𝑒 𝑥 , 𝑦2 = 2𝑒 𝑥
Linearly independent on an interval I where they are defined if
k1y1(x) + k2y2(x) = 0 everywhere on I implies k1 = 0 and k2 = 0

Superposition: we can obtain further solutions from given ones by adding


them or by multiplying them with any constants

16
Reduction of order is to find a second solution of the form
𝒚𝟐 𝒙 = 𝒖(𝒙)𝒚𝟏 𝒙 if one solution 𝒚𝟏 𝒙 is known
Find a basis of solutions of a homogeneous linear ODE
(x2 − x)y” − xy’ + y = 0. (textbook example 2.1.7)
Solution: Inspection shows that y1 = x is a solution because y’1 = 1 and y”1 = 0
To get y2 ,we substitute𝑦2 = 𝑢𝑦1 , 𝑦2′ = 𝑢′ 𝑦1 + 𝑢𝑦1′ , 𝑦2′′ = 𝑢′′ 𝑦1 + 2𝑢′𝑦1′ + 𝑢𝑦1′′

MATLAB: syms y(x); eqn = (x^2 - x)*diff(y,x,2) - x*diff(y,x) + y== 0; ySol(x) = dsolve(eqn) 17
′ ′ ′ ′′
To get y2 ,we substitute 𝑦2 = 𝑢𝑦1 , 𝑦2 = 𝑢 𝑦1 + 𝑢𝑦1 , 𝑦2 =
𝑢′′ 𝑦1 + 2𝑢′𝑦1′ + 𝑢𝑦1′′
The textbook has a general formula for the solution,
• 𝑦” + 4𝑦’ + 4𝑦 = 0, 𝑦1 = 𝑒 −2𝑥 I do not recommend memorizing the formula.
Just do the substitution

3 ′ 4
• 𝑦” − 𝑦 + 𝑦 = 0 for 𝑥 > 0, 𝑦1 = 𝑥 2
𝑥 𝑥2

18
All solutions of homogeneous linear ODEs with constant
coefficients are either exponential functions or their variants

• 𝑦" + 𝑎𝑦′ + 𝑏𝑦 = 0

Observation: The solution of the first-order linear ODE with a constant


coefficient k, y’ + ky = 0 is an exponential function 𝑦 = 𝑐𝑒 −𝑘𝑥 .
Idea: Try the function y = eλx as a solution of 𝑦" + 𝑎𝑦′ + 𝑏𝑦 = 0

19
The roots of the characteristic equation form the basis of the
general solution
• The roots of the characteristic equation are
1 1
λ1 = (−𝑎 + 𝑎2 − 4𝑏) , λ2 = (−𝑎 − 𝑎2 − 4𝑏)
2 2

(Case I) Two real roots if 𝑎2 − 4𝑏 > 0,


𝑦 = 𝑐1 𝑒 λ1 𝑥 + 𝑐2 𝑒 λ2𝑥
(Case II) A real double root if 𝑎2 − 4𝑏 = 0,
𝑦 = 𝑐1 𝑒 λ𝑥 + 𝑐2 𝑥𝑒 λ𝑥
(Case III) Complex conjugate roots if 𝑎2 − 4𝑏 < 0.
𝑦 = 𝑐1 𝑒 α𝑥 cos(β𝑥) + 𝑐2 𝑒 α𝑥 sin(β𝑥)
where λ = α + 𝑖β, 𝜆∗ = α − 𝑖β
20
Case II: A real double root has one solution 𝑦1 = 𝑒 λ𝑥 , leading to the
other solution 𝑦2 = 𝑥𝑒 λ𝑥 using the method of reduction of order
𝑎
𝑎2 − 4𝑏 = 0, we have only one solution 𝑦1 = 𝑒 λ𝑥 , where 𝜆 = −
2

Substitute 𝑦2 , 𝑦2′ and 𝑦2" into 𝑦" + 𝑎𝑦′ + 𝑏𝑦 = 0


we have 𝑢"𝑒 𝜆𝑥 + 2𝜆𝑢′𝑒 𝜆𝑥 + 𝜆2 𝑒 𝜆𝑥 + 𝑎(𝑢′𝑒 𝜆𝑥 + 𝜆𝑢𝑒 𝜆𝑥 ) + 𝑏𝑢𝑒 𝜆𝑥 = 0
rearrange 𝑢"𝑒 𝜆𝑥 + (2𝜆 + 𝑎)𝑢′𝑒 𝜆𝑥 + (𝜆2 + 𝑎𝜆 + 𝑏)𝑢𝑒 𝜆𝑥 + 𝑏𝑢𝑒 𝜆𝑥 = 0

21
∗𝒙
𝒆λ𝒙
Case III: Complex conjugate roots have a solution of 𝒚 = 𝒄𝟏 + 𝒄𝟐 𝒆 λ , which
can be converted to real functions using 𝒆𝒊θ = 𝒄𝒐𝒔θ + 𝒊 𝒔𝒊𝒏θ

22
Examples:
• 𝑦” + 36𝑦 = 0 (textbook problem 2.2.2)

• 10𝑦” − 32𝑦 ′ + 25.6𝑦 = 0 (textbook problem 2.2.6)

• 𝑦” + 8𝑦 ′ + 15𝑦 = 0 (textbook problem 2.2.12)

23
Second order differential equation is used to model free
y(t)
oscillations of a spring-mass-damper system −𝑘𝑦

• Setting up the model: (textbook example 2.4.2) 𝑚𝑦ሷ


• Spring force: 𝐹 = −𝑘𝑦. Damping force 𝐹 = −𝑐 𝑦.ሶ
−𝑐𝑦ሶ
• ODE of the spring-mass-damper system is 𝑚𝑦ሷ + 𝑐 𝑦ሶ + 𝑘𝑦 = 0
• 𝑚 = 10, 𝑘 = 90 and (I) c = 100, (II) c = 60 , (III) c = 10 kg/sec
• A step input to this system is 𝑦 0 = 0.16 and 𝑦ሶ 0 = 0
• Mathematical solution(the results on the next page)
• Interpretation:

24
Three cases of the spring mass damper system
• 10𝑦” + 100𝑦 ′ + 90𝑦 = 0, 𝑦 0 = 0.16, 𝑦′ 0 = 0
• 10𝑦” + 60𝑦 ′ + 90𝑦 = 0, 𝑦 0 = 0.16, 𝑦′ 0 = 0
• 10𝑦” + 10𝑦 ′ + 90𝑦 = 0, 𝑦 0 = 0.16, 𝑦′ 0 = 0

syms y(x); eqn = 10*diff(y,x,2) +100*diff(y,x) +90*y==0; Dy=diff(y,x);cond = [y(0)==0.16, Dy(0)==0]; ySol(x) = dsolve(eqn, cond)
25
A complete solution of a nonhomogeneous linear ODE is a
solution of the form 𝒚 𝒙 = 𝒚𝒉 𝒙 + 𝒚𝒑 𝒙
• 𝑦ℎ = 𝑐1 𝑦1 +𝑐2 𝑦2 is the homogeneous solution of 𝑦" + 𝑝 𝑥 𝑦 ′ + 𝑞 𝑥 𝑦 = 0
• 𝑦𝑝 is a particular solution of 𝑦" + 𝑝 𝑥 𝑦 ′ + 𝑞 𝑥 𝑦 = 𝑟(𝑥)
Note: Not true for
• PROOF nonhomogeneous
nonlinear ODE

• Example: 𝑦" + 9𝑦 = 27
• 𝑦ℎ = 𝑐1 cos 3𝑥 + 𝑐2 sin 3𝑥 (homogeneous/null solution)
• 𝑦𝑝 = 3 (learn this latter) (particular solution)
• 𝑦 = 𝑦ℎ + 𝑦𝑝 = 𝑐1 cos 𝑥 + 𝑐2 sin 𝑥 + 3 (complete solution)

• Initial value problem : 𝑦" + 9𝑦 = 27, 𝑦 0 = 0, 𝑦 ′ 0 = 0


• 𝑦𝑝 = 3 − 3𝑐𝑜𝑥(3𝑥)
26
Method of undetermined coefficients enable us to solve linear ODEs
with constant coefficients 𝒚" + 𝒂𝒚′ + 𝒃𝒚 = 𝒓(𝒙)

The underlying idea in this method is a conjecture, an educated guess really,


about the form of 𝑦𝑝 motivated by the kinds of functions that make up the input
function 𝑟(𝑥)
The following 3 rules based on the conjecture enable us to solve the ODEs
a) Basic Rule. If 𝑟(𝑥) is one of the functions in the first column in Table 2.1, choose 𝑦𝑝 in
the same line and determine its undetermined coefficients by substituting 𝑦𝑝 and its
derivatives into the ODE.
b) Modification Rule. If a term in your choice for 𝑦𝑝 happens to be a solution of the
homogeneous ODE, multiply this term by 𝑥 (or by 𝑥 2 if this solution corresponds to a
double root of the characteristic equation of the homogeneous ODE).
c) Sum Rule. If 𝑟(𝑥) is a sum of functions in the first column of Table 2.1, choose for 𝑦𝑝
the sum of the functions in the corresponding lines of the second column. 27
Method of undetermined coefficients chooses the assumed
particular solution 𝒚𝒑 (𝒙) based on the system input 𝒓(𝒙)
Table 2.1 Method of Undetermined Coefficients

Term in r(x) Choice for yp(x)


k xneγx (n = 0, 1,… ) (Knxn + Kn−1xn−1 + … + K1x + K0)eγx

k xn (n = 0, 1,… ) Knxn + Kn−1xn−1 + … + K1x + K0

k cos ωx

k sin ωx
}Kcos ωx + Msin ωx
k eαx cos ωx

k eαx sin ωx
}e αx(Kcos ωx + Msin ωx)

28
Application of the basic rule
• 𝑦" + 5y′ + 4y = 10𝑒 −3𝑥
• 𝑦" + y = 0.001𝑥 2 , 𝑦(0) = 0, 𝑦′(0) = 1.5 textbook example 2.7.1

Matlab: syms y(x); eqn = diff(y,x,2) + y ==0.001*x^2; Dy=diff(y,x);cond = [y(0)==0, Dy(0)==1.5]; ySol(x) = dsolve(eqn, cond)
29
Application of the modification rule (b)
• 𝑦" − 2y′ + y = 𝑒 𝑥
• 𝑦" + 3𝑦′ + 2y = −10𝑒 −2𝑥 , 𝑦(0) = 1, 𝑦′(0) = 0

30
Application of the sum rule (c)
• 𝑦" − 6y′ + 9y = 6𝑥 2 + 2 − 12𝑒 3𝑥

31
Roots of the characteristic equation determine the
stability of the system
• If (and only if) all the roots of the characteristic equation of a homogeneous
ODE are negative, or have a negative real part, then a general solution of
this ODE goes to 0 as time goes to infinity, so that the “transient solution”
𝑦 = 𝑦ℎ + 𝑦𝑝 approaches the “steady-state solution” 𝑦𝑝 . In this case the
nonhomogeneous ODE and the physical or other system modeled by the
ODE are called stable; otherwise they are called unstable.

32
Nonhomogeneous linear ODE is used to model of “Forced”
y(t)
oscillations of a spring-mass-damper system −𝑘𝑦

𝑚𝑦ሷ
• Setting up the model: (textbook section 2.8)
• Spring force: F = -ky. Damping force F = -cy’. External force 𝑟(𝑡) −𝑐𝑦ሶ

• ODE of the spring-mass-damper system is 𝑚𝑦" + 𝑐𝑦′ + 𝑘𝑦 = 𝑟(𝑡)


• Of special interest are periodic external forces, and we shall consider a
driving force of the form 𝑟(𝑡) = 𝐹0 cos 𝜔𝑡
• Then we have the nonhomogeneous ODE: 𝑚𝑦" + 𝑐𝑦′ + 𝑘𝑦 = 𝐹0 cos 𝜔𝑡
• Mathematical solution(the results from the next page)
• Interpretation:

33
System with very little damping (undamped forced oscillations) may
undergo large vibrations that can destroy the system (resonance)
• 𝑦” + 𝑘𝑦 = 𝑐𝑜𝑠 𝑤𝑡

https://www.youtube.com/watch?v=jewSVEBkI_s
34
The concepts and methods of solving linear ODEs of order n = 2
extend nicely to linear ODEs of higher order n , i.e. n = 3, 4, etc.
• 𝑥 3 𝑦 ′′′ − 3𝑥 2 𝑦" + 6𝑥𝑦′ − 6𝑦 = 0 textbook example 3.1.4
• 𝑦 ′′′ − 2𝑦" − 𝑦′ + 2𝑦 = 0 textbook example 3.2.1

35
If repeated root occurs, say, 𝝀𝟏 = 𝝀𝟐 , then 𝒚𝟏 = 𝒚𝟐 , and we take 𝒚𝟏
and 𝒙𝒚𝟏 as corresponding linearly independent solutions
• 𝑦 𝑣 − 3𝑦 𝑖𝑣 + 3𝑦 ′′′ − 𝑦" = 0 textbook example 3.2.3
• 𝑦 𝑖𝑣 + 2𝑦" + 𝑦 = 0

36
Modification rule also applies to higher order
• 𝑦 ′′′ + 3𝑦" + 3𝑦′ + 𝑦 = 30𝑒 −𝑥 textbook example 3.3.1

37
Impulse response of 𝒚“ + 𝒃𝒚′ + 𝒄𝒚 = 𝜹(𝒕) equals 𝒚” + 𝒃𝒚′ +
𝒄𝒚 = 𝟎 with 𝒚 𝟎 = 𝟎 and 𝒚′ 𝟎 = 𝟏
• For example:
• 𝑦” + 10𝑦 ′ + 9𝑦 = 0, 𝑦 0 =0 𝑦′ 0 = 1
• 𝑦” + 6𝑦 ′ + 9𝑦 = 0, 𝑦 0 = 0, 𝑦′ 0 = 1
• 𝑦” + 𝑦 ′ + 9𝑦 = 0, 𝑦 0 = 0, 𝑦′ 0 = 1

38

You might also like