from gekko import GEKKO m = GEKKO(remote=False) # create GEKKO model y = m.Var(5.0,name='y') # create GEKKO variable m.Equation(y.dt()==-y) # create GEKKO equation m.time = [0,1,2,3] # time points m.options.IMODE = 4 # simulation mode m.options.NODES = 4 # set NODES=4 m.options.CSV_WRITE=2 # write results_all.json # with internal nodes m.solve() # solve m.open_folder() # open run folder to see # source and results files import matplotlib.pyplot as plt # plot at [0,1,2,3] plt.plot(m.time,y,'ro') # retrieve internal nodes from results_all.json import json with open(m.path+'//results_all.json') as f: results = json.load(f) plt.plot(results['time'],results['y'],'bx') plt.show()