MATH 267 How to use the Laplace transform in MATLAB

advertisement
MATH 267
How to use the Laplace transform in MATLAB
MATLAB contains very easy to use commands for both the Laplace transform and the
inverse Laplace transform. These are part of the Symbolic Toolbox which may or may
not be installed. This toolbox is available, for example, in the Mathematics Department
Computer Lab, 449 Carver.
Enter the following commands for a simple demonstration:
>> syms t s
>> f=t*exp(-2*t)
>> laplace(f)
The answer will be the Laplace transform of f (t) = te−2t , expressed in the MATLAB
syntax.
>> F=1/(s∧3-s∧2+s-1)
>> ilaplace(F)
The answer will be the inverse Laplace transform of F (s) = 1/(s3 − s2 + s − 1).
The first MATLAB command above establishes t,s as symbolic expressions. Other
expressions defined in terms of t,s, such as f, F are then automatically symbolic expressions also. Complicated symbolic expressions may be constructed from simpler ones, for
example
>> F1=3+exp(-s)
>> F2=s∧2-4
>> F=F1/F2
If F is any symbolic expression the command
>> pretty(F)
may be used to produce an expression for F in a more easily readable format.
HOMEWORK
Use MATLAB as much as possible to do the following:
√
1) Find the Laplace transform of f (t) = 2t2 e−t cos (4t) + t.
e−4s (2s + 1)
.
2) Find the inverse Laplace transform of F (s) = 3 2
s (s + 2s + 5)
3) Solve the initial value problem
y 000 + 6y 00 + 15y 0 + 50y = te−5t + t3
y(0) = 2
y 0 (0) = 1 y 00 (0) = 0
In each case your final answer should be expressed in ordinary mathematical notation,
not the MATLAB syntax.
4) Also hand in page 263, #24 and page 277, #28 (these should be done without
MATLAB).
Download