フィルターのクリア

How to substitute a value for the time derivative of a function

13 ビュー (過去 30 日間)
Hazim Nasir
Hazim Nasir 2018 年 12 月 17 日
コメント済み: madhan ravi 2018 年 12 月 17 日
Hellow
I have a dispalcemet function of time defined as:
syms d(t)
>> a = d^2+sin(d)
The first derivative is the velocity:
>> v = diff(a)
v(t) =
cos(d(t))*diff(d(t), t) + 2*d(t)*diff(d(t), t)
the parameter diff(d(t), t) means the velocity value but How I can substitute a value for it using subs or any other function?
thank you

採用された回答

madhan ravi
madhan ravi 2018 年 12 月 17 日
編集済み: madhan ravi 2018 年 12 月 17 日
use subs() like below:
syms d(t)
a = d^2+sin(d);
v = diff(a);
after=subs(v,diff(d),2) % here diff(d) is replace number 2
Gives:
after(t) =
2*cos(d(t)) + 4*d(t)
or use ode45() -> diff(d,2)==>acceleration the right hand side is as it is so we treat them now as second order ode which is then further reduced to first order odes.
[t,x]=ode45(@myod2,[0 2],[0;1]);
figure(1)
plot(t,x(:,1),'-ok')
figure(2)
plot(t,x(:,2),'-or')
function dxdt = myod2(t,Y)
dxdt=[Y(2);
sin(Y(1)) + Y(1)^2];
end
  4 件のコメント
Hazim Nasir
Hazim Nasir 2018 年 12 月 17 日
MANY THANKS
madhan ravi
madhan ravi 2018 年 12 月 17 日
Anytime :)

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeCalculus についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by