I am trying to use GEKKO to do simple algebra.
Given the Equation 6 = X1 * X2, I first set X1 to 2 using the Gekko fix() function. After solving and printing that equation, I try freeing X1 using the Gekko free() function and fix X2 to 2 using the fix() function again. The free function doesn't seem to be properly freeing the X2 Variable.
from gekko import GEKKO
m = GEKKO()
# Variables
x1 = m.Var()
x2 = m.Var()
# Equation
FindX1 = 6 == x1*x2
m.Equation(FindX1)
# Fix x1 to 2
m.fix(x1, val=2)
# Solve X2
m.solve(disp=False)
print("X1: %s and X2: %s" % (x1.VALUE, x2.VALUE))
# Fix x2 to 2
m.fix(x2, val=2)
# Free x1
m.free(x1)
# Solve X1
m.solve(disp=False)
print("X1: %s and X2: %s" % (x1.VALUE, x2.VALUE))