|
63 | 63 | "def predprey_update(t, x, u, params):\n", |
64 | 64 | " \"\"\"Predator prey dynamics\"\"\"\n", |
65 | 65 | " r, d, b, k, a, c = map(params.get, ['r', 'd', 'b', 'k', 'a', 'c'])\n", |
66 | | - " u = np.atleast_1d(u) # Fix python-control bug\n", |
67 | 66 | " u = np.clip(u, -r, r)\n", |
68 | 67 | "\n", |
69 | 68 | " # Dynamics for the system\n", |
|
318 | 317 | "cell_type": "markdown", |
319 | 318 | "metadata": {}, |
320 | 319 | "source": [ |
321 | | - "We see that the controller no longer stabilizes the equilibrium point (shown with the dashed lines). In particular, the steady state value of the Lynx population does to almost twice the original value.\n", |
| 320 | + "We see that the controller no longer stabilizes the equilibrium point (shown with the dashed lines). In particular, the steady state value of the lynx population does to almost twice the original value.\n", |
322 | 321 | "\n", |
323 | 322 | "This effect is even worse if we increase $r$ just a bit more (from 1.65 to 1.7)." |
324 | 323 | ] |
|
375 | 374 | "# Simulate with a change in food for the hares\n", |
376 | 375 | "T = np.linspace(0, 100, 500)\n", |
377 | 376 | "response = ct.input_output_response(\n", |
378 | | - " predprey_pi, T, xe[1], [25, 25], params={'r': 1.65})\n", |
| 377 | + " predprey_pi, T, xe[1], [25, 25, 0], params={'r': 1.65})\n", |
379 | 378 | "ct.time_response_plot(\n", |
380 | 379 | " response, plot_inputs=False, overlay_signals=True,\n", |
381 | 380 | " title=\"I/O response w/ integral action, \" +\n", |
|
0 commit comments