{ } Raw JSON

bundles / scipy latest / scipy / sparse / linalg / _special_sparse_arrays / MikotaPair

class

scipy.sparse.linalg._special_sparse_arrays:MikotaPair

source: /scipy/sparse/linalg/_special_sparse_arrays.py :839

Signature

class   MikotaPair ( n dtype = <class 'numpy.float64'> )

Members

Summary

Construct the Mikota pair of matrices in various formats and eigenvalues of the generalized eigenproblem with them.

Extended Summary

The Mikota pair of matrices [1, 2]_ models a vibration problem of a linear mass-spring system with the ends attached where the stiffness of the springs and the masses increase along the system length such that vibration frequencies are subsequent integers 1, 2, ..., n where n is the number of the masses. Thus, eigenvalues of the generalized eigenvalue problem for the matrix pair K and M where K is the system stiffness matrix and M is the system mass matrix are the squares of the integers, i.e., 1, 4, 9, ..., n * n.

The stiffness matrix K is square real tri-diagonal symmetric positive definite. The mass matrix M is diagonal with diagonal entries 1, 1/2, 1/3, ...., 1/n. Both matrices get ill-conditioned with n growing.

Parameters

n : int

The size of the matrices of the Mikota pair.

dtype : dtype

Numerical type of the array. Default is np.float64.

Attributes

eigenvalues : 1D ndarray, ``np.uint64``

All eigenvalues of the Mikota pair ordered ascending.

Methods

MikotaK()

A LinearOperator custom object for the stiffness matrix.

MikotaM()

A LinearOperator custom object for the mass matrix.

.. versionadded:: 1.12.0

Examples

import numpy as np
from scipy.sparse.linalg._special_sparse_arrays import MikotaPair
n = 6
mik = MikotaPair(n)
mik_k = mik.k
mik_m = mik.m
mik_k.toarray()
mik_k.tobanded()
mik_m.tobanded()
mik_k.tosparse()
mik_m.tosparse()
np.array_equal(mik_k(np.eye(n)), mik_k.toarray())
np.array_equal(mik_m(np.eye(n)), mik_m.toarray())
mik.eigenvalues()
mik.eigenvalues(2)

Aliases

  • scipy.sparse.linalg._special_sparse_arrays.MikotaPair