Two-mass rotational system has the following form and is represented in following structural diagram.
where $\tau_e$, $\omega_1$ and $J_m$ - motor torque, angular velocity and moment of inertia
$\tau_s$, $\tau_s$, $\omega_2$ and $J_d$ - shaft torque, load torque, angular velocity and load moment of inertia;
$K_{md}$ - shaft stiffness
Problem: how to include a gear ratio $N=\frac{\omega_1}{\omega_2}$ in equation of motion and in in a block diagram respectively?
I wrote down the Lagrangian for each mass in terms of the gear ratio, but in the usual case, I just compiled a system of differential equations according to the Lagrange equation, but I cannot understand how now using the TWO Lagrangian to get one block diagram with a gear ratio.