Filter löschen
Filter löschen

how to lapace results

1 Ansicht (letzte 30 Tage)
Brenda Galabe
Brenda Galabe am 13 Dez. 2018
Kommentiert: Brenda Galabe am 13 Dez. 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)

Akzeptierte Antwort

Walter Roberson
Walter Roberson am 13 Dez. 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 Kommentare
Walter Roberson
Walter Roberson am 13 Dez. 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 am 13 Dez. 2018
thank you that worked

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Produkte


Version

R2015b

Community Treasure Hunt

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

Start Hunting!

Translated by