[Objectives | Exercise | Example
A | Example B ]
OBJECTIVES
EXERCISE 1) Use Matlab to compute the Laplace transform of the following functions cos(3t), exp(2t)sin(t), and t^7. Then use Matlab to compute the inverse Laplace transform of the three results you just found, see Example A. 2) Using Laplace Transforms, solve the following initial value problem (see Example B below): y'' - 4y' - 5y = cosh(2t), y(0)=1, y'(0)=4 The following commands compute the Laplace transform of t^3*sin(2*t): >> syms s t The result is: You may make the answer look better by
typing >> pretty(Y) . The result is
Find a solution to the following differential equation with initial conditions
The first step is to define the symbolic variables we will need and then enter our differential equation. The result is: s*(s*laplace(y(t),t,s)-y(0))-D(y)(0)+2*s*laplace(y(t),t,s)-2*y(0)+laplace(y(t),t,s) = 2/(s^2+4) >>eqn=subs(ltode,{'laplace(y(t),t,s)','y(0)','D(y)(0)'},{Y,-2,3}) This command substitutes laplace(y(t),t,s) by Y, y(0) by -2, and Dy(0)
by 3 in Itode and gives: The result is which is the Laplace transform of the function y solving Eq. (**). We now find y(t) by inverting the Laplace transform: which is the solution to (**) as can be verified using MATLAB: and we may check the initial conditions using: t=0; y_0=eval(y), Dy_0=eval(diff(y)) which gives [Objectives | Exercises | Example ] |
Jump to Bruce Driver's Homepage. Jump to Current Courses Page.
|