Azzera filtri
Azzera filtri

how to lapace results

1 visualizzazione (ultimi 30 giorni)
Brenda Galabe
Brenda Galabe il 13 Dic 2018
Commentato: Brenda Galabe il 13 Dic 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)

Risposta accettata

Walter Roberson
Walter Roberson il 13 Dic 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 Commenti
Walter Roberson
Walter Roberson il 13 Dic 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 il 13 Dic 2018
thank you that worked

Accedi per commentare.

Più risposte (0)

Prodotti


Release

R2015b

Community Treasure Hunt

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

Start Hunting!

Translated by