The problem is that you are mixing scalar and array representations of state, plus x1
is not defined:
logistic_eom(x, p, t) = SVector{1}(p[1]*x1)
state = zeros(1)
Note that x1
is a scalar that doesn’t appear in the argument list, and state
is a 1-D vector. You should follow @Datseris’s answer very closely, where x
is a scalar and f
returns a scalar.
According to the documentation:
Comment on 1-D
One dimensional discrete systems expect the state always as a pure number,0.8
instead ofSVector(0.8)
.
You’ll probably want logistic_eom(x1,p,t) = p[1]*x1
to be consistent on both left and right-hand sides, and your initial state will also have to be scalar.
EDIT: Forgot to say try to format your code for readability and follow these instructions.