From dda5258cdfa0b9b482a9adfb0d23807a0daf69e9 Mon Sep 17 00:00:00 2001 From: Ben Greiner Date: Thu, 26 Jan 2023 23:36:34 +0100 Subject: [PATCH] Ensure array for updatefcn input --- doc/iosys.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/iosys.rst b/doc/iosys.rst index 1f5f21e69..0f6a80b4d 100644 --- a/doc/iosys.rst +++ b/doc/iosys.rst @@ -79,13 +79,13 @@ We begin by defining the dynamics of the system L = x[1] # Compute the control action (only allow addition of food) - u_0 = u if u > 0 else 0 + u_0 = u[0] if u[0] > 0 else 0 # Compute the discrete updates dH = (r + u_0) * H * (1 - H/k) - (a * H * L)/(c + H) dL = b * (a * H * L)/(c + H) - d * L - return [dH, dL] + return np.array([dH, dL]) We now create an input/output system using these dynamics: