The Laplace Transform is a fundamental mathematical tool for analyzing dynamic systems in control engineering, electrical circuits, and mechanical vibrations. It converts time-domain differential equations into algebraic equations in the complex frequency domain ((s)-domain), making complex system responses significantly easier to solve.
In MATLAB, the Symbolic Math Toolbox allows you to perform Laplace transforms, solve for the (s)-domain transfer function, and apply the inverse Laplace transform to obtain exact time-domain analytical solutions using laplace(), ilaplace(), and solve().
The Laplace transform converts a time-domain function (f(t)) into its (s)-domain equivalent (F(s)):
[F(s) = mathcal{L}{f(t)} = int_{0}^{infty} e^{-st} f(t) , dt]Using this transformation, time derivatives convert into algebraic terms involving initial conditions:
[mathcal{L}{f'(t)} = s F(s) - f(0)] [mathcal{L}{f''(t)} = s^2 F(s) - s f(0) - f'(0)]Consider the first-order differential equation:
[frac{dy(t)}{dt} + 3y(t) = 6 quad text{with initial condition } y(0) = 2]syms y(t) s % Define equation and symbolic Laplace representation Dy = diff(y, t);
eqn = Dy + 3*y == 6;
% Take Laplace transform of the equation Y = laplace(y, t, s);
eqnLaplace = laplace(eqn, t, s);
% Substitute symbolic Laplace term and initial condition y(0) = 2 eqnLaplace = subs(eqnLaplace, laplace(y, t, s), Y);
eqnLaplace = subs(eqnLaplace, y(0), 2);
% Solve for Y(s) in Laplace domain Y_s = solve(eqnLaplace, Y);
% Compute inverse Laplace transform to get y(t) y_t = ilaplace(Y_s, s, t)Output:
y_t = 2 + 2*exp(-3*t)This result shows an exponential decay settling toward a steady-state value of 2.
Solve the second-order homogeneous differential equation:
[y''(t) + 5y'(t) + 6y(t) = 0 quad text{with } y(0) = 1, ; y'(0) = 0]syms y(t) s % Define derivatives and differential equation Dy = diff(y, t);
D2y = diff(y, t, 2);
eqn = D2y + 5*Dy + 6*y == 0;
% Transform equation to s-domain Y = laplace(y, t, s);
eqnLap = laplace(eqn, t, s);
% Substitute initial conditions y(0) = 1 and y'(0) = 0 eqnLap = subs(eqnLap, laplace(y, t, s), Y);
eqnLap = subs(eqnLap, y(0), 1);
eqnLap = subs(eqnLap, subs(diff(y, t), t, 0), 0);
% Solve for Y(s) and compute inverse Laplace transform Y_s = solve(eqnLap, Y);
y_t = ilaplace(Y_s, s, t)Output:
y_t = 3*exp(-2*t) - 2*exp(-3*t)Visualize the resulting time-domain analytical solution over a 5-second window using fplot():
figure;
f
plot(y_t, [0, 5], 'LineWidth', 1.5, 'Color', 'b');
title('Response of Second-Order System y(t)');
xlabel('Time t (seconds)');
ylabel('Amplitude y(t)');
grid on;laplace() to convert time-domain differential equations into algebraic (s)-domain expressions.subs() to inject physical initial conditions (y(0)) and (y'(0)).solve() to isolate (Y(s)) algebraically.ilaplace() to convert the solved (s)-domain expression back to a time-domain equation (y(t)).fplot() to visualize transient and steady-state time responses.Real feedback from students across top engineering universities worldwide.
“I got full marks on my MATLAB DSP assignment! The filter design code was completely vectorized, the frequency response plots were exact, and the delivery was 8 hours before my deadline. Highly recommended!”
“Our Simulink EV powertrain model had severe algebraic loop and solver errors. The MATLABSolutions team fixed the solver configuration in 4 hours and provided an annotated scope diagram. Lifesaver for my final year!”
Explore deep-dive technical articles written by our engineering team to master complex MATLAB & Simulink topics.
Modern microgrids operate with low physical inertia, rapid inverter switching dynamics, and intermittent renewable power generation. Simulating these systems requir...
Tracking complex trajectories with non-holonomic mobile robots requires handling physical constraints such as actuator saturation, wheel slip, and sharp cornering. Standard cont...