Cant take the derivative of this plot...

1 vue (au cours des 30 derniers jours)
Peter Fennell
Peter Fennell le 1 Déc 2022
Commenté : Peter Fennell le 1 Déc 2022
clc
clear
m = 1;
b = 2;
k = 10;
t = linspace(0,7,175);
xlabel('0');
syms s
F=1./(m*s.^(3)+b*s.^(2)+k*s);
f=ilaplace(F,t);
plot(t,f)
xlabel('Time (t)')
ylabel('Displacement x(t)')
I have this code that gives a nice oscillating plot. But, I need to take the derivative of this plot and plot that as well.
  2 commentaires
Walter Roberson
Walter Roberson le 1 Déc 2022
Peter Fennell
Peter Fennell le 1 Déc 2022
Thank you!

Connectez-vous pour commenter.

Réponses (1)

Torsten
Torsten le 1 Déc 2022
Modifié(e) : Torsten le 1 Déc 2022
m = 1;
b = 2;
k = 10;
tnum = linspace(0,7,175);
xlabel('0');
syms s
F=1/(m*s^3+b*s^2+k*s);
f=ilaplace(F);
df=diff(f);
varf = symvar(f);
vardf = symvar(df);
plot(tnum,double(subs(f,varf,tnum)))
xlabel('Time (t)')
ylabel('Displacement x(t)')
plot(tnum,double(subs(df,vardf,tnum)))
xlabel('Time (t)')
ylabel('Velocity u(t)')

Catégories

En savoir plus sur Symbolic Math Toolbox dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by