0% found this document useful (0 votes)
20 views3 pages

Exp 8

Uploaded by

noorispoor0
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
20 views3 pages

Exp 8

Uploaded by

noorispoor0
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Experiment 8: Laplace Transform

Objective: To understand and perform Laplace Transforms on various basic


functions using MATLAB, and to visualize their transforms in the complex
frequency domain.

Laplace Transform of Basic Functions


Explanation: The Laplace Transform is a powerful tool for analyzing linear
time-invariant systems. It transforms a time-domain function into a complex
frequency-domain function, making it easier to solve differential equations and
analyze system behavior.
Steps:
1. Define the symbolic variables for time t and Laplace variable s.
2. Define the basic functions: exponential, unit step, sinusoidal, unit ramp,
unit parabola, and cosine.
3. Calculate the Laplace Transforms of these functions using the laplace
function.
4. Display the Laplace Transform expressions.
5. Plot the transforms in the complex frequency domain.
MATLAB Code:
% Define the Laplace variable s
syms s t

% Define the basic functions


% 1. Exponential function : f ( t ) = e ^( - at )
a = 2; % Change ’a ’ to any desired value
F1 = exp ( - a * t ) ;

% 2. Unit step function : f ( t ) = u ( t )


F2 = heaviside ( t ) ;

% 3. Sinusoidal function : f ( t ) = sin ( t )


omega = 3; % Change ’ omega ’ to any desired value

1
F3 = sin ( omega * t ) ;

% 4. Unit ramp function : f ( t ) = t * u ( t )


F4 = t * heaviside ( t ) ;

% 5. Unit parabola function : f ( t ) = (1/2) * t ^2* u ( t )


F5 = (1/2) * t ^2 * heaviside ( t ) ;

% 6. cos (3 t ) function
F6 = cos (3* t ) ;

% Calculate the Laplace transforms


Lap_F1 = laplace ( F1 , t , s);
Lap_F2 = laplace ( F2 , t , s);
Lap_F3 = laplace ( F3 , t , s);
Lap_F4 = laplace ( F4 , t , s);
Lap_F5 = laplace ( F5 , t , s);
Lap_F6 = laplace ( F6 , t , s);

% Display Laplace transform expressions


disp ( ’ Laplace Transforms : ’) ;
disp ([ ’ Laplace of e ^( - ’ , num2str ( a ) , ’t ) = ’, char (
Lap_F1 ) ]) ;
disp ([ ’ Laplace of u ( t ) = ’, char ( Lap_F2 ) ]) ;
disp ([ ’ Laplace of sin ( ’ , num2str ( omega ) , ’t ) = ’, char
( Lap_F3 ) ]) ;
disp ([ ’ Laplace of t * u ( t ) = ’, char ( Lap_F4 ) ]) ;
disp ([ ’ Laplace of (1/2) * t ^2* u ( t ) = ’, char ( Lap_F5 ) ]) ;
disp ([ ’ Laplace of cos (3 t ) = ’, char ( Lap_F6 ) ]) ;

% Create separate figures for each Laplace transform


figure ;
subplot (3 ,2 ,1) ;
ezplot ( Lap_F1 , [0 , 10]) ;
title ( ’ Laplace Transform of e ^( - at ) ’) ;
xlabel ( ’ Re ( s ) ’) ;
ylabel ( ’ Im ( s ) ’) ;

subplot (3 ,2 ,2) ;
ezplot ( Lap_F2 , [0 , 10]) ;
title ( ’ Laplace Transform of u ( t ) ’) ;
xlabel ( ’ Re ( s ) ’) ;
ylabel ( ’ Im ( s ) ’) ;

subplot (3 ,2 ,3) ;
ezplot ( Lap_F3 , [0 , 10]) ;

2
title ([ ’ Laplace Transform of sin ( ’ , num2str ( omega ) , ’t
) ’]) ;
xlabel ( ’ Re ( s ) ’) ;
ylabel ( ’ Im ( s ) ’) ;

subplot (3 ,2 ,4) ;
ezplot ( Lap_F4 , [0 , 10]) ;
title ( ’ Laplace Transform of t * u ( t ) ’) ;
xlabel ( ’ Re ( s ) ’) ;
ylabel ( ’ Im ( s ) ’) ;

subplot (3 ,2 ,5) ;
ezplot ( Lap_F5 , [0 , 10]) ;
title ( ’ Laplace Transform of (1/2) * t ^2* u ( t ) ’) ;
xlabel ( ’ Re ( s ) ’) ;
ylabel ( ’ Im ( s ) ’) ;

subplot (3 ,2 ,6) ;
ezplot ( Lap_F6 , [0 , 10]) ;
title ( ’ Laplace Transform of cos (3 t ) ’) ;
xlabel ( ’ Re ( s ) ’) ;
ylabel ( ’ Im ( s ) ’) ;

Explanation of New Functions Used


syms: This function is used to define symbolic variables in MATLAB. Sym-
bolic variables allow us to perform algebraic operations, calculus, and other
mathematical computations symbolically rather than numerically.
laplace: This function computes the Laplace Transform of a symbolic ex-
pression. It transforms a time-domain signal into its complex frequency-domain
representation.
heaviside: This function represents the Heaviside step function, which is
commonly used to model signals that switch on at a certain point in time.
char: This function converts symbolic expressions into character arrays
(strings) for display or further processing.
ezplot: This function is used for easy plotting of symbolic expressions. It
automatically determines the plotting range and generates a plot for the given
symbolic expression.
num2str: This function converts numbers to strings. It is often used for
creating dynamic titles, labels, or other strings that involve numerical values.

You might also like