gemseo.problems.ode.springs.coupled_springs_generator module#
An object returning a Discipline for a chain of masses connected by springs.
The coupling between the dynamics of the different masses can be done at the level of
the RHS of the ODE (by the method create_discipline_with_coupled_dynamics()),
or by coupling directly as many instances of ODEDiscipline as there are masses
(by the method create_coupled_ode_disciplines()).
- class CoupledSpringsGenerator(masses, stiffnesses, times=array([0., 0.34482759, 0.68965517, 1.03448276, 1.37931034, 1.72413793, 2.06896552, 2.4137931, 2.75862069, 3.10344828, 3.44827586, 3.79310345, 4.13793103, 4.48275862, 4.82758621, 5.17241379, 5.51724138, 5.86206897, 6.20689655, 6.55172414, 6.89655172, 7.24137931, 7.5862069, 7.93103448, 8.27586207, 8.62068966, 8.96551724, 9.31034483, 9.65517241, 10.]), leftmost_position=0.0, rightmost_position=0.0)[source]#
Bases:
objectA class to create disciplines representing chain of masses linked by springs.
- Parameters:
masses (RealArray | Sequence[float]) -- The values of the masses.
stiffnesses (RealArray | Sequence[float]) -- The stiffnesses of the springs.
times (RealArray) --
The times for which the problem should be solved.
By default it is set to [ 0. 0.34482759 0.68965517 1.03448276 1.37931034 1.72413793 2.06896552 2.4137931 2.75862069 3.10344828 3.44827586 3.79310345 4.13793103 4.48275862 4.82758621 5.17241379 5.51724138 5.86206897 6.20689655 6.55172414 6.89655172 7.24137931 7.5862069 7.93103448 8.27586207 8.62068966 8.96551724 9.31034483 9.65517241 10. ].
leftmost_position (RealArray | float) --
The position of the other extremity of the spring to the left.
By default it is set to 0.0.
rightmost_position (RealArray | float) --
The position of the other extremity of the spring to the right.
By default it is set to 0.0.
- create_coupled_ode_disciplines(**ode_solver_options)[source]#
Create coupled ODE disciplines describing masses connected by springs.
- Parameters:
**ode_solver_options -- The options of the ODE solver.
- Returns:
The ODE disciplines.
- Return type:
Sequence[ODEDiscipline]
- create_discipline_with_coupled_dynamics(**ode_solver_options)[source]#
Create an ODE discipline describing masses connected by springs.
The dynamic of the discipline (that is the right hand side of the corresponding ODE) is represented by coupled disciplines.
- Parameters:
**ode_solver_options -- The options of the ODE solver.
- Returns:
The ODE discipline.
- Return type:
- property initial_position_names#
The names of the inputs defining the initial position.
- Returns:
The names of the inputs defining the initial position.
- property position_names#
The names of the inputs defining the position of a mass.
- Returns:
The names of the inputs defining the position.
- property state_dot_names#
The names of the time derivatives of the state variables.
- Returns:
The names of the time derivatives of the state variables as computed by the RHS discipline.
- property state_names#
The names of the state variables.
- Returns:
The names of the state variables (position and velocity).
- property times#
The times at which the solution os evaluated.
- Returns:
The times of evaluation of the solution.