# Get results from CBC solver for optimization

**URL:** <https://discourse.julialang.org/t/get-results-from-cbc-solver-for-optimization/81135>\
**Category:** Optimization (Mathematical)\
**Tags:** question, jump\
**Created:** [May 16, 2022, 8:42am UTC](https://discourse.julialang.org/t/get-results-from-cbc-solver-for-optimization/81135 "2022-05-16T08:42:07Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![math\_opt](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/math_opt/32/25317_2.png) [@math\_opt](https://discourse.julialang.org/u/math_opt)\
**Post date:** [May 16, 2022, 10:05am UTC](https://discourse.julialang.org/t/get-results-from-cbc-solver-for-optimization/81135/4 "2022-05-16T10:05:23Z")

</div>

It is working fine for me:  
If we take the following example:

```julia
using JuMP
using Gurobi

model = Model()
set_optimizer(model, Gurobi.Optimizer)

#Define variables
@variable(model, x>=0)
@variable(model, y>=0)

#Define Constraints
@constraint(model, c1, 3x+2y<=66)
@constraint(model, c2, 9x+4y<=180)
@constraint(model, c3, 2x+10y<=200)

#Define Objective
@objective(model, Max, 90x+75y)

optimize!(model)

```

Now, to extract values:

```julia
objective_value(model) #returns 2250.0
value(x) # returns 10.0
value(y) #returns 18.0
value(c1) #returns 66.0 
value(c2) #returns 162.0 
value(c3) #returns 200.0 

```

This [link](https://discourse.julialang.org/t/please-read-make-it-easier-to-help-you/14757) helps explain what makes it easier for others to help you out. Maybe you want to share an MWE(minimal working example) which would make it easier for others to debug.

Also, update your `JuMP` version if you are using an old version.

---

_[View the full topic](https://discourse.julialang.org/t/get-results-from-cbc-solver-for-optimization/81135)._
