Cant take the derivative of this plot...

1 次查看(过去 30 天)
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.

回答(1 个)

Torsten
Torsten 2022-12-1
编辑:Torsten 2022-12-1
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)')

类别

Help CenterFile Exchange 中查找有关 Symbolic Math Toolbox 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by