newton.solvers.SemiImplicitSolver#
- class newton.solvers.SemiImplicitSolver(model, angular_damping=0.05, friction_smoothing=1.0, joint_attach_ke=1.0e4, joint_attach_kd=1.0e2)[source]#
Bases:
SolverBase
A semi-implicit integrator using symplectic Euler
After constructing Model and State objects this time-integrator may be used to advance the simulation state forward in time.
Semi-implicit time integration is a variational integrator that preserves energy, however it not unconditionally stable, and requires a time-step small enough to support the required stiffness and damping forces.
See: https://en.wikipedia.org/wiki/Semi-implicit_Euler_method
Example
solver = newton.solvers.SemiImplicitSolver(model) # simulation loop for i in range(100): solver.step(state_in, state_out, control, contacts, dt) state_in, state_out = state_out, state_in
- __init__(model, angular_damping=0.05, friction_smoothing=1.0, joint_attach_ke=1.0e4, joint_attach_kd=1.0e2)#
Create a new Euler solver.
- Parameters:
model (Model) – Model to use by this solver.
angular_damping (float, optional) – Angular damping factor to be used in rigid body integration. Defaults to 0.05.
friction_smoothing (float, optional) – Huber norm delta used for friction velocity normalization (see
warp.math.norm_huber()
). Defaults to 1.0.joint_attach_ke (float, optional) – Joint attachment spring stiffness. Defaults to 1.0e4.
joint_attach_kd (float, optional) – Joint attachment spring damping. Defaults to 1.0e2.
- step(state_in, state_out, control, contacts, dt)#