Clear Filters
Clear Filters

how to lapace results

1 view (last 30 days)
Brenda Galabe
Brenda Galabe on 13 Dec 2018
Commented: Brenda Galabe on 13 Dec 2018
how to plot this please
deqdiff = 'diff(y(t),t,t) + y(t) - cos(t)'
ldeqdiff = laplace(deqdiff,t,s)
sldeqdiff = subs(ldeqdiff,{'D(y)(0)','y(0)'},{1,1})
syms Ys
ldeqinit = subs(sldeqdiff,'laplace(y(t),t,s)',Ys)
ly = solve(ldeqinit,Ys)
ilaplace(ly,s,t)

Accepted Answer

Walter Roberson
Walter Roberson on 13 Dec 2018
syms s t y(t)
Dy = diff(y);
deqdiff = diff(y(t),t,t) + y(t) - cos(t);
ldeqdiff = laplace(deqdiff,t,s);
sldeqdiff = subs(ldeqdiff,{Dy(0), y(0)},{1,1});
syms Ys
Lyt = laplace(y(t), t, s);
ldeqinit = subs(sldeqdiff, Lyt, Ys);
ly = solve(ldeqinit,Ys);
ily = ilaplace(ly,s,t);
fplot(ily, [0 20])
  4 Comments
Walter Roberson
Walter Roberson on 13 Dec 2018
You are using the transition release, when fplot had been introduced but did not yet support symbolic expressions.
Replace
fplot(ily,[0 20])
with
Fily = matlabFunction(ily);
fplot(Fily, [0 20])
.... And laplace still is not documented in your release (or any other release) as accepting a character vector. You need to start using documented behaviour or else we are going to start telling you to work things out by yourself since you are relying on undocumented behaviour.
Brenda Galabe
Brenda Galabe on 13 Dec 2018
thank you that worked

Sign in to comment.

More Answers (0)

Products


Release

R2015b

Community Treasure Hunt

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

Start Hunting!