test_mass_update
- test_mass_update.test_continuouslyChangingMass(showPlots: bool = False)[source]
A ball with mass
m
is at rest, then accelerated with constant thrust T=100 for 25 units of time in the positive x-axis direction. The initial massm_0
is that of a sphere of radius 1 and density 1000. The mass is constantly decreasing, with a slope of -100 units of mass per unit of time. The evolution of the velocity is given by the ODE:dm/dt = -100 dv/dt = 100/m
which has solution family:
m(t) = c_1 - 100*t v(t) = c_2 - log(100*t - c_1)
to meet the initial conditions,
c_1
must be the initial massm_0
, whilec_2
islog(-m_0)
. Solving for v(t):v(t) = log(m_0) - log(m_0 - 100t)
In this function we run this scenario in MuJoCo to check that simulation with variable mass returns the same as the analytical solution of the velocity.