Chap 1 - 2 - 3
Chap 1 - 2 - 3
Engineering Mathematics
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
𝑑𝑡 𝑑𝑡 𝑑𝑡 𝑑𝑡
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:
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)
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) , −∞ 𝛿 𝑡 − 𝑇 𝐹(𝑡)𝑑𝑡 = 𝐹(𝑇)
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
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
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
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
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)
23
Second order differential equation is used to model free
y(t)
oscillations of a spring-mass-damper system −𝑘𝑦
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)
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 𝑟(𝑡) −𝑐𝑦ሶ
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