Continuing the questions:
Lagrangian of three-mass system with Mathematica
Equations of motion for two-mass torsional oscillator with the gear train
Derivation of equations of motion for a multi-body system using Mathematica
A Lagrangian is given in which the kinetic energy is written as quadratic form:
$L=\frac{1}{2}\dot{\theta_1}^2+\frac{1}{2}\dot{\theta_2}^2+\frac{1}{2}\dot{\theta_3}^2+\frac{1}{2}\boldsymbol{\omega}^T I_2(\theta_1,\theta_2,\theta_3)\boldsymbol{\omega}+\frac{1}{2}\boldsymbol{\Omega}^T I_p(\theta_1,\theta_2,\theta_3)\boldsymbol{\Omega}+\frac{c_1(\theta_1-\boldsymbol{\omega})^2}{2}$
where $\omega,\Omega$ - vectors;
$I_2,I_p$ - matrix;
Generalized coordinates $\boldsymbol{q}=[\theta_1,\theta_2,\theta_3,\boldsymbol{\omega},\boldsymbol{\Omega}]$
$\frac{d}{dt}(\frac{dL}{d\dot{\boldsymbol{q}}})-\frac{dL}{d\boldsymbol{q}}=0$
How to get equations of motion from $L$ without writing out vectors and matrices component-wise, but assuming that we are dealing only with matrices and vectors?
(those. to actually work with vector and matrix differentiation in Mathematica).
I considered the issue in the previous topic, but I could not solve it correctly.
Quadratic form derivative in Mathematica
EDIT:
There is my Lagrangian in Mathematica:
L = 1/2 Subscript[\[Theta], 1]^2 + 1/2 Subscript[\[Theta], 2]^2 +
1/2 Subscript[\[Theta], 3]^2 +
1/2 Transpose[\[Omega]] I2[Subscript[\[Theta], 1]^2,
Subscript[\[Theta], 2]^2, Subscript[\[Theta], 3]^2] \[Omega] +
1/2 Transpose[\[CapitalOmega]] Ip[Subscript[\[Theta], 1]^2,
Subscript[\[Theta], 2]^2,
Subscript[\[Theta], 3]^2] \[CapitalOmega]
When I try to get $\frac{dL}{d\omega}$, i get this incorrect result. Mathematica can't work with Matrix Calculus ?
