フィルターのクリア

How to take a derivative of x with respect to time.

64 ビュー (過去 30 日間)
Henrik Kristiansen
Henrik Kristiansen 2020 年 2 月 25 日
Hello.
I'm trying to solve some derivatives in matlab for my dynamic course.
The problem is im a total noob to this program and i was wondering of some of you could help me out with this probaly simple problem.
I would like to get the time derivative of x with respect to t (time) but x^2 is a chain rule and xy would be a product rule.
Ive tried to solve it myself in the code below, its probaly totally wrong with my horrible coding skills.
Thanks.
syms x(t) y(t) z(t)
% f = [2*x-3*x*y+y^2-x*z+y*z^2-4*x*y*z , -x^2+x*y^2-2*y+5*y*z-x*z^2]
o = 2*x-3*x*y+y^2-x*z+y*z^2-4*x*y*z
p = -x^2+x*y^2-2*y+5*y*z-x*z^2
H = diff(x,t)*y*z+x*diff(y,t)*(z)+x*y*diff(z,t)
  3 件のコメント
Henrik Kristiansen
Henrik Kristiansen 2020 年 2 月 25 日
o should end up being equal to 2ẋ-3(ẋy+xẏ)+2yẏ-(ẋz+xż)+ẏz^2+2yzż
All the dotted letters are the time derivatives.
im having problems making matlab do the time derivatives with respect to x but x is a function
Henrik Kristiansen
Henrik Kristiansen 2020 年 2 月 25 日
dx^2/dx * dx/dt = 2xẋ

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

回答 (1 件)

Koushik Vemula
Koushik Vemula 2020 年 3 月 3 日
According to what I understand, you are trying to get the differentiation of variable o’ with respect to the parameter t.
For this we have a function ‘diff’ in MATLAB which comes under syms module, it can be used in the following manner
diff(o, t)
This will give you the expected answer.
Refer this documentation for more understanding of the function ‘diff: https://www.mathworks.com/help/symbolic/diff.html
  1 件のコメント
Henrik Kristiansen
Henrik Kristiansen 2020 年 3 月 3 日
Thanks, ill try that :)

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

カテゴリ

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