Math Review with Matlab Laplace Transform Application Solving
Math Review with Matlab: Laplace Transform Application: Solving Differential Equations S. Awad, Ph. D. M. Corless, M. S. E. E. E. C. E. Department University of Michigan-Dearborn
X(s) Laplace Transform: Solving Differential Equations Math Review with Matlab U of M-Dearborn ECE Department Solving Differential Equations with Initial Conditions § Theorem relating time domain differentiation and the Laplace Transform § Approach to solving initial value problems for linear differential equations § 2 nd Order Example § Exponential Example § Homogeneous and Unit Step Example with Complex Poles 2
X(s) Laplace Transform: Solving Differential Equations Math Review with Matlab U of M-Dearborn ECE Department Theorem § Given x(t) and it’s derivative x’(t) u x(t) is a continuous function u x’(t) is piecewise continuous on any interval 0 £ t £ A u Where there exist constants K, a, M such that: Ensures that X(s) will converge § Then LT{x(t)} exists for s > a and can be determined using the following formula ROC s > a 3
X(s) Laplace Transform: Solving Differential Equations Math Review with Matlab U of M-Dearborn ECE Department Proof § Consider the integral: § Where: § Let t 1, t 2, t 3, . . . tn be the points on the interval 0 £ t £ A where x’(t) is discontinuous such that: § Integrating each term on the right by parts yields: 4
X(s) Laplace Transform: Solving Differential Equations Math Review with Matlab U of M-Dearborn ECE Department Proof Continued § Since x(t) is continuous § As A ® ¥, e-stx(A) ® 0 whenever s > a, Hence for s > a ROC s > a 5
X(s) Laplace Transform: Solving Differential Equations Math Review with Matlab U of M-Dearborn ECE Department Corollary § Given: u Function x(t) and its derivatives such that: u Where there exist constants K, a, M such that: § Then the Laplace transform of the nth derivative of x(t) exists for s > a and is given by: 6
X(s) Laplace Transform: Solving Differential Equations Math Review with Matlab U of M-Dearborn ECE Department Approach to Solving Initial Value Problems § Given an nth order time domain differential equation of x(t) with initial conditions for x(t) and its n-1 derivatives 1. Take the Laplace Transform of the differential equation to get a function of X(s) 2. Substitute Initial Conditions 3. Write equation for desired function 4. Convert X(s) to be strictly rational and use Partial Fraction Expansion 5. Use the table method to get the Inverse Laplace Transform thus getting x(t) 7
X(s) Laplace Transform: Solving Differential Equations Math Review with Matlab nd 2 U of M-Dearborn ECE Department Order DE Example § Find the solution, y(t), for the differential equation: § Subject to the Conditions: 8
X(s) Laplace Transform: Solving Differential Equations Math Review with Matlab U of M-Dearborn ECE Department Left Side Laplace Transform § Using the following transformations: § Take the Laplace Transform of the Left Side of the original equation 9
X(s) Laplace Transform: Solving Differential Equations Math Review with Matlab U of M-Dearborn ECE Department Right Side Laplace Transform § Take the General Laplace Transform of the Right Side of the original equation § Given x(t) is the discontinuous Unit Step function § Initial Condition of x(t) is considered x(0 -) = 0 § Minus subscript indicates the value of x(t) when approaching from the left (negative time) 10
X(s) Laplace Transform: Solving Differential Equations Math Review with Matlab U of M-Dearborn ECE Department Laplace Transform with Initial Conditions § The transformed equation is then: § Substituting in the initial conditions it becomes: 11
X(s) Laplace Transform: Solving Differential Equations Math Review with Matlab U of M-Dearborn ECE Department Substitute and Simplify § x(t) was given as the unit step function u(t) whose transform is: § Simplifying terms yields: 12
X(s) Laplace Transform: Solving Differential Equations Math Review with Matlab U of M-Dearborn ECE Department Equation for Y(s) § Reorder terms to create an equation for Y(s) 13
X(s) Laplace Transform: Solving Differential Equations Math Review with Matlab U of M-Dearborn ECE Department Partial Fraction Expansion § Perform partial fraction expansion to break into terms with known Inverse Laplace Transforms 14
X(s) Laplace Transform: Solving Differential Equations Math Review with Matlab U of M-Dearborn ECE Department Inverse Laplace § y(t) is the inverse Laplace Transform of Y(s): LT-1 15
X(s) Laplace Transform: Solving Differential Equations Math Review with Matlab U of M-Dearborn ECE Department Exponential DE Example § Find the solution to the following second order differential equation with a causal exponential term: § Subject to the initial conditions: 16
X(s) Laplace Transform: Solving Differential Equations Math Review with Matlab U of M-Dearborn ECE Department Take Laplace Transform § Using the transform pairs: § Take the Laplace Transform of both sides 17
X(s) Laplace Transform: Solving Differential Equations Math Review with Matlab U of M-Dearborn ECE Department Equation for Y(s) § Replace initial conditions § Write an equation for Y(s) 18
X(s) Laplace Transform: Solving Differential Equations Math Review with Matlab U of M-Dearborn ECE Department Partial Fraction Expansion § Perform partial fraction expansion to break into terms with known Inverse Laplace Transforms 19
X(s) Laplace Transform: Solving Differential Equations Math Review with Matlab U of M-Dearborn ECE Department Inverse Laplace Transform § Take Inverse Laplace Transform to get solution for y(t) LT-1 20
X(s) Laplace Transform: Solving Differential Equations Math Review with Matlab U of M-Dearborn ECE Department Matlab Verification § Use Matlab to verify that § Is a valid solution for: » y=(1/3)*exp(-t)+2*exp(t)-(1/3)*exp(2*t); » left_side = diff(y, 2)-3*diff(y)+2*y left_side = 2*exp(-t) 21
X(s) Laplace Transform: Solving Differential Equations Math Review with Matlab U of M-Dearborn ECE Department General 2 nd Order Example § Consider a system described by the differential equation with the following initial conditions: 1. Use Matlab and the Laplace Transform method to determine x(t) when f(t) = 0 (homogenous solution) 2. Build upon the previous results to determine x(t) when f(t) = u(t) (unit step) 3. Directly use Matlab to determine x(t) when f(t) = u(t) 22
X(s) Laplace Transform: Solving Differential Equations Math Review with Matlab U of M-Dearborn ECE Department Part 1: 2 nd Order Homogeneous § Consider a system described by the linear homogeneous differential equation subject to the initial conditions: § Use the Laplace Transform method to determine x(t) § Use Matlab to help perform each step of the Partial Fraction Expansion process § There will be imaginary poles § Use Matlab to verify the Inverse Laplace Transform 23
X(s) Laplace Transform: Solving Differential Equations Math Review with Matlab U of M-Dearborn ECE Department Take Laplace Transform § Remembering the relationships: § Take the Laplace Transform of both sides 24
X(s) Laplace Transform: Solving Differential Equations Math Review with Matlab U of M-Dearborn ECE Department Equation for X(s) § Rewrite to get an equation for X(s) § Substitute in the initial conditions: 25
X(s) Laplace Transform: Solving Differential Equations Math Review with Matlab U of M-Dearborn ECE Department Partial Fraction Expansion § Use Matlab to find imaginary poles as symbolic variables » poles = roots([1 1. 4 1]) poles = -0. 7000 + 0. 7141 i -0. 7000 - 0. 7141 i » p 1=poly 2 sym(poles(1), 's'); » pretty(p 1) 1/2 -7/10 + 1/10 i 51 » p 2=poly 2 sym(poles(2), 's'); » pretty(p 2) 1/2 -7/10 - 1/10 i 51 26
X(s) Laplace Transform: Solving Differential Equations Math Review with Matlab U of M-Dearborn ECE Department Relationship of Complex Conjugate Poles § Poles are complex conjugates § Partial fraction expansion will result in coefficients also being complex conjugates where: 27
X(s) Laplace Transform: Solving Differential Equations Math Review with Matlab U of M-Dearborn ECE Department Calculate Coefficients » » c 1= (2*s-0. 2)/(s-p 2); c 1= subs(c 1, 's', p 1); c 1= expand(c 1); pretty(c 1) 1/2 8/51 i 51 + 1 » c 2= conj(c 1); » c 2= expand(c 2); » pretty(c 2) 1/2 - 8/51 i 51 + 1 28
X(s) Laplace Transform: Solving Differential Equations Math Review with Matlab U of M-Dearborn ECE Department Inverse Laplace Transform § A solution in terms of complex variables can be found directly by taking the Inverse Laplace Transform 29
X(s) Laplace Transform: Solving Differential Equations Math Review with Matlab U of M-Dearborn ECE Department Write as a Real Function § Use trigonometric identities to simplify the answer into a purely real function 30
X(s) Laplace Transform: Solving Differential Equations Math Review with Matlab U of M-Dearborn ECE Department Matlab Verification § Use Matlab to verify the entire Inverse Laplace process » syms x s t » X=(2*s-0. 2)/(s^2+1. 4*s+1); » x=ilaplace(X); pretty(x) 16 1/2 - -- exp(- 7/10 t) 51 sin(1/10 51 t) 51 1/2 + 2 exp(- 7/10 t) cos(1/10 51 t) 31
X(s) Laplace Transform: Solving Differential Equations Math Review with Matlab U of M-Dearborn ECE Department Part 2: 2 nd Order Unit Step § Repeat the example for f(t) = unit step § Use results of Part 1 to help determine x(t) § Take the Laplace Transform of both sides 32
X(s) Laplace Transform: Solving Differential Equations Math Review with Matlab U of M-Dearborn ECE Department Solve for X(s)? § Substitute initial conditions § Write as an equation for X(s) 33
X(s) Laplace Transform: Solving Differential Equations Math Review with Matlab U of M-Dearborn ECE Department X(s) Solution § Solution can be broken into two parts Homogeneous solution, f(t)=0, solved in Part 1 New part to solve for 34
X(s) Laplace Transform: Solving Differential Equations Math Review with Matlab U of M-Dearborn ECE Department Homogeneous Solution § Call homogeneous solution X 1(t) § From previous work in Part 1: 35
X(s) Laplace Transform: Solving Differential Equations Math Review with Matlab U of M-Dearborn ECE Department Inverse Laplace of X 2(s) § Use Matlab to determine Inverse Laplace of X 2(s) » syms s » X 2=1/(s*(s^2+1. 4*s+1)); » x 2=ilaplace(X 2) x 2 = 1 -exp(-7/10*t)*cos(1/10*51^(1/2)*t-7/51* exp(-7/10*t)*51^(1/2)*sin(1/10*51^(1/2)*t) 36
X(s) Laplace Transform: Solving Differential Equations Math Review with Matlab U of M-Dearborn ECE Department Unit Step Solution § Combine previous results 37
X(s) Laplace Transform: Solving Differential Equations Math Review with Matlab U of M-Dearborn ECE Department Part 3: Direct Solution § x(t) for f(t)=u(t) can also be solved directly in Matlab to yield the same results » » » x syms s X=(2*s-0. 2+1/s)/(s^2+1. 4*s+1); x=ilaplace(X) = 1+exp(-7/10*t)*cos(1/10*51^(1/2)*t) -23/51*exp(-7/10*t)*51^(1/2)*sin(1/10*51^(1/2)*t) 38
X(s) Laplace Transform: Solving Differential Equations Math Review with Matlab U of M-Dearborn ECE Department Summary § Laplace Transform is a useful technique for solving linear constant coefficient differential equations with known initial conditions § Laplace Transform converts time-domain differentiation to multiplication by s terms in the s-domain § Equations with real poles can be solved efficiently by hand or using Matlab to verify portions § Matlab is useful for solving complex pole problems, but the solution may not be intuitively interpreted 39
- Slides: 39