comparison m-toolbox/html_help/help/ug/constructor_examples_parfrac.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 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
2 "http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd">
3
4 <html lang="en">
5 <head>
6 <meta name="generator" content=
7 "HTML Tidy for Mac OS X (vers 1st December 2004), see www.w3.org">
8 <meta http-equiv="Content-Type" content=
9 "text/html; charset=us-ascii">
10
11 <title>Constructor examples of the PARFRAC class (LTPDA Toolbox)</title>
12 <link rel="stylesheet" href="docstyle.css" type="text/css">
13 <meta name="generator" content="DocBook XSL Stylesheets V1.52.2">
14 <meta name="description" content=
15 "Presents an overview of the features, system requirements, and starting the toolbox.">
16 </head>
17
18 <body>
19 <a name="top_of_page" id="top_of_page"></a>
20
21 <p style="font-size:1px;">&nbsp;</p>
22
23 <table class="nav" summary="Navigation aid" border="0" width=
24 "100%" cellpadding="0" cellspacing="0">
25 <tr>
26 <td valign="baseline"><b>LTPDA Toolbox</b></td><td><a href="../helptoc.html">contents</a></td>
27
28 <td valign="baseline" align="right"><a href=
29 "constructor_examples_pzmodel.html"><img src="b_prev.gif" border="0" align=
30 "bottom" alt="Constructor examples of the PZMODEL class"></a>&nbsp;&nbsp;&nbsp;<a href=
31 "constructor_examples_rational.html"><img src="b_next.gif" border="0" align=
32 "bottom" alt="Constructor examples of the RATIONAL class"></a></td>
33 </tr>
34 </table>
35
36 <h1 class="title"><a name="f3-12899" id="f3-12899"></a>Constructor examples of the PARFRAC class</h1>
37 <hr>
38
39 <p>
40
41 <!-- -------------------------------------------------- -->
42 <!-- --------------- BEGIN CONTENT FILE --------------- -->
43 <!-- -------------------------------------------------- -->
44
45
46 <!-- --------------- Link box: begin --------------- -->
47 <table border="0" summary="Simple list" class="simplelist_nottable_last">
48 <tr>
49 <td>
50 <a href="constructor_examples_parfrac.html#copy">Copy an parfrac object</a>
51 </td>
52 </tr>
53 <tr>
54 <td>
55 <a href="constructor_examples_parfrac.html#xml_file">Construct an parfrac object by loading the object from a file</a>
56 </td>
57 </tr>
58 <tr>
59 <td>
60 <a href="constructor_examples_parfrac.html#rational">Construct an parfrac object from a rational object</a>
61 </td>
62 </tr>
63 <tr>
64 <td>
65 <a href="constructor_examples_parfrac.html#pzmodel">Construct an parfrac object from a pole/zero model</a>
66 </td>
67 </tr>
68 <tr>
69 <td>
70 <a href="constructor_examples_parfrac.html#direct_values">Construct an parfrac object from residuals, poles and direct terms</a>
71 </td>
72 </tr>
73 <tr>
74 <td>
75 <a href="constructor_examples_parfrac.html#plist">Construct an parfrac object from a parameter list object (PLIST)</a>
76 </td>
77 </tr>
78 </table>
79
80 <!-- --------------- NEXT EXAMPLE --------------- -->
81
82 <hr>
83 <h2 class="title"><a name="copy"></a>Copy an parfrac object</h2>
84 <p>The following example creates a copy of an parfrac object (blue command).</p>
85 <div class="fragment"><pre class="programlisting">
86 >> pf1 = parfrac([1 2+1i 2-1i], [6 1+3i 1-3i], 3)
87 <span class="blue">>> pf2 = parfrac(pf1)</span>
88 ---- parfrac 1 ----
89 model: None
90 res: [1;2+i*1;2-i*1]
91 poles: [6;1+i*3;1-i*3]
92 dir: 3
93 pmul: [1;1;1]
94 iunits: []
95 ounits: []
96 -------------------
97 </pre></div>
98 <br></br>
99 <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>
100 <div class="fragment"><pre class="programlisting">
101 >> pf1 = parfrac()
102 ---- parfrac 1 ----
103 model: none
104 res: []
105 poles: []
106 dir: 0
107 pmul: []
108 iunits: []
109 ounits: []
110 -------------------
111 >> pf2 = pf1;
112 >> pf2.setName(<span class="string">'my new name'</span>)
113 ---- parfrac 1 ----
114 model: <span class="string">my new name</span>
115 res: []
116 poles: []
117 dir: 0
118 pmul: []
119 iunits: []
120 ounits: []
121 -------------------
122 </pre></div>
123 <br></br>
124 <p>If we display pf1 again then we see that the property 'name' was changed although we only have changed pf2.</p>
125 <div class="fragment"><pre class="programlisting">
126 >> pf1
127 ---- parfrac 1 ----
128 model: <span class="string">my new name</span>
129 res: []
130 poles: []
131 dir: 0
132 pmul: []
133 iunits: []
134 ounits: []
135 -------------------
136 </pre></div>
137
138
139 <!-- --------------- NEXT EXAMPLE --------------- -->
140
141 <hr>
142 <h2 class="title"><a name="xml_file"></a>Construct an parfrac object by loading the object from a file</h2>
143 <p>The following example creates a new parfrac object by loading the object from disk.</p>
144 <div class="fragment"><pre class="programlisting">
145 pf = parfrac(<span class="string">'parfrac_object.mat'</span>)
146 pf = parfrac(<span class="string">'parfrac_object.xml'</span>)
147 </pre></div>
148 <p>or in a <tt>PLIST</tt></p>
149 <div class="fragment"><pre class="programlisting">
150 pl = plist(<span class="string">'filename'</span>, <span class="string">'parfrac_object.xml'</span>);
151 pf = parfrac(pl)
152 </pre></div>
153
154
155 <!-- --------------- NEXT EXAMPLE --------------- -->
156
157 <hr>
158 <h2 class="title"><a name="rational"></a>Construct an parfrac object from a rational object</h2>
159 <p>The following example creates a new parfrac object from a rational object.</p>
160 <div class="fragment"><pre class="programlisting">
161 >> rat = rational([1 2 3], [4 5 6 7], <span class="string">'my rational'</span>)
162 ---- rational 1 ----
163 model: my rational
164 num: [1 2 3]
165 den: [4 5 6 7]
166 iunits: []
167 ounits: []
168 --------------------
169 >> pf = parfrac(rat)
170 ---- parfrac 1 ----
171 model: parfrac(my rational)
172 res: [0.0355+i*0.1682; 0.0355-i*0.1682; 0.1788]
173 poles: [-0.021-i*1.2035;-0.0211+i*1.2035;-1.2077]
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 >> rat = rational([1 2 3], [4 5 6 7], <span class="string">'my rational'</span>);
183 >> pl = plist(<span class="string">'rational'</span>, rat)
184 >> pf = parfrac(pl)
185 </pre></div>
186
187
188 <!-- --------------- NEXT EXAMPLE --------------- -->
189
190 <hr>
191 <h2 class="title"><a name="pzmodel"></a>Construct an parfrac object from a pole/zero model</h2>
192 <p>The following example creates a new parfrac object from a pole/zero model.</p>
193 <div class="fragment"><pre class="programlisting">
194 >> pzm = pzmodel(1, {1 2 3}, {4 5})
195 ---- pzmodel 1 ----
196 name: None
197 gain: 1
198 delay: 0
199 iunits: []
200 ounits: []
201 pole 001: (f=1 Hz,Q=NaN)
202 pole 002: (f=2 Hz,Q=NaN)
203 pole 003: (f=3 Hz,Q=NaN)
204 zero 001: (f=4 Hz,Q=NaN)
205 zero 002: (f=5 Hz,Q=NaN)
206 -------------------
207 >> pf = parfrac(pzm)
208 --- parfrac 1 ----
209 model: parfrac(None)
210 res: [0.999999999999999;-6.00000000000001;5.99999999999999]
211 poles: [-18.8495559215388;-12.5663706143592;-6.28318530717959]
212 dir: 0
213 pmul: [1;1;1]
214 iunits: []
215 ounits: []
216 -------------------
217 </pre></div>
218 <p>or in a plist</p>
219 <div class="fragment"><pre class="programlisting">
220 >> pzm = pzmodel(1, {1 2 3}, {4 5})
221 >> pl = plist(<span class="string">'pzmodel'</span>, pzm)
222 >> pf = parfrac(pl)
223 </pre></div>
224
225
226 <!-- --------------- NEXT EXAMPLE --------------- -->
227
228 <hr>
229 <h2 class="title"><a name="direct_values"></a>Construct an parfrac object from residuals, poles and direct terms</h2>
230 <p>The following example creates a new parfrac direct from the values.</p>
231 <div class="fragment"><pre class="programlisting">
232 >> res = [1;2+i*1;2-i*1];
233 >> poles = [6;1+i*3;1-i*3];
234 >> dir = 3;
235 >> name = <span class="string">'my parfrac'</span>;
236 >> iunits = <span class="string">'Hz'</span>;
237 >> ounits = <span class="string">'V'</span>;
238
239 >> pf = parfrac(res, poles, dir)
240 >> pf = parfrac(res, poles, dir, name)
241 >> pf = parfrac(res, poles, dir, name, iunits, ounits)
242 ---- parfrac 1 ----
243 model: my parfrac
244 res: [1;2+i*1;2-i*1]
245 poles: [6;1+i*3;1-i*3]
246 dir: 3
247 pmul: [1;1;1]
248 iunits: [Hz]
249 ounits: [V]
250 -------------------
251 </pre></div>
252
253
254 <!-- --------------- NEXT EXAMPLE --------------- -->
255
256 <hr>
257 <h2 class="title"><a name="plist"></a>Construct an parfrac object from a parameter list (<tt>plist</tt>)</h2>
258 <p>Constructs an parfrac object from the description given in the parameter list.</p>
259
260 <!-- --------------- Link box: begin --------------- -->
261 <table border="0" summary="Simple list" class="simplelist_nottable_last">
262 <tr>
263 <td>
264 <a href="constructor_examples_parfrac.html#hostname">Use the key word 'hostname'</a>
265 </td>
266 </tr>
267 <tr>
268 <td>
269 <a href="constructor_examples_parfrac.html#direct_terms">Use the key word 'res' or 'poles' or 'dir'</a>
270 </td>
271 </tr>
272 </table>
273 <!-- --------------- Link box: end --------------- -->
274
275
276 <!-- --------------- 'hostname' --------------- -->
277
278 <hr>
279 <h3 class="title"><a name="hostname"></a>Use the key word 'hostname'</h3>
280 <p>Construct an parfrac object by retrieving it from a LTPDA repository.
281 <p>The relevant parameters are:</p>
282 <p>
283 <table cellspacing="0" border="0" cellpadding="2" class="simplelist_nottable_last" width="80%">
284 <colgroup>
285 <col width="25%"/>
286 <col width="75%"/>
287 </colgroup>
288 <thead>
289 <tr valign="top">
290 <th class="subcategorylist">Key</th>
291 <th class="subcategorylist">Description</th>
292 </tr>
293 </thead>
294 <tbody>
295 <tr valign="top">
296 <td>
297 <p>'hostname'</p>
298 </td>
299 <td>
300 <p>the repository hostname. [default: 'localhost']</p>
301 </td>
302 </tr>
303 <tr valign="top">
304 <td>
305 <p>'database'</p>
306 </td>
307 <td>
308 <p>The database name [default: 'ltpda']</p>
309 </td>
310 </tr>
311 <tr valign="top">
312 <td>
313 <p>'id'</p>
314 </td>
315 <td>
316 <p>A vector of object IDs. [default: []]</p>
317 </td>
318 </tr>
319 <tr valign="top">
320 <td>
321 <p>'cid'</p>
322 </td>
323 <td>
324 <p>Retrieve all parfrac objects from a particular collection</p>
325 </td>
326 </tr>
327 <tr valign="top">
328 <td>
329 <p>'binary'</p>
330 </td>
331 <td>
332 <p>Set to 'yes' to retrieve from stored binary representation (not always available). [default: yes]</p>
333 </td>
334 </tr>
335 </tbody>
336 </table>
337 </p>
338 <div class="fragment"><pre class="programlisting">
339 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)
340 a1 = parfrac(pl)
341 </pre></div>
342
343
344 <!-- --------------- 'direct_terms' --------------- -->
345
346 <hr>
347 <h3 class="title"><a name="direct_terms"></a>Use the key word 'res' or 'poles' or 'dir'</h3>
348 <p>Construct an parfrac object direct from the residual, pole or direct terms.<br></br>
349 The relevant parameters are:</p>
350 <p>
351 <table cellspacing="0" border="0" cellpadding="2" class="simplelist_nottable_last" width="80%">
352 <colgroup>
353 <col width="25%"/>
354 <col width="75%"/>
355 </colgroup>
356 <thead>
357 <tr valign="top">
358 <th class="subcategorylist">Key</th>
359 <th class="subcategorylist">Description</th>
360 </tr>
361 </thead>
362 <tbody>
363 <tr valign="top">
364 <td>
365 <p>'res'</p>
366 </td>
367 <td>
368 <p>residuals [default: []]</p>
369 </td>
370 </tr>
371 <tr valign="top">
372 <td>
373 <p>'poles'</p>
374 </td>
375 <td>
376 <p>poles [default: []]</p>
377 </td>
378 </tr>
379 <tr valign="top">
380 <td>
381 <p>'dir'</p>
382 </td>
383 <td>
384 <p>direct terms [default: []]</p>
385 </td>
386 </tr>
387 </tbody>
388 </table>
389 </p>
390 <p>You can also specify optional parameters:</p>
391 <p>
392 <table cellspacing="0" border="0" cellpadding="2" class="simplelist_nottable_last" width="80%">
393 <colgroup>
394 <col width="25%"/>
395 <col width="75%"/>
396 </colgroup>
397 <thead>
398 <tr valign="top">
399 <th class="subcategorylist">Key</th>
400 <th class="subcategorylist">Description</th>
401 </tr>
402 </thead>
403 <tbody>
404 <tr valign="top">
405 <td>
406 <p>'name'</p>
407 </td>
408 <td>
409 <p>name of the parfrac object [default: 'none']</p>
410 </td>
411 </tr>
412 <tr valign="top">
413 <td>
414 <p>'xunits'</p>
415 </td>
416 <td>
417 <p>unit of the x-axis</p>
418 </td>
419 </tr>
420 <tr valign="top">
421 <td>
422 <p>'yunits'</p>
423 </td>
424 <td>
425 <p>unit of the y-axis</p>
426 </td>
427 </tr>
428 </tbody>
429 </table>
430 </p>
431 <div class="fragment"><pre class="programlisting">
432 res = [1;2+i*1;2-i*1];
433 poles = [6;1+i*3;1-i*3];
434 dir = 3;
435 name = <span class="string">'my parfrac'</span>;
436 iunits = <span class="string">'Hz'</span>;
437 ounits = <span class="string">'V'</span>;
438
439 pl = plist(<span class="string">'res'</span>, res, <span class="string">'poles'</span>, poles);
440 pf = parfrac(pl)
441 ---- parfrac 1 ----
442 model: None
443 res: [1;2+i*1;2-i*1]
444 poles: [6;1+i*3;1-i*3]
445 dir: 0
446 pmul: [1;1;1]
447 iunits: []
448 ounits: []
449 -------------------
450
451 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);
452 pf = parfrac(pl)
453 ---- parfrac 1 ----
454 model: my parfrac
455 res: [1;2+i*1;2-i*1]
456 poles: [6;1+i*3;1-i*3]
457 dir: 0
458 pmul: [1;1;1]
459 iunits: [Hz]
460 ounits: [V]
461 -------------------
462 </pre></div>
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501 </p>
502
503 <br>
504 <br>
505 <table class="nav" summary="Navigation aid" border="0" width=
506 "100%" cellpadding="0" cellspacing="0">
507 <tr valign="top">
508 <td align="left" width="20"><a href="constructor_examples_pzmodel.html"><img src=
509 "b_prev.gif" border="0" align="bottom" alt=
510 "Constructor examples of the PZMODEL class"></a>&nbsp;</td>
511
512 <td align="left">Constructor examples of the PZMODEL class</td>
513
514 <td>&nbsp;</td>
515
516 <td align="right">Constructor examples of the RATIONAL class</td>
517
518 <td align="right" width="20"><a href=
519 "constructor_examples_rational.html"><img src="b_next.gif" border="0" align=
520 "bottom" alt="Constructor examples of the RATIONAL class"></a></td>
521 </tr>
522 </table><br>
523
524 <p class="copy">&copy;LTP Team</p>
525 </body>
526 </html>