finding laplace transform of heaviside function

6 次查看(过去 30 天)
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 个评论
Brenda Galabe
Brenda Galabe 2018-12-13
other differential like these worked just as is the only thing that was changed is theta
Brenda Galabe
Brenda Galabe 2018-12-13
i think i got got it suppose to be dsolve(eq) not dsolve(deq)

请先登录,再进行评论。

回答(1 个)

Walter Roberson
Walter Roberson 2018-12-13
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 ?

类别

Help CenterFile Exchange 中查找有关 Mathematics 的更多信息

产品


版本

R2015b

Community Treasure Hunt

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

Start Hunting!

Translated by