Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

sdynpy.ShapeArray

Signature

class sdynpy.ShapeArray(shape, ndof, shape_type='real', buffer=None, offset=0, strides=None, order=None)

Shape information specifying displacements at nodes.

Use the shape_array helper function to create the array.

Attributes

NameSummary
modeshapeThe mode shape matrix with degrees of freedom as second to last axis
ndofThe number of degrees of freedom in the shape

modeshape

The mode shape matrix with degrees of freedom as second to last axis

ndof

The number of degrees of freedom in the shape

Methods

NameSummary
complex_data_dtypeData type of the underlying numpy structured array for complex shapes
compute_frfComputes FRFs from shape data
concatenate_dofsCombines the degrees of freedom from multiple shapes into one set of shapes
edit_commentsOpens up a table where the shape comments can be edited
expandPerform SEREP expansion on shape data
from_exodusReads shape data from displacements in an Exodus file
from_imat_structConstructs a ShapeArray from an imat_shp class saved to a Matlab structure
from_uffLoad ShapeArrays from universal file data from read_unv
from_unvLoad ShapeArrays from universal file data from read_unv
is_complexReturns true if the shape is a complex shape, False if shape is real
macComputes the modal assurance criterion matrix of the shapes
mode_tableGenerates a table of modal information including frequency and damping
normalizeComputes A-normalized or mass-normalized shapes
optimize_degrees_of_freedomCreates a reduced set of shapes using optimal degrees of freedom
overlay_shapesCombines several shapes and geometries for comparitive visualization
plot_frequencyPlots the frequencies of the shapes on curves of a 2D plot
plot_macPlots the mac matrix of the shapes
real_data_dtypeData type of the underlying numpy structured array for real shapes
reduceReduces the shape to the degrees of freedom specified
reduce_for_comparison
repackCreates new shapes by linearly combining existing shapes
shape_alignmentComputes if the shapes are aligned, or if one needs to be flipped
systemCreate system matrices from the shapes
to_complexCreates complex shapes from real shapes
to_realCreates real shapes from complex shapes by collapsing the complexity
transform_coordinate_systemPerforms coordinate system transformations on the shape
transformation_matrixCreates a transformation matrix that describes a transformation from a physical coordinate array into modal space using the provided mode shapes.
write_to_unvWrites shape data to a unverisal file

complex_data_dtype

def sdynpy.ShapeArray.complex_data_dtype(ndof)

Data type of the underlying numpy structured array for complex shapes

Parameters

Returns

compute_frf

def sdynpy.ShapeArray.compute_frf(self, frequencies, responses=None, references=None, displacement_derivative=2)

Computes FRFs from shape data

Parameters

Returns

concatenate_dofs

def sdynpy.ShapeArray.concatenate_dofs(shape_arrays)

Combines the degrees of freedom from multiple shapes into one set of shapes

Parameters

Returns

edit_comments

def sdynpy.ShapeArray.edit_comments(self, geometry=None)

Opens up a table where the shape comments can be edited

If a geometry is also passed, it will also open up a mode shape plotter window where you can visualize the modes you are looking at.

Edited comments will be stored back into the ShapeArray object when the OK button is pressed. Comments will not be stored if the Cancel button is pressed.

Parameters

Returns

Notes

Due to how Python handles garbage collection, the table may be immediately closed if not assigned to a variable, as Python things it is no longer in use.

expand

def sdynpy.ShapeArray.expand(self, initial_geometry, expansion_geometry, expansion_shapes, node_id_map=None, expansion_coordinates=None, return_coefficients=False)

Perform SEREP expansion on shape data

Parameters

Returns

from_exodus

def sdynpy.ShapeArray.from_exodus(cls, exo, x_disp='DispX', y_disp='DispY', z_disp='DispZ', x_rot=None, y_rot=None, z_rot=None, timesteps=None)

Reads shape data from displacements in an Exodus file

Parameters

Returns

from_imat_struct

def sdynpy.ShapeArray.from_imat_struct(cls, imat_shp_struct)

Constructs a ShapeArray from an imat_shp class saved to a Matlab structure

In IMAT, a structure can be created from an imat_shp by using the get() function. This can then be saved to a .mat file and loaded using scipy.io.loadmat. The output from loadmat can be passed into this function

Parameters

Returns

from_uff

def sdynpy.ShapeArray.from_uff(unv_data_dict, combine=True)

Load ShapeArrays from universal file data from read_unv

Parameters

Returns

Raises

from_unv

def sdynpy.ShapeArray.from_unv(unv_data_dict, combine=True)

Load ShapeArrays from universal file data from read_unv

Parameters

Returns

Raises

is_complex

def sdynpy.ShapeArray.is_complex(self)

Returns true if the shape is a complex shape, False if shape is real

Returns

mac

def sdynpy.ShapeArray.mac(self)

Computes the modal assurance criterion matrix of the shapes

Returns

mode_table

def sdynpy.ShapeArray.mode_table(self, table_format='csv', frequency_format='{:0.2f}', damping_format='{:0.2f}%')

Generates a table of modal information including frequency and damping

Parameters

Returns

Raises

normalize

def sdynpy.ShapeArray.normalize(self, system_or_matrix, return_modal_matrix=False)

Computes A-normalized or mass-normalized shapes

Parameters

Returns

optimize_degrees_of_freedom

def sdynpy.ShapeArray.optimize_degrees_of_freedom(self, sensors_to_keep, group_by_node=False, method='ei')

Creates a reduced set of shapes using optimal degrees of freedom

Parameters

Returns

overlay_shapes

def sdynpy.ShapeArray.overlay_shapes(geometries, shapes, color_override=None)

Combines several shapes and geometries for comparitive visualization

Parameters

Returns

plot_frequency

def sdynpy.ShapeArray.plot_frequency(self, interp_abscissa, interp_ordinate, ax=None, plot_kwargs={'color': 'k', 'marker': 'x', 'linestyle': 'None'})

Plots the frequencies of the shapes on curves of a 2D plot

Parameters

Returns

plot_mac

def sdynpy.ShapeArray.plot_mac(self, *args, **kwargs)

Plots the mac matrix of the shapes

real_data_dtype

def sdynpy.ShapeArray.real_data_dtype(ndof)

Data type of the underlying numpy structured array for real shapes

Parameters

Returns

reduce

def sdynpy.ShapeArray.reduce(self, nodelist_or_coordinate_array)

Reduces the shape to the degrees of freedom specified

Parameters

Returns

reduce_for_comparison

def sdynpy.ShapeArray.reduce_for_comparison(self, comparison_shape, node_id_map=None)

repack

def sdynpy.ShapeArray.repack(self, coefficients)

Creates new shapes by linearly combining existing shapes

Parameters

Returns

shape_alignment

def sdynpy.ShapeArray.shape_alignment(shape_1, shape_2, node_id_map=None)

Computes if the shapes are aligned, or if one needs to be flipped

Parameters

Returns

system

def sdynpy.ShapeArray.system(self)

Create system matrices from the shapes

This will create a System object with modal mass, stiffness, and damping matrices, with the mode shape matrix as the transformation to physical coordinates

Returns

Raises

to_complex

def sdynpy.ShapeArray.to_complex(self)

Creates complex shapes from real shapes

Returns

to_real

def sdynpy.ShapeArray.to_real(self, force_angle=-0.7853981633974483, **kwargs)

Creates real shapes from complex shapes by collapsing the complexity

Parameters

Returns

transform_coordinate_system

def sdynpy.ShapeArray.transform_coordinate_system(self, original_geometry, new_geometry, node_id_map=None, rotations=False, missing_dofs_are_zero=False)

Performs coordinate system transformations on the shape

Parameters

Returns

transformation_matrix

def sdynpy.ShapeArray.transformation_matrix(self, physical_coordinates, inversion=True, normalized=True)

Creates a transformation matrix that describes a transformation from a physical coordinate array into modal space using the provided mode shapes.

Parameters

Returns

Notes

The transformation automatically handles polarity differences in the geometry and force_coordinate.

The returned transformation matrix is intended to be used as an output transformation matrix for MIMO vibration control.

write_to_unv

def sdynpy.ShapeArray.write_to_unv(self, filename, specific_data_type=12, load_case_number=0)

Writes shape data to a unverisal file

Parameters

Returns

Raises