# Getting problem data from jump model (semidefinite programming, etc.)

**URL:** <https://discourse.julialang.org/t/getting-problem-data-from-jump-model-semidefinite-programming-etc/59327>\
**Category:** Optimization (Mathematical)\
**Tags:** jump, optimization\
**Created:** [April 15, 2021, 10:18am UTC](https://discourse.julialang.org/t/getting-problem-data-from-jump-model-semidefinite-programming-etc/59327 "2021-04-15T10:18:15Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Thomas](https://avatars.discourse-cdn.com/v4/letter/t/e36b37/32.png) [@Thomas](https://discourse.julialang.org/u/Thomas)\
**Post date:** [April 15, 2021, 10:18am UTC](https://discourse.julialang.org/t/getting-problem-data-from-jump-model-semidefinite-programming-etc/59327/1 "2021-04-15T10:18:15Z")

</div>

Hi everyone, after a quick search here and the API, I have not seen this question addressed to my liking so let me raise it:

- How to get the problem data in canonical form min dot(C,x) subject to Ax=b, that is from a model return the data C,A,b? This is very similar to print(model) or write a model to file. Also I dont know if this should be a MOI question instead of JuMP.
- How about other problems where there are canonical forms like polynomial optimization?

---

<div class="post-metadata">

**Author:** ![odow](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/odow/32/28685_2.png) [@odow](https://discourse.julialang.org/u/odow)\
**Post date:** [April 18, 2021, 5:14am UTC](https://discourse.julialang.org/t/getting-problem-data-from-jump-model-semidefinite-programming-etc/59327/2 "2021-04-18T05:14:01Z")

</div>

JuMP uses a novel standard form for representing problems, so we don’t store the problem in the `canonical form min dot(C,x) subject to Ax=b`. (For reasons and motivation, see: [[2002.03447] MathOptInterface: a data structure for mathematical optimization problems](https://arxiv.org/abs/2002.03447))

We currently don’t provide tools to access the matrix data because there are a variety of different forms people could want. However, there’s a work-in-process: [https://github.com/jump-dev/MatrixOptInterface.jl](https://github.com/jump-dev/MatrixOptInterface.jl).

For now, you can access the constraints in the model using: [Constraints · JuMP](https://jump.dev/JuMP.jl/stable/manual/constraints/#Accessing-constraints-from-a-model)

This code should give you the general idea: [JuMP.jl/lp\_sensitivity2.jl at e2b6ee959c827d60f0c8178a813fddb6e21048b2 · jump-dev/JuMP.jl · GitHub](https://github.com/jump-dev/JuMP.jl/blob/e2b6ee959c827d60f0c8178a813fddb6e21048b2/src/lp_sensitivity2.jl#L301-L410)  
You _could_ call it from JuMP using `JuMP._standard_form_matrix`, but functions beginning with `_` are private, and could change in any future release so you shouldn’t rely on this.

---

<div class="post-metadata">

**Author:** ![blegat](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/blegat/32/217090_2.png) [@blegat](https://discourse.julialang.org/u/blegat)\
**Post date:** [April 18, 2021, 7:42am UTC](https://discourse.julialang.org/t/getting-problem-data-from-jump-model-semidefinite-programming-etc/59327/3 "2021-04-18T07:42:53Z")

</div>

> How about other problems where there are canonical forms like polynomial optimization?

You can solve polynomial optimization problems using [SumOfSquares](https://github.com/jump-dev/SumOfSquares.jl/). See [this example](https://jump.dev/SumOfSquares.jl/stable/generated/Polynomial%20Optimization/).
