2dof_funcs module

class np_vmd.tdof_MCK.MDOFFreeResponse(mdof_sys: TDOF_modal)

Bases: object

calc_x_hom_response(ts)

returns the numerical values for the homogenous part of the response (transient) uses rfs in order to create the numerical response results

set_iv(x0s: None, dx0s=None)

Set the initial values for the system.

Parameters: x0s (None or array-like): Initial displacements for each degree of freedom. dx0s (None or array-like): Initial velocities for each degree of freedom.

class np_vmd.tdof_MCK.MdofForcedResponseSingleExcitation(mdof_sys: TDOF_modal, node: int, Fmag: float, w_exc_radps: float, phi_exc_rad: float = 0)

Bases: object

Represents a multi-degree-of-freedom (MDOF) system with a single excitation.

# TODO rename to MdofForcedResponseSingleExcitation

mdof_sys

The MDOF system.

Type:

TDOF_modal

_excitation_node

The node at which the excitation is applied.

Type:

int

_force_mag_N

The magnitude of the excitation force.

Type:

float

_w_exc_radps

The angular frequency of the excitation in radians per second.

Type:

float

_phi_exc_rad

The phase angle of the excitation in radians.

Type:

float

__init__(mdof_sys, node, Fmag, w_exc_radps, phi_exc_rad=0)

Initializes the MDOFResponse1Excitation object.

set_iv(x0s, dx0s)

Sets the initial conditions of the system.

calc_response()

Calculates the response of the MDOF system.

get_ith_orig_response_params(i, form='AB')

Returns the response parameters for the ith original degree of freedom.

ith_modal_response(i, update=False)

Prints the information for the ith modal coordinate.

print_all_modal_responses(update=False)

Prints the information for each modal coordinate.

ith_modal_response_str(j, update=False)

Returns the response parameters as a string for the jth modal coordinate.

jth_response_func(j, update=False)

Returns the response function for the jth modal coordinate.

calc_response()

Calculates the response of the MDOF system.

property dofs: int
get_ith_orig_response_params(i: int, form: str = 'AB') dict

Returns the response parameters for the ith original degree of freedom.

Parameters:
  • i (int) – The index of the original degree of freedom.

  • form (str, optional) – The form of the response parameters. Defaults to “AB”.

Returns:

The response parameters.

Return type:

dict

ith_modal_response(i: int, update: bool = False) str

Prints the information for the ith modal coordinate.

Parameters:
  • i (int) – The index of the modal coordinate.

  • update (bool, optional) – Whether to update the response calculation. Defaults to False.

Returns:

The information for the ith modal coordinate.

Return type:

str

ith_modal_response_str(j: int, update: bool = False) str

Returns the response parameters as a string for the jth modal coordinate.

Parameters:
  • j (int) – The index of the modal coordinate.

  • update (bool, optional) – Whether to update the response calculation. Defaults to False.

Returns:

The response parameters as a string.

Return type:

str

jth_response_func(j: int, update: bool = False) str

Returns the response function for the jth modal coordinate.

Parameters:
  • j (int) – The index of the modal coordinate.

  • update (bool, optional) – Whether to update the response calculation. Defaults to False.

Returns:

The response function.

Return type:

str

print_all_modal_responses(update: bool = False)

Prints the information for each modal coordinate.

Parameters:

update (bool, optional) – Whether to update the response calculation. Defaults to False.

set_iv(x0s: None, dx0s=None)

This functions sets the parameters for the initial conditions of the system

class np_vmd.tdof_MCK.TDOF_modal(M, K, C=None)

Bases: object

This class is for the calculation of the response of a TDOF system with matrices M, C, K. The class is based on the modal analysis of the system.

calc_C_from_Z(Z=None)

Calculates C matrix from the Z matrix of the principal coordinates decoupled equations

returns a new system with the new C matrix based on the values of the damping factor for the decoupled generalised coordinates Z

TODO: Add test for calc_C_from_Z

calc_eigenmodes() ndarray

creates eigenmodes in columns

calc_x_hom_response(ts)

returns the numerical values for the homogenous part of the response (transient) uses rfs in order to create the numerical response results

calc_x_ss_response(ts)

Calculates the steady state response of the system (partial solution)

# TODO: not complete need to see how to handle convolution integral This is the function that creates the

calc_x_total_response(ts: ndarray)

Calculates the total response of a mdof system

This is based partially on # https://www.youtube.com/watch?v=sqdd0ja1PXM&t=1s

Requires: - the mass, stiffness and damping matrices - setting the initial conditions - setting the excitation

Parameters:

seconds (ts {ndarray} -- tiume vector in)

Returns:

property dofs: int

returns the number of degrees of freedom of the system

Returns:

number of degrees of freedom

Return type:

int

print_eigenmodes()
print_eigvectors()
print_results()
set_excitation(B=None, F=None, Fparams: list | None = None)

This function sets the excitation parameters. # TODO what is B? Fparams is a list which contain tuples of the form (F_mag_N, w_F_radps, phi_F_rad)

set_iv(x0s: None, dx0s=None)

This functions sets the parameters for the initial conditions of the system

# TODO: what happens when the excitation have an offset.? # In that case in the SDOF, the initial condition should be set to - F/k # consider what happens in the principal coordinates.

to_modal_cs(x0s: ndarray) ndarray

converts initial conditions from original to modal coordinates

$$ [rs] = Smat^{-1} * [x0s]$$

Requires: - x0s: (velocity or displacement) in original coordinates

Returns: - r0s: (velocity or displacement) in modal coordinates

TODO : create tests

to_orig_cs(r0s: ndarray) ndarray

converts from original to modal coordinates

$$ [xs] = Smat* [rs]$$

Requires: - r0s: (velocity or displacement) in modal coordinates

Returns: - x0s: (velocity or displacement) in original coordinates

TODO : create tests

update_damping(zs=None)

sets zs in their decoupled form and recalculates the wds

zs defaults to none which calculates based on the C matrix