Professional Documents
Culture Documents
Lab 9 SS
Lab 9 SS
Objective
Laplace Transform
where
Laplace transform of a function f(t) can be obtained with Matlab's function laplace.
laplace
Laplace transform
Syntax
laplace(F)
laplace(F, t)
laplace(F, w, z)
Description:
L = laplace(F) computes the Laplace transform of the symbolic expression F. This syntax
assumes that F is a function of the variable t, and the returned value L as a function of s.
L = laplace(F,w,z) computes the Laplace transform L and lets you specify that L is a function
of z and F is a function of w.
Examples
f(t) = t4
syms t;
f = t^4;
laplace(f)
returns
ans =
Laplace Transform MATLAB Command
24/s^5
syms s;
g = 1/sqrt(s);
laplace(g)
returns
ans =
pi^(1/2)/t^(1/2)
f(t) = e–at
syms t a x;
f = exp(-a*t);
laplace(f,x)
returns
ans =
1/(a + x)
ilaplace
F = ilaplace(L)
F = ilaplace(L,y)
F = ilaplace(L,y,x)
Description
F = ilaplace(L) computes the inverse Laplace transform of the symbolic expression L. This
syntax assumes that L is a function of the variable s, and the returned valueF is a function of t.
where c is a real number selected so that all singularities of L(s) are to the left of the line s = c, i.
F = ilaplace(L,y) computes the inverse Laplace transform F as a function of y instead of the
default variable t.
F = ilaplace(L,y,x) computes the inverse Laplace transform and lets you specify that F is a
function of x and L is a function of y.
Examples
Inverse Laplace Transform MATLAB Command
syms s;
f = 1/s^2;
ilaplace(f)
=t
returns
ans =
syms a t;
g = 1/(t-a)^2;
ilaplace(g)
= xeax
returns
ans =
x*exp(a*x)
syms x u;
syms a real;
f = 1/(u^2-a^2);
simplify(ilaplace(f,x))
returns
ans =
sinh(a*x)/a
Example 1:
Please note that the array representing the function y must have the same dimension as that
of t array. Array division "./" and array exponential ".^" are used to create the y array as a
function of t.Note that MATLAB will treat all entries after the "%" sign as comment line. The
command "gtext" is used to insert a user-defined text string at a chosen cursor position on the
graph. The graphic window displaying the plot is shown below:
Example 2:
Two or more plots can be shown on the same graph as shown in this example. In this example, an
additional function "y2" is to be shown with function y plotted in Example 1 on the same graph.
Note that the "legend" function is used to label the plots. The entries in MATLAB command
window are as follows:
Example 3:
You may show multiple plot in an array format. This can be achieved with the "subplot" command.
You may arrange multiple plot in any array you wish, e.g., a 2 x 2 plot array would yield two plots
on the top row and two plots on the bottom row. The functions used in Examples 1 and 2 above
can be shown in an array format by the following inputs:
Example 4:
>> laplace(12*diff(sym('y(t)'),2))
Note that the function y(t) is defined as symbol with the imbeded command "sym". The number 2
means we wish to take the second derivative of the function y(t).
MATLAB result:
ans=12*s*(s*laplace(y(t),t,s)-y(0))-12*D(y)(0)
Read the instructions and evaluate the following by hand and through MATLAB:
CONCLUSION:
In this part(a) session of the lab, I learned about laplace transform and it’s uses. Laplace
transform of a function f (t) is defined as
The Laplace transform is also used for solving differential equations. It is accepted widely in many
fields. We also know that Laplace transform simplifies a given LDE (linear differential equation) to
an algebraic equation, which can later be solved using the standard algebraic identities.
In general, the Laplace transform is used for the applications in the time-domain for t ≥ 0. However,
the transformation variable must not necessarily be time. It can also be any independent variable x
on the domain from 0 to ∞.
Laplace transform is the integral transform of the given derivative function with real variable t to
convert into a complex function with variable s. For t ≥ 0, let f(t) be given and assume the function
satisfies certain conditions to be stated later on. Whenever the improper integral converges.
Laplace transform is an integral transform method which is particularly useful in solving linear
ordinary differential equations. It finds very wide applications in various areas of physics, electrical
engineering, control engineering, optics, mathematics and signal processing.
I also performed laplace and inverse laplace transform on matlab software and calculated the results
of the equations as shown above.
Part (b)
Transfer Functions
Residue finds the partial fraction expansion of the ratio of two polynomials. This is particularly
useful for applications that represent systems in transfer function form. For polynomials b and a,
if there are no multiple roots,
where r is a column vector of residues, p is a column vector of pole locations, and k is a row
vector of direct terms. Consider the transfer function
b = [-4 8];
a = [1 6 8];
[r,p,k] = residue(b,a)
r=
-12
p=
-4
-2
k=
[]
Given three input arguments (r, p, and k), residue converts back to polynomial form:
[b2,a2] = residue(r,p,k)
b2 =
-4 8
a2 =
1 6 8
Convolution:
conv -Convolution and polynomial multiplication
Syntax
w = conv(u,v)
w = conv(...,'shape')
Description:
same Returns the central part of the convolution of the same size as u.
valid Returns only those parts of the convolution that are computed without the zero-padded
edges. Using this option,length(w) is max(length(u)-max(0,length(v)-1),0).
Definitions:
Let m = length(u) and n = length(v) . Then w is the vector of length m+n-1 whose kth element is
The sum is over all the values of j which lead to legal subscripts for u(j) and v(k+1-j),
specifically j = max(1,k+1-n): min(k,m). When m = n, this gives
w(1) = u(1)*v(1)
w(2) = u(1)*v(2)+u(2)*v(1)
w(3) = u(1)*v(3)+u(2)*v(2)+u(3)*v(1)
...
...
w(2*n-1) = u(n)*v(n)
Transfer Function
Syntax
tf
sys = tf(num,den)
sys = tf(num,den,Ts)
sys = tf(M)
sys = tf(num,den,ltisys)
tfsys = tf(sys)
Description:
Use tf to create real- or complex-valued transfer function models (TF objects) or to convert state-
space or zero-pole-gain models to transfer function form. You can also use tf to create Generalized
state-space (genss) models.
In the SISO case, num and den are the real- or complex-valued row vectors of numerator and
denominator coefficients ordered in descending powers of s. These two vectors need not have
equal length and the transfer function need not be proper. For example, h = tf([1 0],1) specifies the
pure derivative h(s) = s.
To create MIMO transfer functions, using one of the following approaches:
For examples of creating MIMO transfer functions, see Examples and Multi-Input, Multi-Output
Transfer Function Model in the Control System Toolbox User Guide.
If all SISO entries of a MIMO transfer function have the same denominator, you can set den to
the row vector representation of this common denominator. See "Examples" for more details.
sys = tf(num,den,Ts) creates a discrete-time transfer function with sample time Ts (in seconds).
Set Ts = -1 to leave the sample time unspecified. The input arguments num and den are as in the
continuous-time case and must list the numerator and denominator coefficients
in descending powers of z.
There are several ways to create arrays of transfer functions. To create arrays of SISO or MIMO
TF models, either specify the numerator and denominator of each SISO entry using
multidimensional cell arrays, or use a for loop to successively assign each TF model in the array.
See Model Arrays in the Control System Toolbox User Guide for more information.
Any of the previous syntaxes can be followed by property name/property value pairs
'Property',Value
Each pair specifies a particular property of the model, for example, the input names or the
transfer function variable. For information about the properties of tfobjects, see Properties. Note
that
sys = tf(num,den,'Property1',Value1,...,'PropertyN',ValueN)
is a shortcut for
sys = tf(num,den)
set(sys,'Property1',Value1,...,'PropertyN',ValueN)
Read the instructions and evaluate the following by hand and through MATLAB:
3s−2
1.
s2−s
s2+9s−9
2.
s3−9s
CONCLUSION:
In this part(b) session of the lab, I learned about transfer functions and learned about partial
fractions and how to find it on matlab software.
Partial Fraction Expansion:
Residue finds the partial fraction expansion of the ratio of two polynomials. This is particularly
useful for applications that represent systems in transfer function form.
For polynomials b and a, if there are no multiple roots, where r is a column vector of residues, p is a
column vector of pole locations, and k is a row vector of direct terms. It’s method is as follows:
b = [-4 8];
a = [1 6 8];
[r,p,k] = residue(b,a)
Partial fractions are the fractions used for the decomposition of a rational expression. When an
algebraic expression is split into a sum of two or more rational expressions, then each part is called a
partial fraction. Hence, basically, it is the reverse of the addition of rational expressions .
Partial-fraction decomposition is the process of starting with the simplified answer and taking it back
apart, of "decomposing" the final expression into its initial polynomial fractions. To decompose a
fraction, you first factor the denominator.
In this way by using the above method we can calculate the partial fraction of the above given
questions. Hence, result’s can be verified.