Cant take the derivative of this plot...

1 Ansicht (letzte 30 Tage)
Peter Fennell
Peter Fennell am 1 Dez. 2022
Kommentiert: Peter Fennell am 1 Dez. 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.

Antworten (1)

Torsten
Torsten am 1 Dez. 2022
Bearbeitet: Torsten am 1 Dez. 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)')

Kategorien

Mehr zu Symbolic Math Toolbox finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by