Symbolic Derivative in matlab

5 ビュー (過去 30 日間)
HN
HN 2020 年 8 月 17 日
編集済み: HN 2020 年 8 月 18 日
Can matlab diffrentiate F with respect to θ , ϕ and ψ only ?.
Any help is apperciated

採用された回答

KSSV
KSSV 2020 年 8 月 17 日
You can carry on symbolic calculations. Read about diff.
  7 件のコメント
KSSV
KSSV 2020 年 8 月 18 日
syms A B C t th
R = -A*(cos(t)-cos(t))+B*cos(th)*sin(t);
S = A*sin(t)*sin(t)-B*cos(t)+C*cos(t);
phi=atan(R/S)
HN
HN 2020 年 8 月 18 日
編集済み: HN 2020 年 8 月 18 日
Why running on live script and script gives different result for the same expression?
syms syms t phi(t) theta(t) psi(t) dphi dtheta dpsi rp L alpha beta
x=rp*sin(alpha)*(cos(theta)*sin(phi) - cos(phi)*sin(psi)*sin(theta)) - rp*cos(alpha)*(cos(phi)*cos(theta) + sin(phi)*sin(psi)*sin(theta)) + (rp*cos(psi)*(sin(alpha + phi) - sin(phi)))/tan(alpha)
diff(x, t)
using matlab mlx and matlab script. Both gives different result
mlx gives
vx=rp*cos(psi(t))*cos(theta(t))*sin(phi(t))*sin(alpha) - rp*cos(phi(t))*cos(psi(t))*cos(theta(t))*cos(alpha)
while running on matlab script gives
vx=((rp*cos(psi(t))*(cos(alpha + phi(t)) - cos(phi(t)))*diff(phi(t), t))/tan(alpha) - rp*sin(alpha)*(sin(phi(t))*sin(theta(t))*diff(theta(t), t) - cos(phi(t))*cos(theta(t))*diff(phi(t), t) + cos(phi(t))*cos(psi(t))*sin(theta(t))*diff(psi(t), t) + cos(phi(t))*cos(theta(t))*sin(psi(t))*diff(theta(t), t) - sin(phi(t))*sin(psi(t))*sin(theta(t))*diff(phi(t), t)) - rp*cos(alpha)*(cos(phi(t))*sin(psi(t))*sin(theta(t))*diff(phi(t), t) - cos(phi(t))*sin(theta(t))*diff(theta(t), t) - cos(theta(t))*sin(phi(t))*diff(phi(t), t) + cos(psi(t))*sin(phi(t))*sin(theta(t))*diff(psi(t), t) + cos(theta(t))*sin(phi(t))*sin(psi(t))*diff(theta(t), t)) - (rp*sin(psi(t))*(sin(alpha + phi(t)) - sin(phi(t)))*diff(psi(t), t))/tan(alpha))

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

その他の回答 (0 件)

カテゴリ

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