symbolic derivative of lagrangian & kinematic coefficient

1 回表示 (過去 30 日間)
Young Lee
Young Lee 2020 年 5 月 7 日
回答済み: Guru Mohanty 2020 年 5 月 11 日
Hi
II am working on some mechanical problems.
basically trying to take symbolic derivative of kinematic coefficients for the purpose of checking my hand calculations..
so here is the position scaler ; r2 cos(th2) - r3 * cos(th3) = 0
taking derivative with respect to th2 (theta2) , Vx = -r2 *sin(th2) + r3 *sin(th3) * d(th3)/d(th2) - cos(th3)*d(r3)/d(th2) = 0
and differentiate again for acceleration with respect to th2
Could you please explain on how this can be achieved using matlab?

回答 (1 件)

Guru Mohanty
Guru Mohanty 2020 年 5 月 11 日
Hi, I understand you want to find the first and second derivative of the following expression. You can do this by the following steps.
  1. Declare variables using syms.
  2. Build the expression.
  3. Define the first and second derivative using diff function.
Here is a sample code for it.
syms th2 r2 th3(th2) r3(th2)
disp = r2*cos(th2) - r3*cos(th3);
vel=diff(disp,th2);
accel=diff(vel,th2);

カテゴリ

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