# 状態空間変換

ラグラジアンからの支配方程式．

 In[1]:= X\[ScriptCapitalL] = 1/2 m (x'[t]^2 + y'[t]^2 + (x[t] x'[t] + y[t] y'[t])^2/( r^2 - x[t]^2 - y[t]^2)) + m g Sqrt[r^2 - x[t]^2 - y[t]^2];
 In[2]:= XShort[eqns = Table[D[D[\[ScriptCapitalL], q'[t]], t] - D[\[ScriptCapitalL], q[t]] == Subscript[F, q][t], {q, {x, y}}]]
 Out[2]//Short=

 In[3]:= XShort[eqns = Table[D[D[\[ScriptCapitalL], q'[t]], t] - D[\[ScriptCapitalL], q[t]] == Subscript[F, q][t], {q, {x, y}}]]; AffineStateSpaceModel[ eqns, {x[t], y[t], x'[t], y'[t]}, {Subscript[F, x][t], Subscript[F, y][t]}, {Sqrt[r^2 - x[t]^2 - y[t]^2]}, t]; assm = AffineStateSpaceModel[%, {x, y, Subscript[x, d], Subscript[y, d]}] // Simplify
 Out[3]=

 In[4]:= Xctrans = Most@ CoordinateTransform[ "Spherical" -> "Cartesian", {r, \[Theta][t], \[Phi][t]}]
 Out[4]=

 In[5]:= Xctransd = D[ctrans, t] /. {\[Theta]' -> Subscript[\[Theta], d], \[Phi]' -> Subscript[\[Phi], d]}
 Out[5]=

 In[6]:= Xtrans = Thread[{x[t], y[t], Subscript[x, d][t], Subscript[y, d][t]} -> Join[ctrans, ctransd]]
 Out[6]=

 In[7]:= XStateSpaceTransform[ assm, {trans, {\[Theta][t], Subscript[\[Theta], d][t], \[Phi][t], Subscript[\[Phi], d][t]}}] // PowerExpand
 Out[7]=

## Mathematica

Questions? Comments? Contact a Wolfram expert »