I have a simple infeasible problem as below.
Maximize z = 4x1 + 3x2
2x1 - x2 >= 6
x1 + x2 <= 2
x1 and x2 >= 0
After solving I see that the termination status says 'ok' rather than saying 'infeasible'. May I know if something is wrong with the formulation in code?
# Create a concrete model
model = ConcreteModel()
# Define variables with initialization and domain
model.x1 = Var(domain=NonNegativeReals, initialize=0.0)
model.x2 = Var(domain=NonNegativeReals, initialize=0.0)
# Define the objective function
model.obj = Objective(expr=4 * model.x1 + 3 * model.x2, sense=maximize)
# Define the constraints
model.constraint1 = Constraint(expr=2 * model.x1 - model.x2 >= 6)
model.constraint2 = Constraint(expr=model.x1 + model.x2 <= 2)
# Solve the model using the GLPK solver
solver = SolverFactory('glpk')
results = solver.solve(model)