discipline module¶
The spring-mass model use case.
- class gemseo_umdo.use_cases.spring_mass_model.discipline.SpringMassDiscipline(mass=1.5, initial_state=(0, 0), initial_time=0.0, final_time=10.0, time_step=0.1, gravity=9.8)[source]
Bases:
MDODiscipline
The GEMSEO-based 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.
Initialize self. See help(type(self)) for accurate signature.
- 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.
- cache: AbstractCache | None
The cache containing one or several executions of the discipline according to the cache policy.
- property cost: float
The evaluation cost.
- data_processor: DataProcessor
A tool to pre- and post-process discipline data.
- exec_for_lin: bool
Whether the last execution was due to a linearization.
- input_grammar: BaseGrammar
The input grammar.
- jac: dict[str, dict[str, ndarray]]
The Jacobians of the outputs wrt inputs.
The structure is
{output: {input: matrix}}
.
- name: str
The name of the discipline.
- output_grammar: BaseGrammar
The output grammar.
- re_exec_policy: ReExecutionPolicy
The policy to re-execute the same discipline.
- residual_variables: Mapping[str, str]
The output variables mapping to their inputs, to be considered as residuals; they shall be equal to zero.
- run_solves_residuals: bool
Whether the run method shall solve the residuals.