Clear Filters
Clear Filters

finding laplace transform of heaviside function

5 views (last 30 days)
trying to get lapace and plot :
θ” + 2θ′ + 6θ = [H(t) − H(t − 1)],
θ(0) = 4, θ′ (0) = 5,
H is the Heaviside function defined by
H(t) = { 0, x < 0, 1, x ≥ 0.
Find and sketch θ(t).
my code : error with dsolve
laplace('heaviside(t)-heaviside(t-1)',t,s)
syms t theta gensoln initsoln
eq = 'D2theta + 2*Dtheta + 6*theta -heaviside(t)+heaviside(t-1)'
initsoln = dsolve(deq,'theta(0)=6, Dtheta(0)=6', 't')
pretty(initsoln)
  3 Comments
Brenda Galabe
Brenda Galabe on 13 Dec 2018
other differential like these worked just as is the only thing that was changed is theta
Brenda Galabe
Brenda Galabe on 13 Dec 2018
i think i got got it suppose to be dsolve(eq) not dsolve(deq)

Sign in to comment.

Answers (1)

Walter Roberson
Walter Roberson on 13 Dec 2018
sympref('HeavisideAtOrigin',1); %needs R2015a or later
syms s t
expr1 = heaviside(t)-heaviside(t-1);
expr2 = laplace(expr1, t, s) %not sure why we are doing this ??
syms theta(t)
Dtheta = diff(theta);
D2theta = diff(Dtheta);
deq = D2theta + 2*Dtheta + 6*theta == expr1;
initsoln = simplify( dsolve(deq, theta(0)==6, Dtheta(0)==6, t) )
Not sure what this has to do with laplace ?

Categories

Find more on Mathematics in Help Center and File Exchange

Products


Release

R2015b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!