estoy tratando de programar un ejercicio no lineal pero me sale el siguiente error
LoadError: The solver does not support an objective function of type MathOptInterface.ScalarQuadraticFunction{Float64}.
estoy tratando de programar un ejercicio no lineal pero me sale el siguiente error
LoadError: The solver does not support an objective function of type MathOptInterface.ScalarQuadraticFunction{Float64}.
Puedes dar un ejemplo que causa el error?
este es el codigo que hice
m=Model(with_optimizer(Cbc.Optimizer))
# variables
@variable(m, x >= 0)
@variable(m, y >= 0)
@variable(m, z >= 0)
# restricciones
@constraint(m, x>=50)
@constraint(m, x-50+y>=50)
@constraint(m, x+y-100+z>=50)
# funcion objetivo
@objective(m, Min, x^2+y^2+z^2+12(x-50)+12(x+y-50))
`optimize!(m)`
# valor de la funcion objetivo
F = x^2+y^2+z^2+12(x-50)+12(x+y-50)
#imprimimos los resultados
println("El valor de la variable x es:", JuMP.value(x))
println("El valor de la variable y es:", JuMP.value(y))
println("El valor de la variable z es:", JuMP.value(z))
println("El valor optimo de nuestro sistema es:", JuMP.value(F))`Preformatted text`
Parece que te faltar llamar a optimize!(m)
, puesto que lo tienes en “backticks”