pyva.models.VAmodel

class pyva.models.VAmodel(data, xdata, excdof, resdof, sym=1, **kwargs)

Bases: DynamicMatrix

The VAmodel is an extension of the DynamicMatrix class with the additional

The VAmodel (vibroacoustic model) class is used for models that can be represented by one dynamic matrix, for example the stiffness matrix

\left[\bm D \right] \lbrace {\bm u} \rbrace = \lbrace {\bm F} \rbrace

Different loads can by applied. The DOF handling is done by DynamicMatrix class.

results

results due to loads

Type:

dict of Signals

loads

loads

Type:

dict of loads

__init__(data, xdata, excdof, resdof, sym=1, **kwargs)

Constructor of VAmodel class

Parameters:
  • data (ndarray,LinearMatrix or None) – matrix over frequency. In case of None - empty model with zeros is created

  • xdata (DataAxis) – frequency values.

  • excdof (dof) – excitation degrees of freedom.

  • resdof (dof) – response degrees of freedom.

  • sym (int) – Symmetry identifier.

  • **kwargs (dict) – Arbitrary keyword arguments passed to DynamicMatrix constructor.

Return type:

None.

Methods

Dindex(iz)

Provides 2D matrix of in-depth index iz

H()

Hermitian of linear matrix

HDH(other)

HDH performt the left and right matrix multiplication by the inverse of other from left and right in a numerical stable way using solve

__init__(data, xdata, excdof, resdof[, sym])

Constructor of VAmodel class

abs()

Abxolute value of Linear Matrix.

add_load(load)

Adds load to VAmodel

add_result(result)

Adds result to VAmodel

cond([p])

cond of linear matrix

copy()

copy method for LinearMatrix

diag()

Transpose of linear matrix

dot(other)

Dot product method of DynamicMatrix

imag()

inv()

Inverts dynamic matrix

isa(typestr)

Check if self is an insance of typestr

mean()

Calculates the mean value of all coefficients in the matrix

plot([nfig, loadID])

Plot results

power(LID, NID[, boundary])

Calculate powerflow into network

real()

self_dot(other)

Incremental dot product

signal(irow, icol[, exc_val])

create a Signal object from 1-dim parts of the DynamicMatrix

solve(**kwargs)

Solve linear system of equations

spy([res, iz])

Show sparasity of matrix in a graphical way.

sqrt()

square root.

sum()

Calculates the full sum of all coefficients in the matrix

transpose()

Transpose of linear matrix

zeros(xdata, excdof, resdof, sym, **kwargs)

zeros matrix creator with defined dimension and DOFs

Attributes

Ncol

Number of columns

Ndepth

Number of matrices

Nrow

Number of rows

data

data property method

excdof

Property method for excdof

loads

property method for loads

resdof

Property method for resdof

results

property method for results

shape

Shape of LinearMatrix.

sym

Property method for sym

symstr

Property method for symstr

xdata

Property method for xdata

Dindex(iz)

Provides 2D matrix of in-depth index iz

MM.Dindex(iz) == MM.data(:,:,iz)

Parameters:

iz (int) – index in depth.

Returns:

2D matrix.

Return type:

ndarray

H()

Hermitian of linear matrix

HDH(other)

HDH performt the left and right matrix multiplication by the inverse of other from left and right in a numerical stable way using solve

Parameters:

other – NOT inverted matrix D

Returns:

D^-1 . self . D^-H

property Ncol

Number of columns

Returns:

Number of columns.

Return type:

int

property Ndepth

Number of matrices

size of third dimension

Returns:

Number of matrices.

Return type:

int

property Nrow

Number of rows

Returns:

Number of matrix rows.

Return type:

int

abs()

Abxolute value of Linear Matrix.

Returns:

with all absolute value of coefficients.

Return type:

LinearMatrix

add_load(load)

Adds load to VAmodel

Parameters:

load (dict of Load) – excitation load.

Return type:

None.

add_result(result)

Adds result to VAmodel

Method is intended fot internal use, e.g. storing results from solve

Parameters:

load (dict of load) – excitation load.

Return type:

None.

cond(p=None)

cond of linear matrix

copy()

copy method for LinearMatrix

uses deepcopy

Returns:

Deepcopy instance of LinearMatrix instance.

Return type:

Linear Matrix

property data

data property method

The method recreates the 3D data from the efficiently stored 2D data in case of sym in (1,2,3)

Returns:

3D data.

Return type:

ndarray

diag()

Transpose of linear matrix

Returns

dot(other)

Dot product method of DynamicMatrix

This method allows flexible matrix multiplication. If other is a DynamicMatrix the resdof of other must equal the excdof of self. If other is a Signal all DOFs of the Signal vector must occur in the excdof of self.

Parameters:

other (DynamicMatrix, Signal) – factor.

Raises:

ValueError – When xdata or dofs are not consistent.

Returns:

product.

Return type:

DynamicMatrix

property excdof

Property method for excdof

Returns:

excitatin DOFs.

Return type:

DOF

inv()

Inverts dynamic matrix

excitation and response dofs are exchanged

Returns:

inverse(self).

Return type:

DynamicMatrix

isa(typestr)

Check if self is an insance of typestr

Parameters:

typestr (str) – str of classtype.

Returns:

True if typestr = ‘DynamicMatrix’.

Return type:

bool

property loads

property method for loads

Returns:

loads.

Return type:

dict of loads

mean()

Calculates the mean value of all coefficients in the matrix

plot(nfig=1, loadID=1, **kwargs)

Plot results

Parameters:
  • nfig (int, optional) – figure number. The default is 1.

  • loadID (int, optional) – key for load/result to plot. The default is 1.

  • **kwargs – Arbitrary keyword arguments passed to Signal.plot() .

Return type:

None.

power(LID, NID, boundary=None)

Calculate powerflow into network

Parameters:
  • LID (int) – load ID.

  • NID (int) – node ID.

  • boundary (TYPE, optional) – DESCRIPTION. The default is None.

Return type:

None.

property resdof

Property method for resdof

Returns:

response DOFs.

Return type:

DOF

property results

property method for results

Returns:

results.

Return type:

dict of results

self_dot(other)

Incremental dot product

Modifies self

Parameters:

other (DynamicMatrix) – factor matrix.

Raises:

ValueError – When xdata or dofs are not consistent.

Returns:

matrix product.

Return type:

DynamicMatrix

property shape

Shape of LinearMatrix.

Returns:

(Nrow,Ncol,Ndepth) shape vector of Lineax matrix.

Return type:

tuple

signal(irow, icol, exc_val=1.0)

create a Signal object from 1-dim parts of the DynamicMatrix

Parameters:
  • icol (TYPE) – DESCRIPTION.

  • irow (TYPE) – DESCRIPTION.

Return type:

None.

solve(**kwargs)

Solve linear system of equations

Parameters:
  • **kwargs (dict) – Arbitrary keyword arguments.

  • loadresponse (True when the response shall overwrite the load) –

Return type:

None.

spy(res='mag', iz=0, **kwargs)

Show sparasity of matrix in a graphical way. Uses matplotlib.pyplot.spy

Parameters:
  • res – type of result ‘mag’,’real’,’imag’ or ‘phase’

  • iz – index of z-dimension

  • kwargs – for passing to matplotlib routine

sqrt()

square root.

Returns:

sqrt(self).

Return type:

LinearMatrix

sum()

Calculates the full sum of all coefficients in the matrix

property sym

Property method for sym

Returns:

Symmetry identifier.

Return type:

int

property symstr

Property method for symstr

Returns:

Symmetry string.

Return type:

str

transpose()

Transpose of linear matrix

Returns

property xdata

Property method for xdata

Returns:

xdata.

Return type:

DataAxis

static zeros(xdata, excdof, resdof, sym, **kwargs)

zeros matrix creator with defined dimension and DOFs

Parameters:
  • xdata (DataAxis) – in depth axis definition e.g. frequency, time.

  • excdof (DOF) – DOF of excitatin (columns).

  • resdof (DOF) – DOF of response (rows).

  • sym (int) – Symmetry identifier.

  • **kwargs (dict) – Arbitrary argument list passed to np.zeros method.

Raises:

ValueError – DESCRIPTION.

Returns:

zero matrix with defined DOFs and symmetry.

Return type:

DynamicMatrix