Systems API¶
Shared interface¶
StructuralSystem ¶
Bases: ABC
Strategy interface for a linear time-invariant structural model.
Implementations provide matrices for
M u'' + C u' + K u = f and map physical positions to the generalized
coordinates u. All matrices use one caller-selected, consistent unit
system; DynaResp performs no unit conversion.
damping_matrix
property
¶
Return an independent copy of the generalized damping matrix.
stiffness_matrix
property
¶
Return an independent copy of the generalized stiffness matrix.
matrices
abstractmethod
¶
modal_analysis
abstractmethod
¶
observation_vector
abstractmethod
¶
force_vector ¶
Return the generalized force vector for a point load.
By virtual work this equals :meth:observation_vector for a point on
the structure. Continuous systems override it when a moving force may
temporarily lie outside their bounded domain.
Source code in src/dynaresp/systems/base.py
ModalProperties
dataclass
¶
Natural frequencies and mode shapes evaluated at requested positions.
Attributes:
| Name | Type | Description |
|---|---|---|
frequencies_hz |
FloatArray
|
Vector with shape |
mode_shapes |
FloatArray
|
Physical displacement shapes with shape
|
positions |
FloatArray
|
Coordinates corresponding to the last mode-shape axis. |
MDOF systems¶
MDOFSystem ¶
Bases: StructuralSystem
Discrete system built from matrices or an attached mass-spring topology.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
M
|
ArrayLike | None
|
Mass matrix with shape |
None
|
C
|
ArrayLike | None
|
Damping matrix matching |
None
|
K
|
ArrayLike | None
|
Stiffness matrix matching |
None
|
labels
|
Sequence[str] | None
|
Optional non-empty label for every DOF. |
None
|
Notes
Supply all three matrices together, or omit them and call
:meth:attach_mass to assemble a topology. Positions for loads and
sensors are zero-based integer DOF indices; no spatial interpolation
is implied between them.
Source code in src/dynaresp/systems/mdof.py
attach_mass ¶
Attach one mass to ground or a previously attached mass.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
Unique DOF label. |
required |
mass
|
float
|
Positive lumped mass. |
required |
to
|
str
|
|
'ground'
|
stiffness
|
float
|
Positive connection stiffness. |
required |
damping
|
float
|
Non-negative connection damping. |
0.0
|
Returns:
| Type | Description |
|---|---|
Self
|
This system, enabling chained calls during configuration. |
Source code in src/dynaresp/systems/mdof.py
matrices ¶
Return independent mass, damping, and stiffness matrix copies.
Source code in src/dynaresp/systems/mdof.py
modal_analysis ¶
Solve all modes, requiring positions [0, ..., ndof - 1].
Source code in src/dynaresp/systems/mdof.py
observation_vector ¶
Return a one-hot selector for an integer DOF index.
Source code in src/dynaresp/systems/mdof.py
to_config ¶
Return matrices, labels, and any attachment topology as plain data.
Source code in src/dynaresp/systems/mdof.py
ShearBuilding ¶
Bases: MDOFSystem
Shear-building chain assembled from story masses and stiffnesses.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
masses
|
ArrayLike
|
Positive story masses ordered from the grounded story upward. |
required |
stiffnesses
|
ArrayLike
|
Positive story stiffnesses in the same order. The first connects story one to ground; each later value connects adjacent stories. |
required |
damping_ratio
|
float
|
Non-negative modal damping ratio used for every mode. |
0.02
|
labels
|
Sequence[str] | None
|
Optional label for each story DOF. |
None
|
Source code in src/dynaresp/systems/mdof.py
to_config ¶
Return the story-level definition as JSON-compatible data.
Source code in src/dynaresp/systems/mdof.py
Finite-element beam¶
Beam ¶
Beam(
*,
length,
young_modulus=None,
density=None,
area=None,
second_moment=None,
material=None,
section=None,
damping_ratio=0.02,
n_elements=20,
n_modes=8,
stiffness_reductions=None,
)
Bases: StructuralSystem
Uniform simply supported Euler-Bernoulli beam in modal coordinates.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
length
|
float
|
Beam span in the caller's length unit. |
required |
young_modulus
|
float | None
|
Elastic modulus. May override a material preset. |
None
|
density
|
float | None
|
Mass density. May override a material preset. |
None
|
area
|
float | None
|
Cross-sectional area. May override a section preset. |
None
|
second_moment
|
float | None
|
Cross-sectional second moment of area. May override a section preset. |
None
|
material
|
str | None
|
Optional |
None
|
section
|
tuple[object, ...] | None
|
Optional |
None
|
damping_ratio
|
float
|
Modal viscous damping ratio applied to every retained mode. |
0.02
|
n_elements
|
int
|
Number of equal-length bending elements in the internal finite-element mesh. |
20
|
n_modes
|
int
|
Number of mass-normalized modes retained by the solver. |
8
|
stiffness_reductions
|
Mapping[int, float] | None
|
Fractional bending-stiffness loss by zero-based
element index; values must satisfy |
None
|
Notes
The internal mesh is independent of the public positions axis used
for loads, sensors, and reported mode shapes. Configuration is locked
after construction so cached matrices cannot become stale.
Source code in src/dynaresp/systems/beam.py
stiffness_reductions
property
¶
Fractional stiffness reduction keyed by zero-based element index.
natural_frequencies
property
¶
Retained natural frequencies in hertz, ordered from low to high.
matrices ¶
Return diagonal modal (M, C, K) matrices.
Mass-normalized modes give an identity mass matrix; damping and stiffness are diagonal in the retained modal basis.
Source code in src/dynaresp/systems/beam.py
observation_vector ¶
Map a coordinate on [0, length] to retained modal coordinates.
Source code in src/dynaresp/systems/beam.py
force_vector ¶
Map a point load, returning zero while a trajectory is off-span.
Fixed point loads use the stricter :meth:observation_vector; the
simulation engine uses this method only for moving components that may
legitimately enter and leave the beam.
Source code in src/dynaresp/systems/beam.py
modal_analysis ¶
Evaluate retained physical displacement modes at beam coordinates.
Source code in src/dynaresp/systems/beam.py
to_config ¶
Return the resolved physical and discretization configuration.