Participer au site avec un Tip
Rechercher
 

Améliorations / Corrections

Vous avez des améliorations (ou des corrections) à proposer pour ce document : je vous remerçie par avance de m'en faire part, cela m'aide à améliorer le site.

Emplacement :

Description des améliorations :

Vous êtes un professionnel et vous avez besoin d'une formation ? Programmation Python
Les compléments
Voir le programme détaillé
Module « scipy.linalg »

Fonction companion - module scipy.linalg

Signature de la fonction companion

def companion(a) 

Description

help(scipy.linalg.companion)

Create a companion matrix.

Create the companion matrix [1]_ associated with the polynomial whose
coefficients are given in `a`.

Parameters
----------
a : (..., N) array_like
    1-D array of polynomial coefficients. The length of `a` must be
    at least two, and ``a[0]`` must not be zero.
    M-dimensional arrays are treated as a batch: each slice along the last
    axis is a 1-D array of polynomial coefficients.

Returns
-------
c : (..., N-1, N-1) ndarray
    For 1-D input, the first row of `c` is ``-a[1:]/a[0]``, and the first
    sub-diagonal is all ones.  The data-type of the array is the same
    as the data-type of ``1.0*a[0]``.
    For batch input, each slice of shape ``(N-1, N-1)`` along the last two
    dimensions of the output corresponds with a slice of shape ``(N,)``
    along the last dimension of the input.

Raises
------
ValueError
    If any of the following are true: a) ``a.shape[-1] < 2``; b) ``a[..., 0] == 0``.

Notes
-----
.. versionadded:: 0.8.0

References
----------
.. [1] R. A. Horn & C. R. Johnson, *Matrix Analysis*.  Cambridge, UK:
    Cambridge University Press, 1999, pp. 146-7.

Examples
--------
>>> from scipy.linalg import companion
>>> companion([1, -10, 31, -30])
array([[ 10., -31.,  30.],
       [  1.,   0.,   0.],
       [  0.,   1.,   0.]])



Vous êtes un professionnel et vous avez besoin d'une formation ? Mise en oeuvre d'IHM
avec Qt et PySide6
Voir le programme détaillé