I use pyomo and gurobi for solving a nonlinear optimization problem. but when I run my code, I get this error:
RuntimeError: Cannot write legal LP file. Objective 'Maximum_profit' has nonlinear terms that are not quadratic.
(I don't have any problem when I use gurobi as a solver in a linear optimization problem.) My objective function is:
Maximum_profit=pyo.Objective(doc="Profit Maximization", rule=lambda model: sum(pyo.log10(1+sum(pyo.log10(1.0 + model.t[i,k]) for i in model.N)) for k in model.J) - sum(sum(model.t[i,k] * model.p[i,k] for k in model.J) for i in model.N),sense=-1)
how can I fix it?