Upload
olivia-russell
View
220
Download
3
Embed Size (px)
Citation preview
9. Differential equations 1
Agenda for differential equations
1. Complex numbers2. Differential calculus3. Integral calculus4. Modeling5. Element equations6. System equations7. Differential equations8. Solving differential equations
9. Differential equations 2
1. Complex numbers
DefinitionArithmeticIn-phase and quadrature
1. Complex numbers
9. Differential equations 3
DefinitionA complex number, z, consists of the sum
of a real and imaginary number.The symbols i and j have the value of the
square root of -1Example
imaginary axis
real axis
b
a
a+bi
r
a = 3b = 4z = a + biz = 3 + 4i
1. Complex numbers
9. Differential equations 4
Arithmetic (1 of 2)
Addition: (a+bj) + (c+dj) = (a+c)+(b+d)j Subtraction: (a+bj) - (c+dj) = (a-c)+(b-d)j Multiplication: (a+bj)(c+dj) = (ac-bd)+(cb+da)jConjugate: conj(a+bj) = a-bjAbsolute: abs(a+bj) = sqrt(a2+b2)Argument: arg(a+bj) = atan2(b,a)Division: (a+bj)/(c+dj) = (a+bj) conj(c+dj)/
[abs(c+dj)]2
a+bj = r x ej
where r = abs(a+bj ) and = arg(a+bj )
1. Complex numbers
9. Differential equations 5
Arithmetic (2 of 2)
1. Complex numbers
Complex arithmetic using ExcelComplex arithmetic using Excel
Complex numbers c1 c2 resultsadd ImSum 1+2i 3+4i 4+6isubtract ImSub 1+2i 3+4i -2-2imultiply ImProduct 1+2i 3+4i -5+10idivision ImDiv 1+2i 3+4i 0.44+8E-002iconjugate ImConjugate1+2i 1-2iabsolute ImAbs 1+2i 2.24argument ImArgument 1+2i 1.11 63.4
9. Differential equations 6
In-phase and quadrature (I&Q)In-phase = component of signal that is in-phase with referenceQuadrature = component of signal that is 90 degrees out of
phase with reference
1. Complex numbers
9. Differential equations 7
2. Differential calculus
Derivative of a functionElementary derivative operationsExamplesCritical pointsPartial differentiation
2. Differential calculus
9. Differential equations 8
Derivative of a function
f(x)
0x x
Lim f (x)
2. Differential calculus
9. Differential equations 9
Elementary derivative operations
D k = 0D xn = nxn-1
D ln x = 1/xD eax = a eax
2. Differential calculus
9. Differential equations 10
Examples (1 of 2)
D k f(x) = k D f(x)D (f(x) g(x)) = D f(x) D g(x)D (f(x) g(x)) = f(x) D g(x) + g(x) D f(x)D (f(x)/g(x)) = [g(x) D f(x) - f(x) D g(x)]/g(x)2
D [f(x)]n = n[f(x)]n-1 D f(x) D f (g(x)) = Dg (f(g)) Dx g(x)
2. Differential calculus
9. Differential equations 11
Examples (2 of 2)
D sin x = cos xD cos x = -sinxD tan x = sec2xD arcsin x = 1/sqrt(1 - x2)D arctan x = 1/(1 + x2)
2. Differential calculus
9. Differential equations 12
Critical points
local minimum
inflectionpoint
localmaximum
globalminimum singular
point
f ‘ (x) = 0 at critical pointf “ (x) < 0 at maximum pointf “ (x) > 0 at minimum pointf “ (x) = 0 at inflection point
x
f (x)
2. Differential calculus
9. Differential equations 13
Partial differentiationA partial derivative is a derivative that is
taken with respect to only one variablez = 4x3 - 5y2 + 2xy + y -12z/ x = 12x2 + 2y Partial derivatives are important in finite
element computations
2. Differential calculus
9. Differential equations 14
3. Integral calculusIntegrationElementary integration operationsExamplesIntegration by partsInitial valuesDefinite integral
3. Integral calculus
9. Differential equations 15
Integration
Integration is the inverse operation of differentiation
f ‘ (x) dx = f (x) + C
3. Integral calculus
9. Differential equations 16
Elementary integration operations
k dx = k x + C
xm dx = xm+1/(m+1) + C
e kx dx = ekx/k + C
3. Integral calculus
9. Differential equations 17
Examples
sin x dx = -cos x +C
1/x dx = | ln x | + C
ln x dx = x ln x - x + C
dx/(k2 + x2) = I/k arctan(x/k) + C
3. Integral calculus
9. Differential equations 18
Integration by parts (1 of 3)
Integration by parts is an integration technique that is used when the function can be partitioned into two parts with favorable properties
f(x) dg(x) = f(x)g(x) - g(x) df(x) +C
3. Integral calculus
9. Differential equations 19
Integration by parts (2 of 3)
x2 ex dx = x2 ex - ex (2x) dx + C
f(x)
x2
2x
df(x)
dg(x)
ex dx
ex
g(x)
3. Integral calculus
9. Differential equations 20
Integration by parts (3 of 3)
ex (2x) dx = 2x ex - ex (2) dx + C
f(x)
2x
2
df(x)
dg(x)
ex dx
ex
g(x)
= 2x ex - 2 ex
x2 ex dx = x2 ex - 2x ex + 2 ex + C
3. Integral calculus
9. Differential equations 21
Initial values
The constant of integration C can be found only if the value of the function is known at a point
If there are multiple integrations involved, then multiple initial values are needed
Example, if f(x) = 4 when x = 1 then
(3x2 - 2x)dx = x3- x2 + C
13 - 12 + C = 4
C = 4
3. Integral calculus
9. Differential equations 22
Definite integrals
A definite integral is restricted to the region bounded by lower and upper limits
x1
x2
f ‘(x) dx = f(x2 ) - f(x1)
1
2
2x dx = x2(2) - x2(1) = 22 - 12 = 3
3. Integral calculus
9. Differential equations 23
4. Modeling
Approaches to finding a modelLinear systemsNonlinear systemsGuidelines for equations
4. Modeling
9. Differential equations 24
Approaches to finding a model
1. Lumped parameters• Break system into smaller elements• For each element, use the physical laws
that govern the element to write equations
• Build a model of the system from these lumped parameters
2. System identification• Stimulate the system and observe its
response• Works only with existing systems
4. Modeling
9. Differential equations 25
Linear systems (1 of 3)
A system is linear if and only if it obeys the principle of superposition
• H(x1 + x2) = H(x1) + H(x2), where H is the system response
4. Modeling
9. Differential equations 26
Linear systems (2 of 3)
H
x
system response
x2
x1
y = H(x1 + x2)
4. Modeling
9. Differential equations 27
Linear systems (3 of 3)
x2x1 x1 +x2
y1
y2
y1 +y2 slope K
4. Modeling
9. Differential equations 28
Nonlinear systems (1 of 3)
Occasionally, application of physical laws to a system result in nonlinear equations.
The nonlinearity may be overcome by finding a limited region of operation where linear operation takes place
4. Modeling
9. Differential equations 29
Nonlinear systems (2 of 3)
x2x1 x1 +x2
y1
y2
(y1 +y2) slope K
c
4. Modeling
9. Differential equations 30
Nonlinear systems (3 of 3)
x2x1 x1 +x2
y1
y2(y1 +y2)
c
4. Modeling
9. Differential equations 31
Guidelines for equations (1 of 4)
1. Understand the system -- sketch or describe in qualitative terms
2. Identify inputs and outputs, including disturbances
3. Express system in terms of elements that can be expressed mathematically
4. Develop equations for each element
4. Modeling
9. Differential equations 32
Guidelines for equations (2 of 4)
5. Determine unknown parameter values by analysis or experiment
6. Adjust the model until it produces behavior like the actual system
7. Simplify the system if nonlinearities are involved
4. Modeling
9. Differential equations 33
Guidelines for equations (3 of 4)Ideally, the relationship should be linearA lumped-parameter model has time as its
only independent variable. This fact allows ordinary differential equations to be used. If there are more independent variables, partial differential equations would need to be used, and they are more difficult
Use idealized equivalent of the system; e.g.• Mass concentrated at a point rather than
distributed• Inductors have no resistance or
capacitance4. Modeling
9. Differential equations 34
Guidelines for equations (4 of 4)
The number of variables and the number of equations needs to be the same.
Units need to be consistentNeed to validate the model with
prototypes or data from similar systemsIn practice, systems are not truly linear.
Variations in the plant or transducers can make design much harder
4. Modeling
9. Differential equations 35
5. Element equations
Proportional (P) relationshipIntegral (I) relationshipDerivative (D) relationshipPIDElectrical componentsRectilinear mechanical componentsRotational mechanical componentsFluid componentThermal components
5. Element equations
9. Differential equations 36
Proportional (P) relationship
v(t)
i(t) i(t)
a bR
i(t) = current (A) = through variablev(t) = voltage (V) = across variableR = resistance ()
i(t) = 1/R v(t)
through variable = constant * across variable
5. Element equations
9. Differential equations 37
Integral (I) relationship
v(t)
i(t) i(t)
a bL
i(t) = current (A) = through variablev(t) = voltage (V) = across variableL = inductance (H)
i(t) = 1/L v(t) dt
through variable = constant * ( across variable) dt
5. Element equations
9. Differential equations 38
Derivative (D) relationship
v(t)
i(t) i(t)
a bC
i(t) = current (A) = through variablev(t) = voltage (V) = across variableC = capacitance (F)
i(t) = C d/dt v(t)
through variable = constant * d/dt( across variable)
5. Element equations
9. Differential equations 39
PID
Proportional (P) -- through variable is proportional to across variable
Integral (I) -- through variable is proportional to integral of across variable
Derivative (D) -- through variable is proportional to derivative of across variable
5. Element equations
9. Differential equations 40
Electrical components
P -- Resistor
I -- Inductor
D -- Capacitor
•Across variable: potential difference v (V)•Through variable: current I (A)
R()
L(H)
C(F)
5. Element equations
9. Differential equations 41
Rectilinear mechanical components
P -- Linear damper
I -- Linear spring
D -- Mass
•Across variable: linear velocity v(m/s)•Through variable: force f(N)
B(N/ms-1)
K(N/m)
M(kg)
5. Element equations
9. Differential equations 42
Rotational mechanical components
P -- Angular damper
I -- Angular spring
D -- Inertia
•Across variable: angular velocity (rad/s)•Through variable: torque T(Nm)
B(Nm/rads-1)
K(Nm/rad)
J(Nm/rads-2)
5. Element equations
9. Differential equations 43
Fluid components
P -- fluid resistance
D -- fluid capacity
•Across variable: pressure head h(m)•Through variable: volume flow rate q(m 3s-1)
1/R(m2/s)
A(m2)
5. Element equations
9. Differential equations 44
Thermal components
P -- thermal resistance
D -- thermal capacity
•Across variable: temperature difference (K)•Through variable: heat flow rate q(W)
1/R(W/K)
C(J/K)
5. Element equations
9. Differential equations 45
6. System equations
Example -- suspension
6. System equations
9. Differential equations 46
Example -- suspension
body mass
wheel
spring, k shock absorber, b
body displacement
x(t)
m d2x/dt2 = -b dx/dt - k x
6. System equations
9. Differential equations 47
7. Differential equations (de)
Definition of deOrder of a deLinear deLinear de with constant coefficientsNonlinear deHomogeneous deNonhomongeneous deAuxiliary equation
7. Differential equations
9. Differential equations 48
Definition of de
A differential equation is a mathematical expression combining a function (e.g., y=f(x)) and one or more of its derivatives
Examples• dy/dx - 5 y = 0• d2y/dx2 - 3 dy/dx + 2y = 0• d2y/dx2 - (x2+5) [dy/dx]2 + y = sin 2x
7. Differential equations
9. Differential equations 49
Order of a de
The order of a differential equation is the order of the highest derivative in the equation
Examples• dy/dx - 5 y = 0 -- 1st• d2y/dx2 - 3 dy/dx + 2y = 0 -- 2nd• d2y/dx2 - (x2+5) [dy/dx]2 + y = sin 2x -- 2nd
7. Differential equations
9. Differential equations 50
Linear de
A linear differential equation is an equation consisting of a sum of terms each made of a multiplier and either the function or its derivatives
Examples• dy/dx - 5 y = 0 -- linear• d2y/dx2 - 3 dy/dx + 2y = 0 -- linear• d2y/dx2 - (x2+5) [dy/dx]2 + y = sin 2x -- nonlinear
7. Differential equations
9. Differential equations 51
Linear de with constant coefficients
If the multipliers are constant, then the differential equation is said to have constant coefficients
Examples• dy/dx - 5 y = 0 -- constant coefficients• dy/dx - 5 xy = 0 -- non- constant
7. Differential equations
9. Differential equations 52
Nonlinear de
If the function or one of its derivatives is raised to a power or embedded in another function, the differential equation is nonlinear
Example• d2y/dx2 - (x2+5) [dy/dx]2 + y = sin 2x --
nonlinear
7. Differential equations
9. Differential equations 53
Homogeneous de
A homogeneous differential equation is one in which each term contains either the function or its derivatives. In other words, the sum of the derivative terms is zero
Examples• dy/dx - 5 y = 0 -- homogeneous• d2y/dx2 - 3 dy/dx + 2y = 0 --
homogeneous
7. Differential equations
9. Differential equations 54
Nonhomogeneous de
A nonhomogeneous differential equation is a sum of derivative terms that doesn’t equal zero
Example• d2y/dx2 - (x2+5) [dy/dx]2 + y = sin 2x --
non-homogeneous
7. Differential equations
9. Differential equations 55
Auxiliary equation
The auxiliary equation is the polynomial formed by replacing all derivatives in a linear, constant coefficient, homogeneous differential equation with variables raised to the the power of the respective derivatives
Example• d2y/dx2 - 3 dy/dx + 2y = 0 has an auxiliary
equation of s2 - 3s + 2 = 0
7. Differential equations
9. Differential equations 56
8. Solving differential equations
IntroductionExamplesAlternate expression
8. Solving differential equations
9. Differential equations 57
Introduction
There are a large number of types of differential equations
Many types have closed form solutions; others do not
A type of differential equations of importance to engineering is the linear, non-homogeneous differential equation with constant coefficients
8. Solving differential equations
9. Differential equations 58
Example 1
de: Dy - 2y = 0auxiliary equation: S - 2 = 0root: +2solution: y = C e+2x
if y(0) = 10, then C = 10
8. Solving differential equations
9. Differential equations 59
Example 2
de: D2y + 3 Dy + 2y = 0auxiliary equation: S2 + 3S + 2 = 0roots: -1, -2solution: y = C1 e-2x + C2 e-x
if y(0) = 0, Dy(0) = -1, then C1 =1 and C2 = -1
8. Solving differential equations
9. Differential equations 60
Example 3
de: D2y + y = 0auxiliary equation: S2 + 1 = 0roots: +i, -isolution: y = C1 cos x + C2 sin x
8. Solving differential equations
9. Differential equations 61
Example 4
de: D2y +2Dy + 2y = 0auxiliary equation: s2 + 2s + 2 = 0roots: -1 + i, -1 - isolution: y = C1 e-x cos x + C2 e-x sin x
8. Solving differential equations
9. Differential equations 62
Example 5
de: D2y +2Dy + y = 0auxiliary equation: S2 + 2S +1 = 0roots: -1 , -1solution: y = (C1 + C2 x ) e-x
8. Solving differential equations
9. Differential equations 63
Example 6
de: D5y = 0auxiliary equation: S5 = 0roots: 0, 0, 0, 0, 0solution: y = C1 + C2 x + C3x2 + C4 x3 + C5x4
8. Solving differential equations
9. Differential equations 64
Example 7
de: D4y + 4 D3y +8 D2y + 8 Dy +4 y = 0auxiliary equation: s4 + 4 s3 +8 s2 + 8 s +4
= (s2 + 2s + 2)( s2 + 2s + 2) = 0roots: -1 + i, -1 - i, -1 + i, -1 - isolution: y = (C1 + C2 x) e-x cos x + (C3 + C4
x) e-x sin x
8. Solving differential equations
9. Differential equations 65
Example 8 (1 of 2)
de: D2y + Dy - 2y = 2x -40 cos 2xhomogeneous auxiliary equation: s2 + s - 2 = 0homogeneous roots: 1, -2homogeneous solution: yc = C1 e+x + C2 e-2x
particular roots: 0, 0, +2i, -2iparticular solution: yp = A + Bx + C cos 2x + E
sin 2xtotal solution: y = yc + yp
8. Solving differential equations
9. Differential equations 66
Example 8 (2 of 2)
-2 yp = -2A -2Bx -2C cos 2x -2E sin 2x
D yp = B + 2Ecos2x - 2C sin 2x
D2 yp =-4C cos 2x -4E sin 2x
constant terms : -2A + B =0X terms: -2B = 2cos x terms: -2C + 2E -4C = -40sin x terms: -2E -2C -4E = 0constants: A = -0.5. B = -1, C = 6, E = -2
8. Solving differential equations
9. Differential equations 67
Example 9 (1 of 2)
de: D2y + y = sin xhomogeneous auxiliary equation: s2 + 1 = 0homogeneous roots: +i, -ihomogeneous solution: yc = C1 cos x + C2 sin x
particular roots: +i, -iparticular solution: yp = Ax cos x + Bx sin x
total solution: y = yc + yp
8. Solving differential equations
9. Differential equations 68
Example 9 (2 of 2)
yp = Ax cos x + Bx sin x
D yp = A cos x - Ax sin x + B sin x +Bx cos x
D2 yp = -2A sin x - Ax cos x + 2B cos x - Bx sin x
cos x terms: 2B = 0sin x terms: -2A = 1constants: A = -0.5, B = 0
8. Solving differential equations
9. Differential equations 69
Example 10 (1 of 1)
de: D3y - Dy = 4 e-x + 3 e2x homogeneous auxiliary equation: s3 - s = 0homogeneous roots: 0, +1, -1homogeneous solution: yc = C1 + C2 e+x + C3 e-x
particular roots: -1, 2particular solution: yp = Ax e-x + B e2x
total solution: y = yc + yp
8. Solving differential equations
9. Differential equations 70
Example 10 (2 of 2)
yp = Ax e-x + B e2x
D yp = A e-x - Ax e-x + 2 B e2x
D2 yp =-2A e-x + Ax e-x + 4 B e2x
D3 yp =3A e-x - Ax e-x + 8 B e2x
e-x terms: -A + 3A = 4e2x terms: -2B + 8B = 3constants: A = 2. B = 0.5
8. Solving differential equations
9. Differential equations 71
Example 11
In the previous problem, y(0) = 0, Dy(0) = -1, D2 y(0) = 2
Determine C1, C2, C3
Use the general solution: y = C1 + C2 e+x + C3 e-x + 2x e-x + 0.5 e2x
Dy = C2 e+x - C3 e-x - 2x e-x + 2e-x + e2x
D2 y = C2 e+x + C3 e-x + 2x e-x - 4e-x + 2e2x
y(0) = 0 = C1 + C2 + C3 + 0.5
Dy(0) = -1 = C2 - C3 + 3
D2 y(0) = 2 = C2 + C3 -2
C1 = -4.5, C2 = 0, C3 = 48. Solving differential equations
9. Differential equations 72
Example 12 (1 of 3)
de: D2 y + 2D y + 2y = cos xhomogeneous auxiliary equation: s2 + 2s +
2 = 0homogeneous roots: -1+i, -1-ihomogeneous solution: yc = C1 e-x cos x +
C2 e-x sin x
particular roots: +i, -iparticular solution: yp = A cos x + B sin x
total solution: y = yc + yp
8. Solving differential equations
9. Differential equations 73
Example 12 (2 of 3)
yp = A cos x + B sin x
D yp = - A sin x + B cos x
D2 yp = - A cos x - B sin x
cos x terms: -A +2B +2A = 1sin x terms: -B -2A + 2B = 0constants: A = 0.2, B = 0.4
8. Solving differential equations
9. Differential equations 74
Example 12 (3 of 3)Use the general solution: y = C1 e-x cos x + C2 e-x
sin x + 0.2 cos x + 0.4 sin xinitial conditions: y(0) = 1, D y(0) = 0Dy = - C1 e-x cos x - C2 e-x sin x - C1 e-x sin x + C2
e-x cos x - 0.2 sin x + 0.4 cos xy(0) = 1 = C1 + 0.2
Dy(0) = 0 = - C1 + C2 + 0.4
C1 = 0.8, C2 = 0.4
y(x) = 0.8 e-x cos x + 0.4 e-x sin x + 0.2 cos x + 0.4 sin x
8. Solving differential equations
9. Differential equations 75
Alternate expression (1 of 3) It is sometimes desirable to express a
higher-order differential equation as a set of first-order equations• Matrix representation• Computer solutions
8. Solving differential equations
9. Differential equations 76
Alternate expression (2 of 3)
Example• D3y + 2 D2Y + 5Dy + 10y = r• Choose
• y1 = y
• y2 = Dy = Dy1
• y3 = D2y = Dy2
• Single equation replaced by three equations• Dy1 = y2
• Dy2 = y3
• Dy3 = r - 10 y1 - 5y2 - 2y3
8. Solving differential equations
9. Differential equations 77
Alternate expression (3 of 3)
• Matrix format
Dy1
Dy2
Dy3
0 1 0 0 0 1-10 -5 -2
y1
y2
y3
00r
= +
8. Solving differential equations