|
6 | 6 | "source": [ |
7 | 7 | "# Implementing Dynamic Matrix Control in Python\n", |
8 | 8 | "\n", |
9 | | - "- Author: Siang Lim, February 2020\n", |
10 | | - "- Contents are from this book: Hokanson, D. A., & Gerstle, J. G. (1992). Dynamic Matrix Control Multivariable Controllers. Practical Distillation Control, 248–271. doi:10.1007/978-1-4757-0277-4_12 " |
| 9 | + "#### Author: Siang Lim, February 2020\n", |
| 10 | + "\n", |
| 11 | + "** work in progress **\n", |
| 12 | + "\n", |
| 13 | + "- Contents of this notebook are derived from DMC literature:\n", |
| 14 | + " - Hokanson, D. A., & Gerstle, J. G. (1992). **Dynamic Matrix Control Multivariable Controllers.** Practical Distillation Control, 248–271.\n", |
| 15 | + " - Sorensen, R. C., & Cutler, C. R. (1998). **LP integrates economics into dynamic matrix control.** Hydrocarbon processing (International ed.), 77(9), 57-65.\n", |
| 16 | + " - Morshedi, A. M., Cutler, C. R., & Skrovanek, T. A. (1985, June). **Optimal solution of dynamic matrix control with linear programing techniques (LDMC).** In 1985 American Control Conference (pp. 199-208). IEEE." |
11 | 17 | ] |
12 | 18 | }, |
13 | 19 | { |
14 | 20 | "cell_type": "code", |
15 | | - "execution_count": 695, |
| 21 | + "execution_count": 1, |
16 | 22 | "metadata": { |
17 | 23 | "collapsed": true |
18 | 24 | }, |
|
22 | 28 | "import matplotlib.pyplot as plt" |
23 | 29 | ] |
24 | 30 | }, |
| 31 | + { |
| 32 | + "cell_type": "markdown", |
| 33 | + "metadata": {}, |
| 34 | + "source": [ |
| 35 | + "# Definitions\n", |
| 36 | + "\n", |
| 37 | + "#### Independent Variables\n", |
| 38 | + "\n", |
| 39 | + "- MV (Manipulated Variables)\n", |
| 40 | + " - Variables that we can move directly, valves, feed rate etc.\n", |
| 41 | + "\n", |
| 42 | + "- FF (Feedforward Variables)\n", |
| 43 | + " - Disturbances that we can't control directly - ambient temperature.\n", |
| 44 | + "\n", |
| 45 | + "#### Dependent Variables\n", |
| 46 | + "- Variables that change due to a change in the independent variables, e.g. temperatures, pressures\n" |
| 47 | + ] |
| 48 | + }, |
25 | 49 | { |
26 | 50 | "cell_type": "markdown", |
27 | 51 | "metadata": {}, |
|
44 | 68 | }, |
45 | 69 | { |
46 | 70 | "cell_type": "code", |
47 | | - "execution_count": 696, |
| 71 | + "execution_count": 2, |
48 | 72 | "metadata": { |
49 | 73 | "collapsed": true |
50 | 74 | }, |
|
55 | 79 | }, |
56 | 80 | { |
57 | 81 | "cell_type": "code", |
58 | | - "execution_count": 697, |
| 82 | + "execution_count": 3, |
59 | 83 | "metadata": {}, |
60 | 84 | "outputs": [ |
61 | 85 | { |
|
64 | 88 | "Text(0,0.5,'Response')" |
65 | 89 | ] |
66 | 90 | }, |
67 | | - "execution_count": 697, |
| 91 | + "execution_count": 3, |
68 | 92 | "metadata": {}, |
69 | 93 | "output_type": "execute_result" |
70 | 94 | }, |
|
121 | 145 | }, |
122 | 146 | { |
123 | 147 | "cell_type": "code", |
124 | | - "execution_count": 698, |
| 148 | + "execution_count": 4, |
125 | 149 | "metadata": {}, |
126 | 150 | "outputs": [ |
127 | 151 | { |
|
143 | 167 | }, |
144 | 168 | { |
145 | 169 | "cell_type": "code", |
146 | | - "execution_count": 699, |
| 170 | + "execution_count": 5, |
147 | 171 | "metadata": {}, |
148 | 172 | "outputs": [ |
149 | 173 | { |
150 | 174 | "data": { |
151 | 175 | "text/plain": [ |
152 | | - "[<matplotlib.lines.Line2D at 0x117eccef0>]" |
| 176 | + "[<matplotlib.lines.Line2D at 0x10e2d79e8>]" |
153 | 177 | ] |
154 | 178 | }, |
155 | | - "execution_count": 699, |
| 179 | + "execution_count": 5, |
156 | 180 | "metadata": {}, |
157 | 181 | "output_type": "execute_result" |
158 | 182 | }, |
|
192 | 216 | }, |
193 | 217 | { |
194 | 218 | "cell_type": "code", |
195 | | - "execution_count": 700, |
| 219 | + "execution_count": 6, |
196 | 220 | "metadata": {}, |
197 | 221 | "outputs": [ |
198 | 222 | { |
|
226 | 250 | }, |
227 | 251 | { |
228 | 252 | "cell_type": "code", |
229 | | - "execution_count": 701, |
230 | | - "metadata": {}, |
| 253 | + "execution_count": 7, |
| 254 | + "metadata": { |
| 255 | + "collapsed": true |
| 256 | + }, |
231 | 257 | "outputs": [], |
232 | 258 | "source": [ |
233 | 259 | "Y = np.multiply(A,U.T)\n", |
|
237 | 263 | }, |
238 | 264 | { |
239 | 265 | "cell_type": "code", |
240 | | - "execution_count": 702, |
| 266 | + "execution_count": 8, |
241 | 267 | "metadata": {}, |
242 | 268 | "outputs": [ |
243 | 269 | { |
|
255 | 281 | " [-0. , -1.999, -0. , -0. , 1.95 ]])" |
256 | 282 | ] |
257 | 283 | }, |
258 | | - "execution_count": 702, |
| 284 | + "execution_count": 8, |
259 | 285 | "metadata": {}, |
260 | 286 | "output_type": "execute_result" |
261 | 287 | } |
|
266 | 292 | }, |
267 | 293 | { |
268 | 294 | "cell_type": "code", |
269 | | - "execution_count": 703, |
| 295 | + "execution_count": 9, |
270 | 296 | "metadata": {}, |
271 | 297 | "outputs": [ |
272 | 298 | { |
|
276 | 302 | " array([1, 1, 1, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4]))" |
277 | 303 | ] |
278 | 304 | }, |
279 | | - "execution_count": 703, |
| 305 | + "execution_count": 9, |
280 | 306 | "metadata": {}, |
281 | 307 | "output_type": "execute_result" |
282 | 308 | } |
|
287 | 313 | }, |
288 | 314 | { |
289 | 315 | "cell_type": "code", |
290 | | - "execution_count": 704, |
| 316 | + "execution_count": 10, |
291 | 317 | "metadata": {}, |
292 | 318 | "outputs": [ |
293 | 319 | { |
|
296 | 322 | "array([1, 4])" |
297 | 323 | ] |
298 | 324 | }, |
299 | | - "execution_count": 704, |
| 325 | + "execution_count": 10, |
300 | 326 | "metadata": {}, |
301 | 327 | "output_type": "execute_result" |
302 | 328 | } |
|
307 | 333 | }, |
308 | 334 | { |
309 | 335 | "cell_type": "code", |
310 | | - "execution_count": 705, |
| 336 | + "execution_count": 11, |
311 | 337 | "metadata": {}, |
312 | 338 | "outputs": [ |
313 | 339 | { |
|
345 | 371 | }, |
346 | 372 | { |
347 | 373 | "cell_type": "code", |
348 | | - "execution_count": 706, |
| 374 | + "execution_count": 12, |
349 | 375 | "metadata": { |
350 | 376 | "collapsed": true |
351 | 377 | }, |
|
356 | 382 | }, |
357 | 383 | { |
358 | 384 | "cell_type": "code", |
359 | | - "execution_count": 707, |
| 385 | + "execution_count": 13, |
360 | 386 | "metadata": {}, |
361 | 387 | "outputs": [ |
362 | 388 | { |
|
383 | 409 | }, |
384 | 410 | { |
385 | 411 | "cell_type": "code", |
386 | | - "execution_count": 708, |
| 412 | + "execution_count": 14, |
387 | 413 | "metadata": { |
388 | 414 | "collapsed": true |
389 | 415 | }, |
|
396 | 422 | }, |
397 | 423 | { |
398 | 424 | "cell_type": "code", |
399 | | - "execution_count": 709, |
| 425 | + "execution_count": 15, |
400 | 426 | "metadata": {}, |
401 | 427 | "outputs": [ |
402 | 428 | { |
|
424 | 450 | }, |
425 | 451 | { |
426 | 452 | "cell_type": "code", |
427 | | - "execution_count": 710, |
| 453 | + "execution_count": 16, |
428 | 454 | "metadata": { |
429 | 455 | "collapsed": true |
430 | 456 | }, |
|
435 | 461 | }, |
436 | 462 | { |
437 | 463 | "cell_type": "code", |
438 | | - "execution_count": 711, |
| 464 | + "execution_count": 17, |
439 | 465 | "metadata": {}, |
440 | 466 | "outputs": [ |
441 | 467 | { |
|
463 | 489 | }, |
464 | 490 | { |
465 | 491 | "cell_type": "code", |
466 | | - "execution_count": 712, |
| 492 | + "execution_count": 18, |
467 | 493 | "metadata": { |
468 | 494 | "collapsed": true |
469 | 495 | }, |
|
485 | 511 | }, |
486 | 512 | { |
487 | 513 | "cell_type": "code", |
488 | | - "execution_count": 713, |
| 514 | + "execution_count": 19, |
489 | 515 | "metadata": { |
490 | 516 | "collapsed": true |
491 | 517 | }, |
|
543 | 569 | "$$ \\min (y^{sp} - y^{pc} + A\\Delta u)^2 $$" |
544 | 570 | ] |
545 | 571 | }, |
| 572 | + { |
| 573 | + "cell_type": "code", |
| 574 | + "execution_count": null, |
| 575 | + "metadata": { |
| 576 | + "collapsed": true |
| 577 | + }, |
| 578 | + "outputs": [], |
| 579 | + "source": [] |
| 580 | + }, |
546 | 581 | { |
547 | 582 | "cell_type": "code", |
548 | 583 | "execution_count": null, |
|
0 commit comments