gemseo_umdo / use_cases / spring_mass_model

model module

The GEMSEO-free spring-mass model.

class gemseo_umdo.use_cases.spring_mass_model.model.SpringMassModel(mass=1.5, initial_state=(0, 0), initial_time=0.0, final_time=10.0, time_step=0.1, gravity=9.8)[source]

Bases: object

The GEMSEO-free spring-mass model \(m\frac{d^2z(t)}{dt^2} = -kz(t) + mg\).

This model computes the time displacement of an object attached to a spring in function of the stiffness of the spring.

It computes also its maximum displacement.

The equations are

\[m\frac{d^2z}{dt^2} = -kz + mg\]
Parameters:
  • mass (float) –

    The mass of the object.

    By default it is set to 1.5.

  • initial_state (tuple[float, float]) –

    The initial position and velocity of the object.

    By default it is set to (0, 0).

  • initial_time (float) –

    The initial time.

    By default it is set to 0.0.

  • final_time (float) –

    The final time.

    By default it is set to 10.0.

  • time_step (float) –

    The time step.

    By default it is set to 0.1.

  • gravity (float) –

    The gravity acceleration.

    By default it is set to 9.8.

property cost: float

The evaluation cost.