IndexError: index 2 is out of bounds for axis 0 with size 2

(Answer courtsey of Warren Weckesser, provided in the comments to the question.)

You have Y0 = [E0, C0]. If the system is three-dimensional, then Y0 must have three values, so something like Y0 = [E0, C0, l0] where l0 is the initial condition for l(t).

Leave a Comment