comparison m-toolbox/html_help/help/ug/constructor_examples_parfrac_content.html @ 0:f0afece42f48

Import.
author Daniele Nicolodi <nicolodi@science.unitn.it>
date Wed, 23 Nov 2011 19:22:13 +0100
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:f0afece42f48
1 <!-- $Id: constructor_examples_parfrac_content.html,v 1.1 2009/02/26 20:07:53 ingo Exp $ -->
2
3 <!-- -------------------------------------------------- -->
4 <!-- --------------- BEGIN CONTENT FILE --------------- -->
5 <!-- -------------------------------------------------- -->
6
7
8 <!-- --------------- Link box: begin --------------- -->
9 <table border="0" summary="Simple list" class="simplelist_nottable_last">
10 <tr>
11 <td>
12 <a href="constructor_examples_parfrac.html#copy">Copy an parfrac object</a>
13 </td>
14 </tr>
15 <tr>
16 <td>
17 <a href="constructor_examples_parfrac.html#xml_file">Construct an parfrac object by loading the object from a file</a>
18 </td>
19 </tr>
20 <tr>
21 <td>
22 <a href="constructor_examples_parfrac.html#rational">Construct an parfrac object from a rational object</a>
23 </td>
24 </tr>
25 <tr>
26 <td>
27 <a href="constructor_examples_parfrac.html#pzmodel">Construct an parfrac object from a pole/zero model</a>
28 </td>
29 </tr>
30 <tr>
31 <td>
32 <a href="constructor_examples_parfrac.html#direct_values">Construct an parfrac object from residuals, poles and direct terms</a>
33 </td>
34 </tr>
35 <tr>
36 <td>
37 <a href="constructor_examples_parfrac.html#plist">Construct an parfrac object from a parameter list object (PLIST)</a>
38 </td>
39 </tr>
40 </table>
41
42 <!-- --------------- NEXT EXAMPLE --------------- -->
43
44 <hr>
45 <h2 class="title"><a name="copy"></a>Copy an parfrac object</h2>
46 <p>The following example creates a copy of an parfrac object (blue command).</p>
47 <div class="fragment"><pre class="programlisting">
48 >> pf1 = parfrac([1 2+1i 2-1i], [6 1+3i 1-3i], 3)
49 <span class="blue">>> pf2 = parfrac(pf1)</span>
50 ---- parfrac 1 ----
51 model: None
52 res: [1;2+i*1;2-i*1]
53 poles: [6;1+i*3;1-i*3]
54 dir: 3
55 pmul: [1;1;1]
56 iunits: []
57 ounits: []
58 -------------------
59 </pre></div>
60 <br></br>
61 <p>REMARK: The following command copies only the handle of an object and doesn't create a copy of the object (as above). This means that everything that happens to the copy or original happens to the other object.</p>
62 <div class="fragment"><pre class="programlisting">
63 >> pf1 = parfrac()
64 ---- parfrac 1 ----
65 model: none
66 res: []
67 poles: []
68 dir: 0
69 pmul: []
70 iunits: []
71 ounits: []
72 -------------------
73 >> pf2 = pf1;
74 >> pf2.setName(<span class="string">'my new name'</span>)
75 ---- parfrac 1 ----
76 model: <span class="string">my new name</span>
77 res: []
78 poles: []
79 dir: 0
80 pmul: []
81 iunits: []
82 ounits: []
83 -------------------
84 </pre></div>
85 <br></br>
86 <p>If we display pf1 again then we see that the property 'name' was changed although we only have changed pf2.</p>
87 <div class="fragment"><pre class="programlisting">
88 >> pf1
89 ---- parfrac 1 ----
90 model: <span class="string">my new name</span>
91 res: []
92 poles: []
93 dir: 0
94 pmul: []
95 iunits: []
96 ounits: []
97 -------------------
98 </pre></div>
99
100
101 <!-- --------------- NEXT EXAMPLE --------------- -->
102
103 <hr>
104 <h2 class="title"><a name="xml_file"></a>Construct an parfrac object by loading the object from a file</h2>
105 <p>The following example creates a new parfrac object by loading the object from disk.</p>
106 <div class="fragment"><pre class="programlisting">
107 pf = parfrac(<span class="string">'parfrac_object.mat'</span>)
108 pf = parfrac(<span class="string">'parfrac_object.xml'</span>)
109 </pre></div>
110 <p>or in a <tt>PLIST</tt></p>
111 <div class="fragment"><pre class="programlisting">
112 pl = plist(<span class="string">'filename'</span>, <span class="string">'parfrac_object.xml'</span>);
113 pf = parfrac(pl)
114 </pre></div>
115
116
117 <!-- --------------- NEXT EXAMPLE --------------- -->
118
119 <hr>
120 <h2 class="title"><a name="rational"></a>Construct an parfrac object from a rational object</h2>
121 <p>The following example creates a new parfrac object from a rational object.</p>
122 <div class="fragment"><pre class="programlisting">
123 >> rat = rational([1 2 3], [4 5 6 7], <span class="string">'my rational'</span>)
124 ---- rational 1 ----
125 model: my rational
126 num: [1 2 3]
127 den: [4 5 6 7]
128 iunits: []
129 ounits: []
130 --------------------
131 >> pf = parfrac(rat)
132 ---- parfrac 1 ----
133 model: parfrac(my rational)
134 res: [0.0355+i*0.1682; 0.0355-i*0.1682; 0.1788]
135 poles: [-0.021-i*1.2035;-0.0211+i*1.2035;-1.2077]
136 dir: 0
137 pmul: [1;1;1]
138 iunits: []
139 ounits: []
140 -------------------
141 </pre></div>
142 <p>or in a plist</p>
143 <div class="fragment"><pre class="programlisting">
144 >> rat = rational([1 2 3], [4 5 6 7], <span class="string">'my rational'</span>);
145 >> pl = plist(<span class="string">'rational'</span>, rat)
146 >> pf = parfrac(pl)
147 </pre></div>
148
149
150 <!-- --------------- NEXT EXAMPLE --------------- -->
151
152 <hr>
153 <h2 class="title"><a name="pzmodel"></a>Construct an parfrac object from a pole/zero model</h2>
154 <p>The following example creates a new parfrac object from a pole/zero model.</p>
155 <div class="fragment"><pre class="programlisting">
156 >> pzm = pzmodel(1, {1 2 3}, {4 5})
157 ---- pzmodel 1 ----
158 name: None
159 gain: 1
160 delay: 0
161 iunits: []
162 ounits: []
163 pole 001: (f=1 Hz,Q=NaN)
164 pole 002: (f=2 Hz,Q=NaN)
165 pole 003: (f=3 Hz,Q=NaN)
166 zero 001: (f=4 Hz,Q=NaN)
167 zero 002: (f=5 Hz,Q=NaN)
168 -------------------
169 >> pf = parfrac(pzm)
170 --- parfrac 1 ----
171 model: parfrac(None)
172 res: [0.999999999999999;-6.00000000000001;5.99999999999999]
173 poles: [-18.8495559215388;-12.5663706143592;-6.28318530717959]
174 dir: 0
175 pmul: [1;1;1]
176 iunits: []
177 ounits: []
178 -------------------
179 </pre></div>
180 <p>or in a plist</p>
181 <div class="fragment"><pre class="programlisting">
182 >> pzm = pzmodel(1, {1 2 3}, {4 5})
183 >> pl = plist(<span class="string">'pzmodel'</span>, pzm)
184 >> pf = parfrac(pl)
185 </pre></div>
186
187
188 <!-- --------------- NEXT EXAMPLE --------------- -->
189
190 <hr>
191 <h2 class="title"><a name="direct_values"></a>Construct an parfrac object from residuals, poles and direct terms</h2>
192 <p>The following example creates a new parfrac direct from the values.</p>
193 <div class="fragment"><pre class="programlisting">
194 >> res = [1;2+i*1;2-i*1];
195 >> poles = [6;1+i*3;1-i*3];
196 >> dir = 3;
197 >> name = <span class="string">'my parfrac'</span>;
198 >> iunits = <span class="string">'Hz'</span>;
199 >> ounits = <span class="string">'V'</span>;
200
201 >> pf = parfrac(res, poles, dir)
202 >> pf = parfrac(res, poles, dir, name)
203 >> pf = parfrac(res, poles, dir, name, iunits, ounits)
204 ---- parfrac 1 ----
205 model: my parfrac
206 res: [1;2+i*1;2-i*1]
207 poles: [6;1+i*3;1-i*3]
208 dir: 3
209 pmul: [1;1;1]
210 iunits: [Hz]
211 ounits: [V]
212 -------------------
213 </pre></div>
214
215
216 <!-- --------------- NEXT EXAMPLE --------------- -->
217
218 <hr>
219 <h2 class="title"><a name="plist"></a>Construct an parfrac object from a parameter list (<tt>plist</tt>)</h2>
220 <p>Constructs an parfrac object from the description given in the parameter list.</p>
221
222 <!-- --------------- Link box: begin --------------- -->
223 <table border="0" summary="Simple list" class="simplelist_nottable_last">
224 <tr>
225 <td>
226 <a href="constructor_examples_parfrac.html#hostname">Use the key word 'hostname'</a>
227 </td>
228 </tr>
229 <tr>
230 <td>
231 <a href="constructor_examples_parfrac.html#direct_terms">Use the key word 'res' or 'poles' or 'dir'</a>
232 </td>
233 </tr>
234 </table>
235 <!-- --------------- Link box: end --------------- -->
236
237
238 <!-- --------------- 'hostname' --------------- -->
239
240 <hr>
241 <h3 class="title"><a name="hostname"></a>Use the key word 'hostname'</h3>
242 <p>Construct an parfrac object by retrieving it from a LTPDA repository.
243 <p>The relevant parameters are:</p>
244 <p>
245 <table cellspacing="0" border="0" cellpadding="2" class="simplelist_nottable_last" width="80%">
246 <colgroup>
247 <col width="25%"/>
248 <col width="75%"/>
249 </colgroup>
250 <thead>
251 <tr valign="top">
252 <th class="subcategorylist">Key</th>
253 <th class="subcategorylist">Description</th>
254 </tr>
255 </thead>
256 <tbody>
257 <tr valign="top">
258 <td>
259 <p>'hostname'</p>
260 </td>
261 <td>
262 <p>the repository hostname. [default: 'localhost']</p>
263 </td>
264 </tr>
265 <tr valign="top">
266 <td>
267 <p>'database'</p>
268 </td>
269 <td>
270 <p>The database name [default: 'ltpda']</p>
271 </td>
272 </tr>
273 <tr valign="top">
274 <td>
275 <p>'id'</p>
276 </td>
277 <td>
278 <p>A vector of object IDs. [default: []]</p>
279 </td>
280 </tr>
281 <tr valign="top">
282 <td>
283 <p>'cid'</p>
284 </td>
285 <td>
286 <p>Retrieve all parfrac objects from a particular collection</p>
287 </td>
288 </tr>
289 <tr valign="top">
290 <td>
291 <p>'binary'</p>
292 </td>
293 <td>
294 <p>Set to 'yes' to retrieve from stored binary representation (not always available). [default: yes]</p>
295 </td>
296 </tr>
297 </tbody>
298 </table>
299 </p>
300 <div class="fragment"><pre class="programlisting">
301 pl = plist(<span class="string">'hostname'</span>, <span class="string">'130.75.117.67'</span>, <span class="string">'database'</span>, <span class="string">'ltpda_test'</span>, <span class="string">'id'</span>, 1)
302 a1 = parfrac(pl)
303 </pre></div>
304
305
306 <!-- --------------- 'direct_terms' --------------- -->
307
308 <hr>
309 <h3 class="title"><a name="direct_terms"></a>Use the key word 'res' or 'poles' or 'dir'</h3>
310 <p>Construct an parfrac object direct from the residual, pole or direct terms.<br></br>
311 The relevant parameters are:</p>
312 <p>
313 <table cellspacing="0" border="0" cellpadding="2" class="simplelist_nottable_last" width="80%">
314 <colgroup>
315 <col width="25%"/>
316 <col width="75%"/>
317 </colgroup>
318 <thead>
319 <tr valign="top">
320 <th class="subcategorylist">Key</th>
321 <th class="subcategorylist">Description</th>
322 </tr>
323 </thead>
324 <tbody>
325 <tr valign="top">
326 <td>
327 <p>'res'</p>
328 </td>
329 <td>
330 <p>residuals [default: []]</p>
331 </td>
332 </tr>
333 <tr valign="top">
334 <td>
335 <p>'poles'</p>
336 </td>
337 <td>
338 <p>poles [default: []]</p>
339 </td>
340 </tr>
341 <tr valign="top">
342 <td>
343 <p>'dir'</p>
344 </td>
345 <td>
346 <p>direct terms [default: []]</p>
347 </td>
348 </tr>
349 </tbody>
350 </table>
351 </p>
352 <p>You can also specify optional parameters:</p>
353 <p>
354 <table cellspacing="0" border="0" cellpadding="2" class="simplelist_nottable_last" width="80%">
355 <colgroup>
356 <col width="25%"/>
357 <col width="75%"/>
358 </colgroup>
359 <thead>
360 <tr valign="top">
361 <th class="subcategorylist">Key</th>
362 <th class="subcategorylist">Description</th>
363 </tr>
364 </thead>
365 <tbody>
366 <tr valign="top">
367 <td>
368 <p>'name'</p>
369 </td>
370 <td>
371 <p>name of the parfrac object [default: 'none']</p>
372 </td>
373 </tr>
374 <tr valign="top">
375 <td>
376 <p>'xunits'</p>
377 </td>
378 <td>
379 <p>unit of the x-axis</p>
380 </td>
381 </tr>
382 <tr valign="top">
383 <td>
384 <p>'yunits'</p>
385 </td>
386 <td>
387 <p>unit of the y-axis</p>
388 </td>
389 </tr>
390 </tbody>
391 </table>
392 </p>
393 <div class="fragment"><pre class="programlisting">
394 res = [1;2+i*1;2-i*1];
395 poles = [6;1+i*3;1-i*3];
396 dir = 3;
397 name = <span class="string">'my parfrac'</span>;
398 iunits = <span class="string">'Hz'</span>;
399 ounits = <span class="string">'V'</span>;
400
401 pl = plist(<span class="string">'res'</span>, res, <span class="string">'poles'</span>, poles);
402 pf = parfrac(pl)
403 ---- parfrac 1 ----
404 model: None
405 res: [1;2+i*1;2-i*1]
406 poles: [6;1+i*3;1-i*3]
407 dir: 0
408 pmul: [1;1;1]
409 iunits: []
410 ounits: []
411 -------------------
412
413 pl = plist(<span class="string">'res'</span>, res, <span class="string">'poles'</span>, poles, <span class="string">'name'</span>, name, <span class="string">'iunits'</span>, iunits, <span class="string">'ounits'</span>, ounits);
414 pf = parfrac(pl)
415 ---- parfrac 1 ----
416 model: my parfrac
417 res: [1;2+i*1;2-i*1]
418 poles: [6;1+i*3;1-i*3]
419 dir: 0
420 pmul: [1;1;1]
421 iunits: [Hz]
422 ounits: [V]
423 -------------------
424 </pre></div>
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461