Cant take the derivative of this plot...

1 visualizzazione (ultimi 30 giorni)
Peter Fennell
Peter Fennell il 1 Dic 2022
Commentato: Peter Fennell il 1 Dic 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.

Risposte (1)

Torsten
Torsten il 1 Dic 2022
Modificato: Torsten il 1 Dic 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)')

Categorie

Scopri di più su Symbolic Math Toolbox in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by