First time using Jump

Hello all,
I am new to JuMP and Julia.
I am getting this error:
LoadError: UndefVarError: @optimize! not defined
in expression starting at c:\Users\alex-\Documents\OR Lab\Introduction to Julia JuMP.jl:49

After @optimize!(model)

Could you help me out?

When running the following code. I have already installed JuMP and Highs with Pkg.add(" "):

using JuMP
using HiGHS

Pkg.status()

Methods/ dir()

varinfo(JuMP)

Declare Solver

using GLPK

Define the Model

model = Model(HiGHS.Optimizer)

Create Variables

@variable(model,x>=0)

@variable(model,y>=0)

Specify constraint

@constraint(model, y<=5)

@constraint(model,x<=10)

Define Objective Function

@objective(model, Max,5x + 6y)

Summary

@show model

Solving/ Optimizing

@optimize!(model)

1 Like

I think you need optimize!(model) not @optim...

2 Likes

Heres a tutorial to get started

Thank, that solved the problem!

1 Like