Cant take the derivative of this plot...

1 回表示 (過去 30 日間)
Peter Fennell
Peter Fennell 2022 年 12 月 1 日
コメント済み: Peter Fennell 2022 年 12 月 1 日
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 件のコメント
Walter Roberson
Walter Roberson 2022 年 12 月 1 日
Peter Fennell
Peter Fennell 2022 年 12 月 1 日
Thank you!

サインインしてコメントする。

回答 (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 Center および File ExchangeSymbolic Math Toolbox についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by