1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
|
<?xml version="1.0" encoding="UTF-8"?>
<!--
* Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
* Copyright (C) INRIA -
*
* This file must be used under the terms of the CeCILL.
* This source file is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
* are also available at
* http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
*
-->
<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="csim">
<refnamediv>
<refname>csim</refname>
<refpurpose>線形システムのシミュレーション (時間応答)</refpurpose>
</refnamediv>
<refsynopsisdiv>
<title>呼び出し手順</title>
<synopsis>[y [,x]]=csim(u,t,sl,[x0 [,tol]])</synopsis>
</refsynopsisdiv>
<refsection>
<title>引数</title>
<variablelist>
<varlistentry>
<term>u</term>
<listitem>
<para>関数, リストまたは文字列 (制御入力)</para>
</listitem>
</varlistentry>
<varlistentry>
<term>t</term>
<listitem>
<para>
時間を指定するための実数ベクトルで、<literal>t(1)</literal> は
初期時間 (<literal>x0=x(t(1))</literal>)を表す.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>sl</term>
<listitem>
<para>
連続時間系の<literal>syslin</literal>リスト (SIMO線形システム)
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>y</term>
<listitem>
<para>
<literal>y=[y(t(i)]</literal>, i=1,..,n となる行列
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>x</term>
<listitem>
<para>
<literal>x=[x(t(i)]</literal>, i=1,..,n となる行列
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>tol</term>
<listitem>
<para>2つの要素 [atol rtol] からなるベクトルであり、それぞれ
ODEソルバ(ode参照)の絶対許容誤差および相対許容誤差を定義する
</para>
</listitem>
</varlistentry>
</variablelist>
</refsection>
<refsection>
<title>説明</title>
<para>
線形制御系 <literal>sl</literal>のシミュレーションを行います.
ただし,<literal>sl</literal>は,
<literal>syslin</literal>リストで表された連続時間システムとします.
</para>
<para>
<literal>u</literal> は制御入力,<literal>x0</literal> は状態量初期値です.
</para>
<para>
<literal>y</literal> は出力,<literal>x</literal> は状態量です.
</para>
<para>
制御入力は以下のいずれかとすることができます:
</para>
<para>
1. 関数 : <literal>[inputs]=u(t)</literal>
</para>
<para>
2. リスト : <literal>list(ut,parameter1,....,parametern)</literal>.
ただし、<literal>inputs=ut(t,parameter1,....,parametern)</literal> (<literal>ut</literal> は関数)
</para>
<para>
3. インパルス応答の計算を表す文字列 <literal>"impuls"</literal>
(ここで,<literal>sl</literal>の入力は単一で<literal>x0=0</literal>が必要).
直達項を有する系の場合, t=0における無限インパルスは無視されます.
</para>
<para>
4. ステップ応答の計算を表す文字列 <literal>"step"</literal>
(ここで、<literal>sl</literal>の入力は単一で,<literal>x0=0</literal>が必要)
</para>
<para>
5. t の各値に対応する u の値を指定するベクトル.
</para>
</refsection>
<refsection>
<title>例</title>
<programlisting role="example"><![CDATA[
s=poly(0,'s');
rand('seed',0);
w=ssrand(1,1,3);
w('A')=w('A')-2*eye();
t=0:0.05:5;
//impulse(w) = step (s * w)
plot2d([t',t'],[(csim('step',t,tf2ss(s)*w))',0*t'])
]]></programlisting>
<scilab:image>
s=poly(0,'s');
rand('seed',0);
w=ssrand(1,1,3);
w('A')=w('A')-2*eye();
t=0:0.05:5;
plot2d([t',t'],[(csim('step',t,tf2ss(s)*w))',0*t'])
</scilab:image>
<programlisting role="example"><![CDATA[
s=poly(0,'s');
rand('seed',0);
w=ssrand(1,1,3);
w('A')=w('A')-2*eye();
t=0:0.05:5;
plot2d([t',t'],[(csim('impulse',t,w))',0*t'])
]]></programlisting>
<scilab:image>
s=poly(0,'s');
rand('seed',0);
w=ssrand(1,1,3);
w('A')=w('A')-2*eye();
t=0:0.05:5;
plot2d([t',t'],[(csim('impulse',t,w))',0*t'])
</scilab:image>
<programlisting role="example"><![CDATA[
s=poly(0,'s');
rand('seed',0);
w=ssrand(1,1,3);
w('A')=w('A')-2*eye();
t=0:0.05:5;
//step(w) = impulse (s^-1 * w)
plot2d([t',t'],[(csim('step',t,w))',0*t'])
]]></programlisting>
<scilab:image>
s=poly(0,'s');
rand('seed',0);
w=ssrand(1,1,3);
w('A')=w('A')-2*eye();
t=0:0.05:5;
plot2d([t',t'],[(csim('step',t,w))',0*t'])
</scilab:image>
<programlisting role="example"><![CDATA[
s=poly(0,'s');
rand('seed',0);
w=ssrand(1,1,3);
w('A')=w('A')-2*eye();
t=0:0.05:5;
plot2d([t',t'],[(csim('impulse',t,tf2ss(1/s)*w))',0*t'])
]]></programlisting>
<scilab:image>
s=poly(0,'s');
rand('seed',0);
w=ssrand(1,1,3);
w('A')=w('A')-2*eye();
t=0:0.05:5;
plot2d([t',t'],[(csim('impulse',t,tf2ss(1/s)*w))',0*t'])
</scilab:image>
<programlisting role="example"><![CDATA[
s=poly(0,'s');
rand('seed',0);
w=ssrand(1,1,3);
w('A')=w('A')-2*eye();
t=0:0.05:5;
//時間関数で定義された入力
deff('u=timefun(t)','u=abs(sin(t))')
clf();plot2d([t',t'],[(csim(timefun,t,w))',0*t'])
]]></programlisting>
<scilab:image>
s=poly(0,'s');
rand('seed',0);
w=ssrand(1,1,3);
w('A')=w('A')-2*eye();
t=0:0.05:5;
deff('u=timefun(t)','u=abs(sin(t))')
clf();plot2d([t',t'],[(csim(timefun,t,w))',0*t'])
</scilab:image>
</refsection>
<refsection role="see also">
<title>参照</title>
<simplelist type="inline">
<member>
<link linkend="syslin">syslin</link>
</member>
<member>
<link linkend="dsimul">dsimul</link>
</member>
<member>
<link linkend="flts">flts</link>
</member>
<member>
<link linkend="ltitr">ltitr</link>
</member>
<member>
<link linkend="rtitr">rtitr</link>
</member>
<member>
<link linkend="ode">ode</link>
</member>
<member>
<link linkend="impl">impl</link>
</member>
</simplelist>
</refsection>
</refentry>
|