Builtin model of a simple spring.Spring model that applies a force to a parent or other target object. More...
Public Member Functions | |
void | initialize_data () |
void | initialization_complete () |
void | rhs (double t, double jd) |
Builtin model of a simple spring.
Spring model that applies a force to a parent or other target object.
void dsim_ideal_spring::initialization_complete | ( | ) | [virtual] |
Look up the target now that model initialization is complete. If no target is found, use the parent object. Set the target object's position as cointegrated.
Reimplemented from dsim_model.
void dsim_ideal_spring::initialize_data | ( | ) | [virtual] |
Create the target for the mass that will be connected to this spring. This target must accept the 'apply_force' message. Also create the two parameters: the spring constant "k" and a vector for the location of the based of the spring.
Reimplemented from dsim_model.
void dsim_ideal_spring::rhs | ( | double | t, |
double | jd | ||
) | [virtual] |
Dynamics. Compute the spring force and send the 'apply_force' message to the target. The force is equal to the spring constant k times the difference between the spring base position and the target position .
t | Elapsed time, unused |
jd | Julian date, unused |
Reimplemented from dsim_model.