I'm faced with an Hessenberg index-2 DAE, I'm trying to solve it using the python module gekko. After a few days of trial and error, I think I'm not too far from a code that works. But I've just realized that maybe gekko is not able to handle complex numbers?
Here is a minimal working example:
import numpy as np
from gekko import GEKKO
# Define the simulation and its parameters
g = GEKKO()
g.options.IMODE = 7
g.options.NODES = 1
# define the time array
n_steps = 100
Time = np.linspace(0, 2 * np.pi, n_steps)
g.time = Time
# Initialise the variables
x = g.Var(0.0)
# Write the model's equations
g.Equation(x.dt() == 1.0j * x)
# solve the equations
g.solve(disp = False)
print(x.value)
If I try to run this code, I expect to find the standard complex exponential. But instead, I get the following error:
File "gekko.py", line 2185, in solve
raise Exception(response)
Exception: @error: Model Expression
*** Error in syntax of function string: Missing operator
Position: 9
$v1-(((1j)*(v1)))
Could you confirm that gekko cannot handle complex numbers? And maybe suggest another python DAE solver that does?
Thank you so much!