1 <?xml version="1.0" encoding="UTF-8"?>
3 * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
4 * Copyright (C) 2012 - 2016 - Scilab Enterprises
5 * Copyright (C) 2020 - Samuel GOUGEON
7 * This file is hereby licensed under the terms of the GNU GPL v2.0,
8 * pursuant to article 5.3.4 of the CeCILL v.2.1.
9 * This file was originally licensed under the terms of the CeCILL v2.1,
10 * and continues to be available under such terms.
11 * For more information, see the COPYING file which you should have received
12 * along with this program.
15 <refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"
16 xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML"
17 xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org"
18 xml:lang="fr" xml:id="power">
20 <refname>power</refname>
21 <refpurpose>élévation à la puissance (^,.^) </refpurpose>
24 <title>Séquence d'appel</title>
32 <title>Paramètres</title>
37 scalaire, vecteur, ou matrice de nombres entiers encodés, de nombres
38 ou polynômes ou fractions rationnelles à coefficients réels ou complexes.
45 scalaire, vecteur, ou matrice d'entiers encodés, de nombres décimaux,
46 ou de nombres complexes.
52 Si un opérande sont des entiers encodés, l'autre peut être uniquement des entiers
53 encodés ou des nombres réels.
56 Si <varname>A</varname> sont des polynômes ou des fractions rationnelles,
57 <varname>b</varname> peut uniquement être un entier décimal (positif ou négatif).
61 <title>Description</title>
63 <title>.^ : puissances respectives par élément</title>
65 Si <varname>A</varname> ou <varname>b</varname> est scalaire, il est préalablement
66 répliqué à la taille de l'autre, par A*ones(b) ou b*ones(A).
67 Sinon, <varname>A</varname> et <varname>b</varname> doivent avoir la même taille.
70 Alors, pour chaque élément numéro i, <literal>t(i) = A(i)^b(i)</literal>
75 <title>^ : puissance matricielle</title>
77 L'opérateur ^ est équivalent à .^ dans les cas suivants :
80 <varname>A</varname> est scalaire et <varname>b</varname> est un vecteur.
83 <varname>A</varname> est un vecteur et <varname>b</varname> est scalaire.
86 Sinon, <varname>A</varname> ou <varname>b</varname> doit être scalaire, et l'autre
87 opérande doit être une matrice carrée :
91 Si <varname>A</varname> est scalaire et <varname>b</varname> est carrée,
92 alors <literal>A^b</literal> est la matrice
93 <literal>expm(log(A) * b)</literal>
98 Si <varname>A</varname> est carrée et <varname>b</varname> est scalaire,
99 alors <literal>A^b</literal> est la matrice
100 <varname>A</varname> à la puissane <varname>b</varname>.
107 <title>Autres remarques</title>
111 Si <varname>A</varname> est une matrice carrée, <literal>A^p</literal> est
112 calculé par multiplications successives si <literal>p</literal> est un
113 entier positif, et par diagonalisation sinon (détails en remarques n°2 et 3
119 If <varname>A</varname> is a square and Hermitian matrix and <literal>p</literal>
120 is a non-integer scalar, <literal>A^p</literal> is computed as:
123 <code>A^p = u*diag(diag(s).^p)*u'</code> (For real matrix <varname>A</varname>,
124 only the real part of the answer is taken into account).
127 <literal>u</literal> and <literal>s</literal> are determined by
128 <code>[u,s] = schur(A)</code> .
133 If <varname>A</varname> is not a Hermitian matrix and <literal>p</literal> is a
134 non-integer scalar, <literal>A^p</literal> is computed as:
137 <code>A^p = v*diag(diag(d).^p)*inv(v)</code> (For real matrix <varname>A</varname>,
138 only the real part of the answer is taken into account).
141 <literal>d</literal> and <literal>v</literal> are determined by
142 <code>[d,v] = bdiag(A+0*%i)</code>.
147 If <varname>A</varname> and <literal>p</literal> are real or complex numbers,
148 <literal>A^p</literal> is the <emphasis>principal value</emphasis> determined by
151 <code>A^p = exp(p*log(A))</code>
154 (or <code>A^p = exp(p*(log(abs(A))+ %i*atan(imag(A)/real(A))))</code> ).
159 If <varname>A</varname> is a square matrix and <literal>p</literal> is a real or
160 complex number, <literal>A.^p</literal> is the <emphasis>principal value</emphasis>
164 <code>A.^p = exp(p*log(A))</code> (same as case 4 above).
169 Les opérateurs <literal>**</literal> et <literal>^</literal> sont équivalents.
175 L'élévation à la puissance est associative à droite dans Scilab contrairement à
176 Matlab® et Octave. Par exemple 2^3^4 est égal à 2^(3^4) dans Scilab mais est égal à
177 (2^3)^4 dans Matlab® et Octave.
183 <title>Exemples</title>
184 <programlisting role="example"><![CDATA[
199 <refsection role="see also">
200 <title>Voir aussi</title>
201 <simplelist type="inline">
203 <link linkend="exp">exp</link>
206 <link linkend="expm">expm</link>
209 <link linkend="hat">hat</link>
212 <link linkend="inv">inv</link>
216 <refsection role="history">
217 <title>Historique</title>
220 <revnumber>6.0.0</revnumber>
222 Avec des nombres décimaux ou complexes, <literal>scalaire ^ matriceCarrée</literal>
223 produit désormais <literal>expm(log(scalaire)*matriceCarrée)</literal> au lieu
224 de <literal>scalaire .^ matriceCarrée</literal>.