How to set variable value at x[3]=6 (not initial condition) in Python Gekko?
问题 I can set an initial condition y(0)=5 in Gekko with y = m.Var(5) but how do I set a value that is not the initial condition such as y(3)=6 where the value at time=3 is 6 as shown by the red dot? from gekko import GEKKO import numpy as np import matplotlib.pyplot as plt m = GEKKO(remote=False) m.time = np.linspace(0,10,11) x = m.Var(np.ones(11)*6) m.Equation(5*x.dt() == -x) m.options.IMODE = 4 m.solve() plt.plot(m.time, x.value) plt.plot([3],[6],'ro',MarkerSize=5) plt.show() I have a