example of aff2ab help page updated.
[scilab.git] / scilab / modules / linear_algebra / help / ja_JP / linear / aff2ab.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!--
3  * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
4  * Copyright (C) 2008 - INRIA
5  *
6  * Copyright (C) 2012 - 2016 - Scilab Enterprises
7  *
8  * This file is hereby licensed under the terms of the GNU GPL v2.0,
9  * pursuant to article 5.3.4 of the CeCILL v.2.1.
10  * This file was originally licensed under the terms of the CeCILL v2.1,
11  * and continues to be available under such terms.
12  * For more information, see the COPYING file which you should have received
13  * along with this program.
14  *
15  -->
16 <refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:lang="ja" xml:id="aff2ab">
17     <refnamediv>
18         <refname>aff2ab</refname>
19         <refpurpose>線形 (アフィン)関数を A,b に変換</refpurpose>
20     </refnamediv>
21     <refsynopsisdiv>
22         <title>呼び出し手順</title>
23         <synopsis>[A,b]=aff2ab(afunction,dimX,D [,flag])</synopsis>
24     </refsynopsisdiv>
25     <refsection>
26         <title>引数</title>
27         <variablelist>
28             <varlistentry>
29                 <term>afunction</term>
30                 <listitem>
31                     <para>
32                         scilab 関数 <literal> Y =fct(X,D) </literal>
33                         ただし, <literal>X, D, Y</literal> は行列の<literal>リスト</literal>
34                     </para>
35                 </listitem>
36             </varlistentry>
37             <varlistentry>
38                 <term>dimX</term>
39                 <listitem>
40                     <para>
41                         p x 2 整数行列 (<literal>p</literal> は
42                         <literal>X</literal>の行列の数)
43                     </para>
44                 </listitem>
45             </varlistentry>
46             <varlistentry>
47                 <term>D</term>
48                 <listitem>
49                     <para>
50                         実数行列の<literal>list</literal>  (または任意の有効なScilab オブジェクト).
51                     </para>
52                 </listitem>
53             </varlistentry>
54             <varlistentry>
55                 <term>flag</term>
56                 <listitem>
57                     <para>
58                         オプションのパラメータ (<literal>flag='f'</literal>
59                         または <literal>flag='sp'</literal>)
60                     </para>
61                 </listitem>
62             </varlistentry>
63             <varlistentry>
64                 <term>A</term>
65                 <listitem>
66                     <para>実数行列</para>
67                 </listitem>
68             </varlistentry>
69             <varlistentry>
70                 <term>b</term>
71                 <listitem>
72                     <para>
73                         <literal>A</literal>と同じ行次元を有する実数ベクトル
74                     </para>
75                 </listitem>
76             </varlistentry>
77         </variablelist>
78     </refsection>
79     <refsection>
80         <title>説明</title>
81         <para>
82             <literal>aff2ab</literal>は,アフィン関数の(正準形式の)行列表現を返します.
83         </para>
84         <para>
85             <literal>afunction</literal> は以下の規定の構文を有する関数です:
86             <literal> Y=afunction(X,D) </literal>
87             ただし, <literal> X=list(X1,X2,...,Xp) </literal> は
88             p 個の実数行列のリスト,<literal> Y=list(Y1,...,Yq) </literal> は
89             <literal> Xi</literal>に線形に依存するq 個の実数行列のリストです.
90             (オプションの) 入力 <literal> D</literal> は, X の関数として
91             Yを計算するために必要なパラメータを有しています.
92         </para>
93         <para>
94             <literal> dimX</literal> は p x 2 行列です: <literal>dimX(i)=[nri,nci]</literal>
95             は行列<literal>Xi</literal>の行と列の実際の数です.
96             これらの次元は,結果の行列<literal>A</literal>の列の次元である
97             <literal>na</literal> を以下のように定義します:
98             <literal>na=nr1*nc1 +...+ nrp*ncp</literal>.
99         </para>
100         <para>
101             オプションのパラメータ <literal>flag='sp'</literal> が指定された場合,
102             結果の行列 <literal>A</literal>は疎行列として返されます.
103         </para>
104         <para>
105             この関数は,未知変数が行列であるような
106             線形方程式のシステムを解くために有用です.
107         </para>
108     </refsection>
109     <refsection>
110         <title>例</title>
111         <programlisting role="example"><![CDATA[
112 // リアプノフ方程式ソルバ (未知変数1つ, 拘束条件1つ)
113 deff('Y=lyapunov(X,D)','[A,Q]=D(:);Xm=X(:); Y=list(A''*Xm+Xm*A-Q)')
114 A=rand(3,3);Q=rand(3,3);Q=Q+Q';D=list(A,Q);dimX=[3,3];
115 [Aly,bly]=aff2ab(lyapunov,dimX,D);
116 [Xl,kerA]=linsolve(Aly,bly); Xv=vec2list(Xl,dimX); lyapunov(Xv,D)
117 Xm=Xv(:); A'*Xm+Xm*A-Q
118
119 // 冗長な拘束 t X=X'を有するリアプノフ方程式ソルバ
120 // (変数1つ, 拘束条件2つt) D はグローバル変数
121 deff('Y=ly2(X,D)','[A,Q]=D(:);Xm=X(:); Y=list(A''*Xm+Xm*A-Q,Xm''-Xm)')
122 A=rand(3,3);Q=rand(3,3);Q=Q+Q';D=list(A,Q);dimX=[3,3];
123 [Aly,bly]=aff2ab(ly2,dimX,D);
124 [Xl,kerA]=linsolve(Aly,bly); Xv=vec2list(Xl,dimX); ly2(Xv,D)
125
126 // フランシス方程式
127 // 以下のような行列 X1 および X2 を見つける:
128 // A1*X1 - X1*A2 + B*X2 -A3 = 0
129 // D1*X1 -D2 = 0
130 deff('Y=bruce(X,D)','[A1,A2,A3,B,D1,D2]=D(:);'+...
131 '[X1,X2]=X(:);Y=list(A1*X1-X1*A2+B*X2-A3,D1*X1-D2)')
132 A1=[-4,10;-1,2];A3=[1;2];B=[0;1];A2=1;D1=[0,1];D2=1;
133 D=list(A1,A2,A3,B,D1,D2);
134 [n1,m1]=size(A1);[n2,m2]=size(A2);[n3,m3]=size(B);
135 dimX=[[m1,n2];[m3,m2]];
136 [Af,bf]=aff2ab(bruce,dimX,D);
137 [Xf,KerAf]=linsolve(Af,bf);Xsol=vec2list(Xf,dimX)
138 bruce(Xsol,D)
139
140 // Aを変換する全てのXを見つける
141 deff('y=f(X,D)','y=list(D(:)*X(:)-X(:)*D(:))')
142 A=rand(3,3);dimX=[3,3];[Af,bf]=aff2ab(f,dimX,list(A));
143 [Xf,KerAf]=linsolve(Af,bf);[p,q]=size(KerAf);
144 Xsol=vec2list(Xf+KerAf*rand(q,1),dimX);
145 C=Xsol(:); A*C-C*A
146  ]]></programlisting>
147     </refsection>
148     <refsection role="see also">
149         <title>参照</title>
150         <simplelist type="inline">
151             <member>
152                 <link linkend="linsolve">linsolve</link>
153             </member>
154         </simplelist>
155     </refsection>
156 </refentry>