newton.solvers.SolverSemiImplicit#
- class newton.solvers.SolverSemiImplicit(model, angular_damping=0.05, friction_smoothing=1.0, joint_attach_ke=1.0e4, joint_attach_kd=1.0e2, enable_tri_contact=True)[source]#
Bases:
SolverBaseA 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
- Joint limitations:
Supported joint types: PRISMATIC, REVOLUTE, BALL, FIXED, FREE, DISTANCE (treated as FREE), D6. CABLE joints are not supported.
joint_enabled,joint_limit_ke/joint_limit_kd,joint_target_ke/joint_target_kd, andjoint_fare supported.Joint limits and targets are not enforced for BALL joints.
joint_armature,joint_friction,joint_effort_limit,joint_velocity_limit, andjoint_target_modeare not supported.Equality and mimic constraints are not supported.
See Joint Feature Support for the full comparison across solvers.
Example
solver = newton.solvers.SolverSemiImplicit(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, enable_tri_contact=True)#
- Parameters:
model (Model) – The model to be simulated.
angular_damping (float) – Angular damping factor to be used in rigid body integration. Defaults to 0.05.
friction_smoothing (float) – Huber norm delta used for friction velocity normalization (see
warp.math.norm_huber()). Defaults to 1.0.joint_attach_ke (float) – Joint attachment spring stiffness. Defaults to 1.0e4.
joint_attach_kd (float) – Joint attachment spring damping. Defaults to 1.0e2.
enable_tri_contact (bool) – Enable triangle contact. Defaults to True.
- step(state_in, state_out, control, contacts, dt)#
Simulate the model for a given time step using the given control input.
- Parameters:
state_in (State) – The input state.
state_out (State) – The output state.
control (Control | None) – The control input. Defaults to None which means the control values from the
Modelare used.contacts (Contacts | None) – The contact information. Defaults to None which means no contacts are used.
dt (float) – The time step (typically in seconds).
Warning
The
eval_particle_contactkernel for particle-particle contact handling may corrupt the gradient computation for simulations involving particle collisions. To disable it, setnewton.Model.particle_gridto None prior to callingstep().