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.“I got full marks on my MATLAB assignment! The solution was perfect and delivered well before the deadline. Highly recommended!”
“Quick delivery and excellent communication. The team really understood the problem and provided a great solution. Will use again.”
Explore how MATLAB Solutions has helped clients achieve their academic and research goals through practical, tailored assistance.
One of the most fascinating and sought-after projects for engineering students is autonomous vehicles. One of the main challenges in the development of self-driving cars is path planning, which is the process of determining a safe, collision-free route from start to o
The Battery Management System (BMS) serves as the intelligent brain of an electric vehicle (EV) battery pack. It ensures safety, maximizes performance, extends battery life, and optimizes energy usage in real-world driving conditions. As EVs become mainst