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 ? Mise en oeuvre d'IHM
avec Qt et PySide6
Voir le programme détaillé
Module « scipy.linalg »

Fonction fiedler_companion - module scipy.linalg

Signature de la fonction fiedler_companion

def fiedler_companion(a) 

Description

help(scipy.linalg.fiedler_companion)

Returns a Fiedler companion matrix

Given a polynomial coefficient array ``a``, this function forms a
pentadiagonal matrix with a special structure whose eigenvalues coincides
with the roots of ``a``.

Parameters
----------
a : (..., N) array_like
    1-D array of polynomial coefficients in descending order with a nonzero
    leading coefficient. For ``N < 2``, an empty array is returned.
    N-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
    Resulting companion matrix. 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.

See Also
--------
companion

Notes
-----
Similar to `companion`, each leading coefficient along the last axis of the
input should be nonzero.
If the leading coefficient is not 1, other coefficients are rescaled before
the array generation. To avoid numerical issues, it is best to provide a
monic polynomial.

.. versionadded:: 1.3.0

References
----------
.. [1] M. Fiedler, " A note on companion matrices", Linear Algebra and its
    Applications, 2003, :doi:`10.1016/S0024-3795(03)00548-2`

Examples
--------
>>> import numpy as np
>>> from scipy.linalg import fiedler_companion, eigvals
>>> p = np.poly(np.arange(1, 9, 2))  # [1., -16., 86., -176., 105.]
>>> fc = fiedler_companion(p)
>>> fc
array([[  16.,  -86.,    1.,    0.],
       [   1.,    0.,    0.,    0.],
       [   0.,  176.,    0., -105.],
       [   0.,    1.,    0.,    0.]])
>>> eigvals(fc)
array([7.+0.j, 5.+0.j, 3.+0.j, 1.+0.j])



Vous êtes un professionnel et vous avez besoin d'une formation ? RAG (Retrieval-Augmented Generation)
et Fine Tuning d'un LLM
Voir le programme détaillé