Public Member Functions

dsim_ideal_spring Class Reference
[Builtin Models]

Builtin model of a simple spring.Spring model that applies a force to a parent or other target object. More...

Inheritance diagram for dsim_ideal_spring:

List of all members.

Public Member Functions

void initialize_data ()
void initialization_complete ()
void rhs (double t, double jd)

Detailed Description

Builtin model of a simple spring.

Spring model that applies a force to a parent or other target object.


Member Function Documentation

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 $\vec{p}_0$ and the target position $\vec{p}$.

\[F = k(\vec{p}_0 - \vec{p})\]

Parameters:
tElapsed time, unused
jdJulian date, unused

Reimplemented from dsim_model.

 All Classes Files Functions Typedefs Enumerations Enumerator