Merge pull request #854 from bnavigator/iosys-doc-example · python-control/python-control@1f837a5

Original file line numberDiff line numberDiff line change

@@ -79,13 +79,13 @@ We begin by defining the dynamics of the system

7979

L = x[1]

8080
8181

# Compute the control action (only allow addition of food)

82-

u_0 = u if u > 0 else 0

82+

u_0 = u[0] if u[0] > 0 else 0

8383
8484

# Compute the discrete updates

8585

dH = (r + u_0) * H * (1 - H/k) - (a * H * L)/(c + H)

8686

dL = b * (a * H * L)/(c + H) - d * L

8787
88-

return [dH, dL]

88+

return np.array([dH, dL])

8989
9090

We now create an input/output system using these dynamics:

9191