Presentation is loading. Please wait.

Presentation is loading. Please wait.

Math Review with Matlab: Application: Solving Differential Equations

Similar presentations


Presentation on theme: "Math Review with Matlab: Application: Solving Differential Equations"— Presentation transcript:

1 Math Review with Matlab: Application: Solving Differential Equations
4/16/2017 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

2 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 2nd Order Example Exponential Example Homogeneous and Unit Step Example with Complex Poles

3 Theorem ROC s > a Given x(t) and it’s derivative x’(t)
x(t) is a continuous function x’(t) is piecewise continuous on any interval 0 £ t £ A 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

4 Proof Consider the integral: Where:
Let t1, t2, t3, ... 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:

5 Proof Continued ROC s > a Since x(t) is continuous
As A ® ¥, e-stx(A) ® 0 whenever s > a, Hence for s > a ROC s > a

6 Corollary Given: Function x(t) and its derivatives such that:
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:

7 Approach to Solving Initial Value Problems
Given an nth order time domain differential equation of x(t) with initial 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)

8 2nd Order DE Example Find the solution, y(t), for the differential equation: Subject to the Conditions:

9 Left Side Laplace Transform
Using the following transformations: Take the Laplace Transform of the Left Side of the original equation

10 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)

11 Laplace Transform with Initial Conditions
The transformed equation is then: Substituting in the initial conditions it becomes:

12 Substitute and Simplify
x(t) was given as the unit step function u(t) whose transform is: Simplifying terms yields:

13 Equation for Y(s) Reorder terms to create an equation for Y(s)

14 Partial Fraction Expansion
Perform partial fraction expansion to break into terms with known Inverse Laplace Transforms

15 Inverse Laplace y(t) is the inverse Laplace Transform of Y(s): LT-1

16 Exponential DE Example
Find the solution to the following second order differential equation with a causal exponential term: Subject to the initial conditions:

17 Take Laplace Transform
Using the transform pairs: Take the Laplace Transform of both sides

18 Equation for Y(s) Replace initial conditions
Write an equation for Y(s)

19 Partial Fraction Expansion
Perform partial fraction expansion to break into terms with known Inverse Laplace Transforms

20 Inverse Laplace Transform
Take Inverse Laplace Transform to get solution for y(t) LT-1

21 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)

22 General 2nd 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)

23 Part 1: 2nd 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

24 Take Laplace Transform
Remembering the relationships: Take the Laplace Transform of both sides

25 Equation for X(s) Rewrite to get an equation for X(s)
Substitute in the initial conditions:

26 Partial Fraction Expansion
Use Matlab to find imaginary poles as symbolic variables » poles = roots([ ]) poles = i i » p1=poly2sym(poles(1),'s'); » pretty(p1) 1/2 -7/10 + 1/10 i 51 » p2=poly2sym(poles(2),'s'); » pretty(p2) -7/10 - 1/10 i 51

27 Relationship of Complex Conjugate Poles
Poles are complex conjugates Partial fraction expansion will result in coefficients also being complex conjugates where:

28 Calculate Coefficients
» c1= (2*s-0.2)/(s-p2); » c1= subs(c1,'s',p1); » c1= expand(c1); » pretty(c1) 1/2 8/51 i » c2= conj(c1); » c2= expand(c2); » pretty(c2) 1/2 - 8/51 i

29 Inverse Laplace Transform
A solution in terms of complex variables can be found directly by taking the Inverse Laplace Transform

30 Write as a Real Function
Use trigonometric identities to simplify the answer into a purely real function

31 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) / /2 - -- exp(- 7/10 t) sin(1/ t) 51 1/2 + 2 exp(- 7/10 t) cos(1/ t)

32 Part 2: 2nd 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

33 Solve for X(s)? Substitute initial conditions
Write as an equation for X(s)

34 Homogeneous solution, f(t)=0,solved in Part 1
X(s) Solution Solution can be broken into two parts Homogeneous solution, f(t)=0,solved in Part 1 New part to solve for

35 Homogeneous Solution Call homogeneous solution X1(t)
From previous work in Part 1:

36 Inverse Laplace of X2(s)
Use Matlab to determine Inverse Laplace of X2(s) » syms s » X2=1/(s*(s^2+1.4*s+1)); » x2=ilaplace(X2) x2 = 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)

37 Unit Step Solution Combine previous results

38 Part 3: Direct Solution x(t) for f(t)=u(t) can also be solved directly in Matlab to yield the same results » syms s » X=(2*s-0.2+1/s)/(s^2+1.4*s+1); » x=ilaplace(X) 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)

39 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


Download ppt "Math Review with Matlab: Application: Solving Differential Equations"

Similar presentations


Ads by Google