Ordinary Differential Equations (4): The Laplace Transform
Chen Kai BOSS

The Laplace transform is an engineer's secret weapon: it transforms troublesome differential equations into simple algebraic equations. From circuit analysis to control systems, from signal processing to mechanical vibrations, the Laplace transform is everywhere. This chapter unveils the mysteries of this mathematical tool.

Starting with Intuition: Why Do We Need the Laplace Transform?

Pain Points of Differential Equations

Consider a simple RC circuit problem:

Ifis a step function, impulse function, or any complex waveform, direct solution is very tedious.

The magic of Laplace transform: 1. Transforms differential equations into algebraic equations 2. Transforms convolution into multiplication 3. Automatically handles initial conditions 4. Uniformly handles various input signals

Core Idea: From Time Domain to Frequency Domain

The essence of the Laplace transform is mapping a time-domain functionto a complex frequency-domain function.Extra close brace or missing open brace\mathcal{L}\{f(t)} = F(s) = \int_0^\infty f(t)e^{-st}dtwhereis a complex variable.

Intuition:is a "probe" that detects the content of various "frequency components" in.

Definition and Properties of the Laplace Transform

Formal Definition

Unilateral Laplace Transform:Extra close brace or missing open braceF(s) = \mathcal{L}\{f(t)} = \int_0^\infty f(t)e^{-st}dt

Inverse Transform:Extra close brace or missing open bracef(t) = \mathcal{L}^{-1}\{F(s)} = \frac{1}{2\pi j}\int_{c-j\infty}^{c+j\infty}F(s)e^{st}ds (In practice, inverse transforms usually use tables or partial fractions)

Existence Conditions

Sufficient conditions forExtra close brace or missing open brace\mathcal{L}\{f(t)}to exist: 1.is piecewise continuous on 2. There exist constantssuch that (exponential order)

Common Laplace Transforms

Extra close brace or missing open braceF(s) = \mathcal{L}\{f(t)} ROC
(unit step)
(impulse) All
(delayed step)

Deriving Basic Transforms

Example 1:Extra close brace or missing open brace\mathcal{L}\{1} Extra close brace or missing open brace\mathcal{L}\{1} = \int_0^\infty 1 \cdot e^{-st}dt = \left[-\frac{1}{s}e^{-st}\right]_0^\infty = 0 - \left(-\frac{1}{s}\right) = \frac{1}{s} (Converges when)

Example 2:Extra close brace or missing open brace\mathcal{L}\{e^{at}} Extra close brace or missing open brace\mathcal{L}\{e^{at}} = \int_0^\infty e^{at}e^{-st}dt = \int_0^\infty e^{-(s-a)t}dt = \frac{1}{s-a} (Converges when)

Example 3:Using Euler's formula:

Important Properties of the Laplace Transform

LinearityExtra close brace or missing open brace\mathcal{L}\{af(t) + bg(t)} = aF(s) + bG(s)

Differentiation Property (Most Important!)Extra close brace or missing open brace\mathcal{L}\{f'(t)} = sF(s) - f(0)

Extra close brace or missing open brace\mathcal{L}\{f''(t)} = s^2F(s) - sf(0) - f'(0)In general:Extra close brace or missing open brace\mathcal{L}\{f^{(n)}(t)} = s^nF(s) - s^{n-1}f(0) - s^{n-2}f'(0) - \cdots - f^{(n-1)}(0)

This is the key to solving differential equations with Laplace transforms: differentiation becomes multiplication by, and initial conditions are automatically included!

Integration PropertyMissing or unrecognized delimiter for \right\mathcal{L}\left\{\int_0^t f(\tau)d\tau\right} = \frac{F(s)}{s}

Frequency Shift Property (-domain shift)Extra close brace or missing open brace\mathcal{L}\{e^{at}f(t)} = F(s-a)

Application: If we knowExtra close brace or missing open brace\mathcal{L}\{\cos \omega t} = \frac{s}{s^2+\omega^2}, then:Extra close brace or missing open brace\mathcal{L}\{e^{at}\cos \omega t} = \frac{s-a}{(s-a)^2+\omega^2}

Time Shift Property (Delay)Extra close brace or missing open brace\mathcal{L}\{f(t-a)u(t-a)} = e^{-as}F(s) \quad (a > 0)whereis the delayed step function.

Convolution TheoremExtra close brace or missing open brace\mathcal{L}\{f * g} = F(s) \cdot G(s)where convolution is defined as:

Significance: Convolution in time domain = Multiplication in frequency domain (greatly simplifies calculations!)

Final Value Theorem

Ifexists and all poles ofare in the left half-plane (except possibly a simple pole at), then:

Initial Value Theorem

Solving Differential Equations with Laplace Transforms

Basic Steps

  1. Transform: Take Laplace transform of both sides
  2. Solve algebraically: Solve for(becomes an algebraic equation!)
  3. Inverse transform: Convertback to

Example 1: First-Order Equation

Solve, Step 1: TransformExtra close brace or missing open brace\mathcal{L}\{y'} + 2\mathcal{L}\{y} = \mathcal{L}\{e^{-t}}

Step 2: Solve for

Step 3: Inverse transformMissing or unrecognized delimiter for \righty(t) = \mathcal{L}^{-1}\left\{\frac{1}{s+1}\right} = e^{-t}

Verification:✓,

Example 2: Second-Order Equation

Solve,, Step 1: Transform

Step 2: Solve for

Step 3: Inverse transform (requires technique)

Using tables or partial fractions:

Note: This is the resonance case! The solution contains a factor of, meaning amplitude grows linearly.

Partial Fraction Expansion

Why Do We Need It?

When computing inverse Laplace transforms,is usually a complex rational function. Partial fraction expansion decomposes it into a sum of simple terms, making it easy to look up inverse transforms in tables.

Case 1: Distinct Real Poles

Residue method (cover-up method):

Example: Expand Inverse transform:

Case 2: Repeated Poles

Finding coefficients:

Example: Expand Inverse transform:

Case 3: Complex Conjugate Poles

Technique: Complete the square and use tablesInverse transform:

Transfer Functions and System Analysis

What Is a Transfer Function?

For a Linear Time-Invariant (LTI) system, the transfer function is defined as: (assuming zero initial conditions)

Example: RC CircuitTaking Laplace transform (zero initial conditions):

Poles and Zeros

  • Zeros: Values ofwhere
  • Poles: Values ofwhere Poles determine system characteristics:
  • Poles in left half-plane: Stable
  • Poles in right half-plane: Unstable
  • Poles on imaginary axis: Marginally stable (sustained oscillation)

Relationship Between Poles and Time-Domain Response

Pole Type Time-Domain Response
Negative real pole (decay)
Positive real pole (diverge)
Complex poles (damped oscillation)
Pure imaginary poles (sustained oscillation)

Frequency Response and Bode Plots

Frequency Response Function

Substitutinginto the transfer function gives the frequency response: -: Magnitude response -: Phase response

Bode Plots

Bode plots are the most common representation of frequency response in engineering: - Horizontal axis: Frequency (logarithmic scale) - Vertical axis (magnitude):(dB) - Vertical axis (phase):(degrees)

Bode Plots of Common Elements

First-order low-pass:

Corner frequency:At: - Magnitude drops by 3dB - Phase is -45°

Handling Discontinuous Inputs: Step and Impulse Functions

Unit Step Function

Extra close brace or missing open brace\mathcal{L}\{u(t)} = \frac{1}{s}

Unit Impulse Function (Dirac delta)Properties:

-when - - Extra close brace or missing open brace\mathcal{L}\{\delta(t)} = 1

Relationship Between Impulse and Step Response

Impulse response:Extra close brace or missing open braceh(t) = \mathcal{L}^{-1}\{H(s)} Step response:Extra close brace or missing open braces(t) = \mathcal{L}^{-1}\{H(s)/s}Relationship:

Control System Application: PID Controllers

Introduction to PID Controllers

The PID controller is the most commonly used controller in industry: -: Proportional gain -: Integral gain -: Derivative gain

Laplace Domain Representation

Function of Each Term

Term Function Advantage Disadvantage
P (Proportional) Proportional to error Fast response Steady-state error
I (Integral) Accumulates error Eliminates steady-state error May oscillate
D (Derivative) Predicts error trend Reduces overshoot Amplifies noise

Python Practice: Symbolic and Numerical Computation

Symbolic Computation with SymPy

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
from sympy import symbols, Function, laplace_transform, inverse_laplace_transform
from sympy import exp, sin, cos, Heaviside, DiracDelta, simplify
from sympy import apart, factor

s, t = symbols('s t')
a, b, omega = symbols('a b omega', real=True, positive=True)

# Basic transforms
print("=== Basic Laplace Transforms ===")
print(f"L{{ 1 }} = {laplace_transform(1, t, s)}")
print(f"L{{ t }} = {laplace_transform(t, t, s)}")
print(f"L{{ exp(-at) }} = {laplace_transform(exp(-a*t), t, s)}")
print(f"L{{ sin(ω t) }} = {laplace_transform(sin(omega*t), t, s)}")

# Inverse transforms
print("\n=== Inverse Laplace Transforms ===")
F1 = 1 / (s + 2)
print(f"L^(-1){{ 1/(s+2) }} = {inverse_laplace_transform(F1, s, t)}")

F2 = (s + 3) / (s**2 + 4*s + 5)
print(f"L^(-1){{ (s+3)/(s^2+4s+5) }} = {simplify(inverse_laplace_transform(F2, s, t))}")

# Partial fractions
F3 = (3*s + 5) / ((s + 1) * (s + 2))
print(f"\nPartial fraction expansion: {apart(F3, s)}")

System Analysis with SciPy

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
from scipy import signal
import numpy as np
import matplotlib.pyplot as plt

# Define transfer function: H(s) = (s+2) / (s^2 + 3s + 2)
num = [1, 2] # Numerator coefficients
den = [1, 3, 2] # Denominator coefficients

sys = signal.TransferFunction(num, den)

# Poles and zeros
poles = np.roots(den)
zeros = np.roots(num)
print(f"Poles: {poles}")
print(f"Zeros: {zeros}")

# Step response
t, y = signal.step(sys)

# Bode plot
w, mag, phase = signal.bode(sys)

fig, axes = plt.subplots(2, 2, figsize=(12, 8))

# Pole-zero map
axes[0, 0].plot(np.real(poles), np.imag(poles), 'rx', markersize=12, markeredgewidth=2, label='Poles')
axes[0, 0].plot(np.real(zeros), np.imag(zeros), 'bo', markersize=10, markerfacecolor='none', markeredgewidth=2, label='Zeros')
axes[0, 0].axhline(y=0, color='k', linewidth=0.5)
axes[0, 0].axvline(x=0, color='k', linewidth=0.5)
axes[0, 0].set_xlabel('Real', fontsize=12)
axes[0, 0].set_ylabel('Imaginary', fontsize=12)
axes[0, 0].set_title('Pole-Zero Map', fontsize=12, fontweight='bold')
axes[0, 0].legend()
axes[0, 0].grid(True, alpha=0.3)
axes[0, 0].set_aspect('equal')

# Step response
axes[0, 1].plot(t, y, 'b-', linewidth=2)
axes[0, 1].set_xlabel('Time (s)', fontsize=12)
axes[0, 1].set_ylabel('Response', fontsize=12)
axes[0, 1].set_title('Step Response', fontsize=12, fontweight='bold')
axes[0, 1].grid(True, alpha=0.3)

# Bode magnitude
axes[1, 0].semilogx(w, mag, 'b-', linewidth=2)
axes[1, 0].set_xlabel('Frequency (rad/s)', fontsize=12)
axes[1, 0].set_ylabel('Magnitude (dB)', fontsize=12)
axes[1, 0].set_title('Bode Plot: Magnitude', fontsize=12, fontweight='bold')
axes[1, 0].grid(True, alpha=0.3, which='both')

# Bode phase
axes[1, 1].semilogx(w, phase, 'r-', linewidth=2)
axes[1, 1].set_xlabel('Frequency (rad/s)', fontsize=12)
axes[1, 1].set_ylabel('Phase (degrees)', fontsize=12)
axes[1, 1].set_title('Bode Plot: Phase', fontsize=12, fontweight='bold')
axes[1, 1].grid(True, alpha=0.3, which='both')

plt.tight_layout()
plt.savefig('fig_scipy_analysis.png', dpi=150, bbox_inches='tight')
plt.close()

Summary

Core Concepts

Concept Definition Significance
Laplace Transform Time domain → Frequency domain
Inverse Transform Tables or partial fractions Frequency domain → Time domain
Transfer Function System characteristics
Poles Zeros of denominator of Determine stability
Zeros Zeros of numerator of Affect frequency response

Important Properties

Property Formula Application
Differentiation Extra close brace or missing open brace\mathcal{L}\{f'} = sF(s) - f(0) Solve ODEs
Integration Extra close brace or missing open brace\mathcal{L}\{\int f} = F(s)/s Handle integral equations
Frequency Shift Extra close brace or missing open brace\mathcal{L}\{e^{at}f} = F(s-a) Damped systems
Time Shift Extra close brace or missing open brace\mathcal{L}\{f(t-a)u(t-a)} = e^{-as}F(s) Delay systems
Convolution Extra close brace or missing open brace\mathcal{L}\{f*g} = F \cdot G System response

Problem-Solving Workflow

  1. Take Laplace transform of the equation
  2. Solve algebraic equation for
  3. Partial fraction expansion
  4. Look up inverse transforms in tables
  5. Verify answer

Exercises

Basic Problems

  1. Find the Laplace transforms of: - - -$f(t) = (t-1)u(t-1)F(s) = $ - -$F(s) = y' + 3y = e^{-2t}y(0) = 1{tf(t)} = -F'(s)$

Advanced Problems

  1. Solve using Laplace transforms:6. RC circuit, initial:
    • When, find - When, find steady-state response
  2. Prove the convolution theorem:${f*g} = F(s)G(s)H(s) = $, find:
    • Poles and zeros
    • Impulse response
    • Step response
  3. Design a PID controller for second-order systemwith closed-loop response satisfying:
    • Overshoot less than 10%
    • Zero steady-state error
  4. Use the final value theorem to find, where

Programming Problems

  1. Implement a numerical algorithm for inverse Laplace transform (Talbot method) in Python.

  2. Write a program to plot Bode diagrams for arbitrary transfer functions.

  3. Simulate a system with time delay: step response of.

  4. Implement Ziegler-Nichols method for automatic PID tuning in Python.

References

  1. Kreyszig, E. (2011). Advanced Engineering Mathematics. Wiley.
  2. Ogata, K. (2010). Modern Control Engineering. Pearson.
  3. Oppenheim, A. V., & Willsky, A. S. (1997). Signals and Systems. Prentice Hall.
  4. SciPy Documentation: scipy.signal
  5. MIT OCW 18.03 - Differential Equations

Next Chapter Preview: Differential Equation Systems and Matrix Exponentials — From single equations to coupled systems

  • Post title:Ordinary Differential Equations (4): The Laplace Transform
  • Post author:Chen Kai
  • Create time:2019-04-19 15:45:00
  • Post link:https://www.chenk.top/ode-chapter-04-constant-coefficients/
  • Copyright Notice:All articles in this blog are licensed under BY-NC-SA unless stating additionally.
 Comments