Defined as:
sdynpy.core.sdynpy_system.SystemModule:
sdynpy.core.sdynpy_systemSource: GitHub
Signature¶
class sdynpy.System(coordinate: sdynpy.core.sdynpy_coordinate.CoordinateArray, mass, stiffness, damping=None, transformation=None, enforce_symmetry=True)Matrix Equations representing a Structural Dynamics System
Attributes¶
| Name | Summary |
|---|---|
C | Get or set the damping matrix of the system |
coordinate | Get or set the degrees of freedom in the system |
damping | Get or set the damping matrix of the system |
K | Get or set the stffness matrix of the system |
M | Get or set the mass matrix of the system |
mass | Get or set the mass matrix of the system |
massive_dofs | |
massless_dofs | Gets the massless degrees of freedom in the system |
ndof | Get the number of internal degrees of freedom of the system |
ndof_transformed | Get the number of physical degrees of freedom of the system |
stiffness | Get or set the stffness matrix of the system |
transformation | Get or set the transformation matrix |
C¶
Get or set the damping matrix of the system
coordinate¶
Get or set the degrees of freedom in the system
damping¶
Get or set the damping matrix of the system
K¶
Get or set the stffness matrix of the system
M¶
Get or set the mass matrix of the system
mass¶
Get or set the mass matrix of the system
massive_dofs¶
massless_dofs¶
Gets the massless degrees of freedom in the system
ndof¶
Get the number of internal degrees of freedom of the system
ndof_transformed¶
Get the number of physical degrees of freedom of the system
stiffness¶
Get or set the stffness matrix of the system
transformation¶
Get or set the transformation matrix
Methods¶
| Name | Summary |
|---|---|
__init__ | Create a system representation including mass, stiffness, damping, and transformation matrices. |
assign_modal_damping | Assigns a damping matrix to the system that results in equivalent modal damping |
beam | Create a beam mass and stiffness matrix |
concatenate | Combine multiple systems together |
constrain | Apply a constraint matrix to the system |
copy | Returns a copy of the system object |
eigensolution | Computes the eigensolution of the system |
frequency_response | Computes frequency response functions at the specified frequency lines. |
from_exodus_superelement | Creates a system from a superelement from Sierra/SD |
from_sierra_sd_mfile_output | Generates a System object from the MFILE, MAA, and KAA outputs from Sierra/SD |
get_indices_by_coordinate | Gets the indices in the transformation matrix corresponding coordinates |
load | Load a system from a file |
reduce | Apply the specified reduction to the model |
reduce_craig_bampton | Computes a craig-bampton substructure model for the system |
reduce_dynamic | Perform Dynamic condensation |
reduce_guyan | Perform Guyan reduction on the system |
remove_transformation | |
save | Saves the system to a file |
set_proportional_damping | Sets the damping matrix to a proportion of the mass and stiffness matrices. |
simulate_test | |
spy | Plot the structure of the system’s matrices |
substructure_by_coordinate | Constrain the system by connecting the specified degree of freedom pairs |
substructure_by_position | Applies constraints to systems by constraining colocated nodes together |
substructure_by_shape | Constrain the system using a set of shapes in a least-squares sense. |
substructure_shakers | Uses substructuring to attach 4DoF Shaker Models to the Substructure |
time_integrate | Integrate a system to produce responses to an excitation |
to_state_space | Creates state space matrices A, B, C, and D from a SDynPy System object |
transformation_matrix_at_coordinates | Return the transformation matrix at the specified coordinates |
transformation_shapes |
__init__¶
Source: GitHub
def sdynpy.System.__init__(self, coordinate: sdynpy.core.sdynpy_coordinate.CoordinateArray, mass, stiffness, damping=None, transformation=None, enforce_symmetry=True)Create a system representation including mass, stiffness, damping, and transformation matrices.
Parameters¶
coordinate : CoordinateArray Physical degrees of freedom in the system.
mass : np.ndarray 2D array consisting of the mass matrix of the system
stiffness : np.ndarray 2D array consisting of the stiffness matrix of the system
damping : np.ndarray, optional 2D array consisting of the damping matrix of the system. If not specified, the damping will be zero.
transformation : np.ndarray, optional A transformation between internal “state” degrees of freedom and the physical degrees of freedom defined in
coordinate. The default transformation is the identity matrix.enforce_symmetry : bool, optional If True, raise a ValueError if the matrices provided are not symmetric.
Returns¶
None.
Raises¶
ValueError
If inputs are improperly sized
assign_modal_damping¶
Source: GitHub
def sdynpy.System.assign_modal_damping(self, damping_ratios)Assigns a damping matrix to the system that results in equivalent modal damping
Parameters¶
damping_ratios : ndarray An array of damping values to assign to the system
Returns¶
None.
beam¶
Source: GitHub
def sdynpy.System.beam(cls, length, width, height, num_nodes, E=None, rho=None, nu=None, material=None)Create a beam mass and stiffness matrix
Parameters¶
length : float Lenghth of the beam
width : float Width of the beam
height : float Height of the beam
num_nodes : int Number of nodes in the beam.
E : float, optional Young’s modulus of the beam. If not specified, a
materialmust be specified insteadrho : float, optional Density of the beam. If not specified, a
materialmust be specified insteadnu : float, optional Poisson’s ratio of the beam. If not specified, a
materialmust be specified insteadmaterial : str, optional A specific material can be specified instead of
E,rho, andnu. Should be a string ‘steel’ or ‘aluminum’. If not specified, then optionsE,rho, andnumust be specified instead.
Returns¶
system : System A system object consisting of the beam mass and stiffness matrices.
geometry : Geometry A Geometry consisting of the beam geometry.
Raises¶
ValueError
If improper materials are defined.
concatenate¶
Source: GitHub
def sdynpy.System.concatenate(cls, systems, coordinate_node_offset=0)Combine multiple systems together
Parameters¶
systems : iterable of System objects Iterable of Systems that will be concatenated. Matrices will be assembled in block diagonal format
coordinate_node_offset : int, optional Offset applied to the coordinates so the nodes do not overlap. The default is 0.
Returns¶
System
A system consisting of the combintation of the provided systems.
constrain¶
Source: GitHub
def sdynpy.System.constrain(self, constraint_matrix, rcond=None)Apply a constraint matrix to the system
Parameters¶
constraint_matrix : np.ndarray A matrix of constraints to apply to the structure (B matrix in substructuring literature)
rcond : float, optional Condition tolerance for computing the nullspace. The default is None.
Returns¶
System
Constrained system.
copy¶
Source: GitHub
def sdynpy.System.copy(self)Returns a copy of the system object
Returns¶
System
A copy of the system object
eigensolution¶
Source: GitHub
def sdynpy.System.eigensolution(self, num_modes=None, maximum_frequency=None, complex_modes=False, return_shape=True)Computes the eigensolution of the system
Parameters¶
num_modes : int, optional The number of modes of the system to compute. The default is to compute all the modes.
maximum_frequency : float, optional The maximum frequency to which modes will be computed. The default is to compute all the modes.
complex_modes : bool, optional Whether or not complex modes are computed. The default is False.
return_shape : bool, optional Specifies whether or not to return a
ShapeArray(True) or a reducedSystem(False). The default is True.
Returns¶
System or ShapeArray
If
return_shapeis True, the a ShapeArray will be returned. Ifreturn_shapeis False, a reduced system will be returned.
Raises¶
NotImplementedError
Raised if complex modes are specified.
frequency_response¶
Source: GitHub
def sdynpy.System.frequency_response(self, frequencies, responses=None, references=None, displacement_derivative=0)Computes frequency response functions at the specified frequency lines.
Parameters¶
frequencies : ndarray A 1D array of frequencies.
responses : CoordinateArray, optional A set of coordinates to compute responses. The default is to create responses at all coordinates.
references : CoordinateArray, optional A set of coordinates to use as inputs. The default is to use all coordinates as inputs.
displacement_derivative : int, optional The number of derivatives to apply to the response. The default is 0, which corresponds to displacement. 1 would be the first derivative, velocity, and 2 would be the second derivative, acceleration.
Returns¶
frf : TransferFunctionArray A TransferFunctionArray containing the frequency response function for the system at the specified input and output degrees of freedom.
from_exodus_superelement¶
Source: GitHub
def sdynpy.System.from_exodus_superelement(cls, superelement_nc4, transformation_exodus_file=None, x_disp='DispX', y_disp='DispY', z_disp='DispZ', x_rot=None, y_rot=None, z_rot=None, reduce_to_external_surfaces=False)Creates a system from a superelement from Sierra/SD
Parameters¶
superelement_nc4 : netCDF4.Dataset or string Dataset from which the superelement data will be loaded
transformation_exodus_file : Exodus, ExodusInMemory, or str, optional Exodus data containing the transformation between the reduced superelement state and the physical space. If not specified, no transformation will be created.
x_disp : str, optional Variable name to read for x-displacements in the transformation Exodus file. The default is ‘DispX’.
y_disp : str, optional Variable name to read for y-displacements in the transformation Exodus file. The default is ‘DispY’.
z_disp : str, optional Variable name to read for z-displacements in the transformation Exodus file. The default is ‘DispZ’.
x_rot : str, optional Variable name to read for x-rotations in the transformation Exodus file. The default is to not read rotations.
y_rot : str, optional Variable name to read for y-rotations in the transformation Exodus file. The default is to not read rotations.
z_rot : str, optional Variable name to read for z-rotations in the transformation Exodus file. The default is to not read rotations.
reduce_to_external_surfaces : bool, optional If True, exodus results will be reduced to external surfaces
Returns¶
system : System System containing the superelement representation
geometry : Geometry Geometry that can be used to plot the system
boundary_dofs : CoordinateArray Degrees of freedom that can be used to constrain the test article.
Raises¶
ValueError
raised if bad data types are passed to the arguments.
from_sierra_sd_mfile_output¶
Source: GitHub
def sdynpy.System.from_sierra_sd_mfile_output(cls, maa_file, kaa_file, gid_file, aset_map_file)Generates a System object from the MFILE, MAA, and KAA outputs from Sierra/SD
Parameters¶
maa_file : str Path to the file containing the MAA matrix.
kaa_file : str Path to the file containing the KAA matrix.
gid_file : str Path to the file contiaining the global node id map
aset_map_file : str Path to the A-set Map.
Returns¶
system : System A system object with the specified matrices and degrees of freedom.
get_indices_by_coordinate¶
Source: GitHub
def sdynpy.System.get_indices_by_coordinate(self, coordinates, ignore_sign=False)Gets the indices in the transformation matrix corresponding coordinates
Parameters¶
coordinates : CoordinateArray Coordinates to extract transformation indices
ignore_sign : bool, optional Specify whether or not to ignore signs on the coordinates. If True, then ‘101X+’ would match ‘101X+’ or ‘101X-’. The default is False.
Returns¶
np.ndarray
Array of indices.
Raises¶
ValueError
Raised if duplicate coordinates or coordinates not in the system
are requested
load¶
Source: GitHub
def sdynpy.System.load(cls, filename)Load a system from a file
Parameters¶
filename : str Name of the file from which the system will be loaded.
Returns¶
System
A system consisting of the mass, stiffness, damping, and transformation
in the file
reduce¶
Source: GitHub
def sdynpy.System.reduce(self, reduction_transformation)Apply the specified reduction to the model
Parameters¶
reduction_transformation : np.ndarray Matrix to use in the reduction
Returns¶
System
Reduced system.
reduce_craig_bampton¶
Source: GitHub
def sdynpy.System.reduce_craig_bampton(self, connection_degrees_of_freedom: sdynpy.core.sdynpy_coordinate.CoordinateArray, num_fixed_base_modes: int, return_shape_matrix: bool = False)Computes a craig-bampton substructure model for the system
Parameters¶
connection_degrees_of_freedom : CoordinateArray Degrees of freedom to keep at the interface.
num_fixed_base_modes : int Number of fixed-base modes to use in the reduction
return_shape_matrix : bool, optional If true, return a set of shapes that represents the transformation in addition to the reduced system. The default is False.
Returns¶
System
Reduced system in craig-bampton form
ShapeArray
Shapes representing the craig-bampton transformation
Raises¶
ValueError
Raised if coordinate arrays are specified when there is already a
transformation.
reduce_dynamic¶
Source: GitHub
def sdynpy.System.reduce_dynamic(self, coordinates, frequency)Perform Dynamic condensation
Parameters¶
coordinates : CoordinateArray A list of coordinates to keep in the reduced system.
frequency : float The frequency to preserve in the dynamic reduction.
Returns¶
System
Reduced system.
Raises¶
ValueError
Raised if the transformation is not identity matrix.
reduce_guyan¶
Source: GitHub
def sdynpy.System.reduce_guyan(self, coordinates)Perform Guyan reduction on the system
Parameters¶
coordinates : CoordinateArray A list of coordinates to keep in the reduced system.
Returns¶
System
Reduced system.
Raises¶
ValueError
Raised the transformation matrix is not identity matrix.
remove_transformation¶
Source: GitHub
def sdynpy.System.remove_transformation(self)save¶
Source: GitHub
def sdynpy.System.save(self, filename)Saves the system to a file
Parameters¶
filename : str Name of the file in which the system will be saved.
Returns¶
None.
set_proportional_damping¶
Source: GitHub
def sdynpy.System.set_proportional_damping(self, mass_fraction, stiffness_fraction)Sets the damping matrix to a proportion of the mass and stiffness matrices.
The damping matrix will be set to mass_fraction*self.mass + stiffness_fraction*self.stiffness
Parameters¶
mass_fraction : float Fraction of the mass matrix
stiffness_fraction : TYPE Fraction of the stiffness matrix
Returns¶
None.
simulate_test¶
Source: GitHub
def sdynpy.System.simulate_test(self, bandwidth, frame_length, num_averages, excitation, references, responses=None, excitation_level=1.0, excitation_noise_level=0.0, response_noise_level=0.0, steady_state_time=0.0, excitation_min_frequency=None, excitation_max_frequency=None, signal_fraction=0.5, extra_time_between_frames=0.0, integration_oversample=10, antialias_filter_cutoff_factor=3, antialias_filter_order=4, multihammer_impact_spacing_factor=4, extra_outputs=None, **generator_kwargs)spy¶
Source: GitHub
def sdynpy.System.spy(self, subplots_kwargs={'figsize': (10, 3)}, spy_kwargs={})Plot the structure of the system’s matrices
Parameters¶
subplots_kwargs : dict, optional Default arguments passed to
matplotlib.pyplot’ssubplotsfunction. The default is {‘figsize’:(10,3)}.spy_kwargs : dict, optional Default arguments passed to
matplotlib.pyplot’s ‘spy’ function. The default is {}.
Returns¶
ax : Axes Axes on which the subplots are defined.
substructure_by_coordinate¶
Source: GitHub
def sdynpy.System.substructure_by_coordinate(self, dof_pairs, rcond=None, return_constrained_system=True)Constrain the system by connecting the specified degree of freedom pairs
Parameters¶
dof_pairs : iterable of CoordinateArray Pairs of coordinates to be connected. None can be passed instead of a second degree of freedom to constrain to ground
rcond : float, optional Condition threshold to use for the nullspace calculation on the constraint matrix. The default is None.
return_constrained_system : bool, optional If true, apply the constraint matrix and return the constrained system, otherwise simply return the constraint matrix. The default is True.
Returns¶
np.ndarray or System
Returns a System object with the constraints applied if
return_constrained_systemis True, otherwise just return theconstraint matrix.
substructure_by_position¶
Source: GitHub
def sdynpy.System.substructure_by_position(cls, systems, geometries, distance_threshold=1e-08, rcond=None)Applies constraints to systems by constraining colocated nodes together
Parameters¶
systems : iterable of System objects A set of systems that will be combined and constrained together
geometries : iterable of Geometry objects A set of geometries that will be combined together
distance_threshold : float, optional The distance between nodes that are considered colocated. The default is 1e-8.
rcond : float, optional Condition number to use in the nullspace calculation on the constraint matrix. The default is None.
Returns¶
combined_system : System System consisting of constraining the input systems together.
combined_geometry : Geometry Combined geometry of the new system
substructure_by_shape¶
Source: GitHub
def sdynpy.System.substructure_by_shape(self, constraint_shapes, connection_dofs_0, connection_dofs_1=None, rcond=None, return_constrained_system=True)Constrain the system using a set of shapes in a least-squares sense.
Parameters¶
constraint_shapes : ShapeArray An array of shapes to use as the basis for the constraints
connection_dofs_0 : CoordinateArray Array of coordinates to use in the constraints
connection_dofs_1 : CoordinateArray, optional Array of coordinates to constrain to the coordinates in
connection_dofs_0. If not specified, theconnection_dofs_0degrees of freedom will be constrained to ground.rcond : float, optional Condition threshold on the nullspace calculation. The default is None.
return_constrained_system : bool, optional If true, apply the constraint matrix and return the constrained system, otherwise simply return the constraint matrix. The default is True.
Returns¶
np.ndarray or System
Returns a System object with the constraints applied if
return_constrained_systemis True, otherwise just return theconstraint matrix.
substructure_shakers¶
Source: GitHub
def sdynpy.System.substructure_shakers(self, shakers, coordinates)Uses substructuring to attach 4DoF Shaker Models to the Substructure
Parameters¶
shakers : array of Shaker4DoF 4-DoF electromechanical models of a shaker that are added to the System
coordinates : CoordinateArray The degrees of freedom at which the shakers should be attached.
Returns¶
System
A system with shakers attached to it. The shaker degrees of freedom
will be assigned based on the next power of 10 bigger than the
current maximum node number. Degrees of freedom end in 1 for
armature force/displacement, 2 for body force/displacement, 3 for
force gauge force/displacement, and 4 for drive voltage/current
time_integrate¶
Source: GitHub
def sdynpy.System.time_integrate(self, forces, responses=None, initial_state=None, integration_oversample=1, extra_outputs=None)Integrate a system to produce responses to an excitation
Parameters¶
forces : TimeHistoryArray The forces applied to the system, which should be a
TimeHistoryArray. The time step and excitation degrees of freedom will be taken from theTimeHistoryArrayresponses : dict, optional A dictionary with keys 0, 1, and 2 representing the displacement derivative and CoordinateArray values representing the degrees of freedom desired at that degree of freedom. For example, a dictionary {0:sdpy.coordinate_array([101,102],[‘X+’,‘X+’]), 2:sdpy.coordinate_array([203,204],[‘X+’,‘Y+’])} would give displacement results at 101X+ and 102X+ and acceleration results at 203X+ and 204Y+. The value of None can also be supplied to get all degrees of freedom at that derivative. For example, {2:None} would get acceleration results at all degrees of freedom in the System. If not specified, the output will be given for displacement, velocity, and acceleration, for all degrees of freedom. Rows of the output vector will be ordered first by derivative order then by degree of freedom order, so all displacements come before all velocities, and those before all accelerations.
initial_state : np.ndarray, optional The initial conditions of the integration. The default is zero displacement and zero velocity.
integration_oversample : int The amount of oversampling that will be applied to the force by zero-padding the fft. It is generally better to create the forces such that they are oversampled than to use this argument.
extra_outputs : dict A dictionary containing data to allow additional outputs to be obtained from the state space formulation. The dictionary must have keys ‘C’, ‘D’, and ‘coordinate’. Values for ‘C’ and ‘D’ must contain NumPy ndarray objects that will be concatenated with the C and D matrices. See the documentation for
to_state_spacefor more information on these keys. Additionally, the values of the ‘coordinate’ key must contain a CoordinateArray object with the same size as the number of rows of C and D. These will be assigned as the coordinates of the extra signals in the outputted TimeHistoryArray.
Returns¶
response_array : TimeHistoryArray The responses of the system to the forces applied
to_state_space¶
Source: GitHub
def sdynpy.System.to_state_space(self, response_coordinates=None, excitation_coordinates=None, output_excitation_signals=True, extra_outputs=None)Creates state space matrices A, B, C, and D from a SDynPy System object
Parameters¶
response_coordinates : dict, optional A dictionary with keys 0, 1, and 2 representing the displacement derivative and CoordinateArray values representing the degrees of freedom desired at that degree of freedom. For example, a dictionary {0:sdpy.coordinate_array([101,102],[‘X+’,‘X+’]), 2:sdpy.coordinate_array([203,204],[‘X+’,‘Y+’])} would give displacement results at 101X+ and 102X+ and acceleration results at 203X+ and 204Y+. The value of None can also be supplied to get all degrees of freedom at that derivative. For example, {2:None} would get acceleration results at all degrees of freedom in the System. If not specified, the output will be given for displacement, velocity, and acceleration, for all degrees of freedom. Rows of the output vector will be ordered first by derivative order then by degree of freedom order, so all displacements come before all velocities, and those before all accelerations.
excitation_coordinates : CoordinateArray, optional The degrees of freedom to use as inputs in the state and output equations. The default is to provide inputs at all degrees of freedom.
output_excitation_signals : bool, optional If True, the inputs to the system will be passed through and output as part of the output matrices C and D. The default is True. These will be in the last rows of C and D, one for each of the excitation degrees of freedom.
extra_outputs : dict A dictionary containing data to allow additional outputs to be obtained from the state space formulation. The dictionary must have keys ‘C’ and ‘D’. These must contain NumPy ndarray objects that will be concatenated with the C and D matrices. Both matrices should have number of rows equal to the number of extra outputs requested. The number of columns of C should be equal to the number of states (2x number of massive degrees of freedom + 1x number of massless degrees of freedom). States are ordered displacements of massive degrees of freedom, velocities of massive degrees of freedom, displacements of massless degrees of freedom. Within each group, they will be ordered in the same order as the system matrices (not the transformation matrix). The number of columns of the D matrix should be equivalent to the number of excitation coordinates provided.
Returns¶
A : ndarray The state matrix. States are ordered displacements of massive degrees of freedom, velocities of massive degrees of freedom, displacements of massless degrees of freedom. Within each group, they will be ordered in the same order as the system matrices (not the transformation matrix).
B : ndarray The input matrix. Inputs are in the same order as the excitation_coordinate argument. States are in the order as described for the A return value.
C : ndarray The output matrix. States are in the order as described for the A return value. Outputs are ordered as follows: displacement responses, velocity responses, acceleration responses, excitation signals, extra outputs. Within each group, the coordinates are ordered the same way as the provided response_coordinate and excitation_coordinate arguments.
D : ndarray The feedforward matrix. Input order is described in the return value for B. Output order is described in the return value for C.
transformation_matrix_at_coordinates¶
Source: GitHub
def sdynpy.System.transformation_matrix_at_coordinates(self, coordinates)Return the transformation matrix at the specified coordinates
Parameters¶
coordinates : CoordinateArray coordinates at which the transformation matrix will be computed.
Returns¶
return_value : np.ndarray Portion of the transformation matrix corresponding to the coordinates input to the function.
Raises¶
ValueError
Raised if duplicate coordinates are requested, or if coordinates that
do not exist in the system are requested.
transformation_shapes¶
Source: GitHub
def sdynpy.System.transformation_shapes(self, shape_indices=None)