comparison m-toolbox/html_help/help/ug/ltpda_training_topic_4_3.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>Modelling a system (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 "ltpda_training_topic_4_2.html"><img src="b_prev.gif" border="0" align=
30 "bottom" alt="Transforming models between representations"></a>&nbsp;&nbsp;&nbsp;<a href=
31 "ltpda_training_topic_4_4.html"><img src="b_next.gif" border="0" align=
32 "bottom" alt="How to filter data"></a></td>
33 </tr>
34 </table>
35
36 <h1 class="title"><a name="f3-12899" id="f3-12899"></a>Modelling a system</h1>
37 <hr>
38
39 <p>
40 <p>
41 To show some of the possibilities of the toolbox to model digital system we
42 introduce the usual notation for a closed loop model
43 </p>
44 <div align="center">
45 <img src="images/ltpda_training_1/topic4/ClosedLoop.png" alt="Closed Loop" border="3">
46 </div>
47 <p>
48 In our example we will assume that we know the <tt>pzmodel</tt> of the filter,
49 <tt>H</tt>, and the open loop gain (OLG). These are related with the closed
50 loop gain (CLG) by the following equation
51 </p>
52 <br>
53 <div align="center">
54 <img src="images/ltpda_training_1/topic4/ClosedLoop_eq.png" border="3">
55 </div>
56 <br>
57 <p>
58 We want to determine H and CLG. We would also like to find a digital filter
59 for H, but we will deal with this in the following section.
60 </p>
61 <h2>Loading the starting models</h2>
62 <p>
63 Imagine that we have somehow managed to find the following model for OLG
64 </p>
65 <table cellspacing="0" class="body" cellpadding="2" border="0" width="50%">
66 <colgroup>
67 <col width="15%"/>
68 <col width="35%"/>
69 </colgroup>
70 <thead>
71 <tr valign="top">
72 <th class="categorylist">Key</th>
73 <th class="categorylist">Value</th>
74 </tr>
75 </thead>
76 <tbody>
77 <!-- Key 'filename' -->
78 <tr valign="top">
79 <td bgcolor="#f3f4f5">
80 <p><tt>GAIN</tt></p>
81 </td>
82 <td bgcolor="#f3f4f5">
83 4e6
84 </td>
85 </tr>
86 <!-- Key 'filename' -->
87 <tr valign="top">
88 <td bgcolor="#f3f4f5">
89 <p><tt>POLES</tt></p>
90 </td>
91 <td bgcolor="#f3f4f5">
92 1e-6
93 </td>
94 </tr>
95 </tbody>
96 </table>
97 <p>
98 then we can create a <tt>pzmodel</tt> with these parameters as follows
99 </p>
100 <div class="fragment"><pre>
101 OLG = pzmodel(4e6,1e-6,[],<span class="string">'OLG'</span>)
102 ---- pzmodel 1 ----
103 name: OLG
104 gain: 4000000
105 delay: 0
106 iunits: []
107 ounits: []
108 description:
109 UUID: 3d8bce32-a9a9-4e72-ab4d-183da69a9b5d
110 pole 001: (f=1e-06 Hz,Q=NaN)
111 -------------------
112 </pre></div>
113 <p>
114 To introduce the second model, the one describing <tt>H</tt>, we will show another feature
115 of the <tt>pzmodel</tt> constructor. We will read it from a LISO file,
116 since this contructor accepts this files as inputs. We can then type
117 </p>
118 <div class="fragment"><pre>
119 H = pzmodel(<span class="string">'topic4/LISOfile.fil'</span>)
120 ---- pzmodel 1 ----
121 name: none
122 gain: 1000000000
123 delay: 0
124 iunits: []
125 ounits: []
126 description:
127 UUID: e683b32f-4653-474e-b457-939d33aeb63c
128 pole 001: (f=1e-06 Hz,Q=NaN)
129 pole 002: (f=1e-06 Hz,Q=NaN)
130 zero 001: (f=0.001 Hz,Q=NaN)
131 -------------------
132 </pre></div>
133 <pp>
134 and we see how the constructor recognizes and translates the poles and zeros in the file.
135 The model gets the name from the file but we can easily change it to have
136 the name of our model
137 </pp>
138 <div class="fragment"><pre>
139 H.setName;
140 </pre></div>
141 <pp>
142 According to our previous definition we can get the <tt>plant</tt> by dividing the
143 OLG by H. We can do so directly when dealing with <tt>pzmodel</tt> objects
144 since multiplication and division are allowed for these objects, then
145 </pp>
146 <div class="fragment"><pre>
147 G = OLG/H
148 ---- pzmodel 1 ----
149 name: (OLG./H)
150 gain: 0.004
151 delay: 0
152 iunits: []
153 ounits: []
154 description:
155 UUID: fcd166f7-d726-4d39-ad2e-0f3b7141415b
156 pole 001: (f=1e-06 Hz,Q=NaN)
157 pole 002: (f=0.001 Hz,Q=NaN)
158 zero 001: (f=1e-06 Hz,Q=NaN)
159 zero 002: (f=1e-06 Hz,Q=NaN)
160 -------------------
161 </pre></div>
162 <pp>
163 which we need to simplify to get rid of cancelling poles and zeros. We also
164 set the model name here.
165 </pp>
166 <div class="fragment"><pre>
167 G.setName;
168 G.simplify
169 ---- pzmodel 1 ----
170 name: simplify(G)
171 gain: 0.004
172 delay: 0
173 iunits: []
174 ounits: []
175 description:
176 UUID: c1883713-b860-4942-a127-e42ea565460f
177 pole 001: (f=0.001 Hz,Q=NaN)
178 zero 001: (f=1e-06 Hz,Q=NaN)
179 -------------------
180 </pre></div>
181 <pp>
182 The CLG requires more than a simple multiplication or division between models
183 and we will not be able to derive a <tt>pzmodel</tt> for it. However, we can
184 evaluate the response of this object as follows
185 </pp>
186 <div class="fragment"><pre>
187 pl = plist(<span class="string">'f1'</span>,1e-3,<span class="string">'f2'</span>,5,<span class="string">'nf'</span>,100);
188 CLG = 1/(1-resp(OLG,pl));
189 CLG.setName();
190 CLG.iplot();
191 </pre></div>
192 <pp>
193 which gives us an AO that we can plot
194 </pp>
195 <div align="center">
196 <img src="images/ltpda_training_1/topic4/ClosedLoop_resp.png" alt="Closed Loop response" width="800px" border="1">
197 </div>
198 <h2>Fine, but my (real) system has a delay...</h2>
199 <p>
200 You can now repeat the same procedure but loading a <tt>H</tt> model with a delay
201 from the LISO file 'LISOFileDelay.fil'
202 </p>
203 <div class="fragment"><pre>
204 >> HDel = pzmodel(<span class="string">'topic4/LISOfileDelay.fil'</span>)
205 ---- pzmodel 1 ----
206 name: none
207 gain: 1000000000
208 delay: 0.125
209 iunits: []
210 ounits: []
211 description:
212 UUID: 6dfbddc5-b186-4405-8f6e-02a2822a22c5
213 pole 001: (f=1e-06 Hz,Q=NaN)
214 pole 002: (f=1e-06 Hz,Q=NaN)
215 zero 001: (f=0.001 Hz,Q=NaN)
216 -------------------
217 HDel.setName();
218 pl = plist(<span class="string">'f1'</span>,1e-3,<span class="string">'f2'</span>,5,<span class="string">'nf'</span>,100);
219 resp([H, HDel],pl)
220 </pre></div>
221 <p>
222 you will see how the delay is correctly handled, meaning that it is added when
223 we multiply two models and substracted if the models are divided.
224 </p>
225 <div align="center">
226 <img src="images/ltpda_training_1/topic4/ClosedLoop_H_delay.png" alt="Response with delay" width="800px" border="1">
227 <img src="images/ltpda_training_1/topic4/ClosedLoop_G_delay.png" alt="Response with delay" width="800px" border="1">
228 </div>
229
230
231
232
233
234
235
236 </p>
237
238 <br>
239 <br>
240 <table class="nav" summary="Navigation aid" border="0" width=
241 "100%" cellpadding="0" cellspacing="0">
242 <tr valign="top">
243 <td align="left" width="20"><a href="ltpda_training_topic_4_2.html"><img src=
244 "b_prev.gif" border="0" align="bottom" alt=
245 "Transforming models between representations"></a>&nbsp;</td>
246
247 <td align="left">Transforming models between representations</td>
248
249 <td>&nbsp;</td>
250
251 <td align="right">How to filter data</td>
252
253 <td align="right" width="20"><a href=
254 "ltpda_training_topic_4_4.html"><img src="b_next.gif" border="0" align=
255 "bottom" alt="How to filter data"></a></td>
256 </tr>
257 </table><br>
258
259 <p class="copy">&copy;LTP Team</p>
260 </body>
261 </html>