# Querying the coefficient of a variable in a constraint

**URL:** <https://discourse.julialang.org/t/querying-the-coefficient-of-a-variable-in-a-constraint/4236>\
**Category:** Optimization (Mathematical)\
**Created:** [June 12, 2017, 11:50pm UTC](https://discourse.julialang.org/t/querying-the-coefficient-of-a-variable-in-a-constraint/4236 "2017-06-12T23:50:16Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Amulya\_Yadav](https://avatars.discourse-cdn.com/v4/letter/a/f14d63/32.png) [@Amulya\_Yadav](https://discourse.julialang.org/u/Amulya_Yadav)\
**Post date:** [June 12, 2017, 11:50pm UTC](https://discourse.julialang.org/t/querying-the-coefficient-of-a-variable-in-a-constraint/4236/1 "2017-06-12T23:50:16Z")

</div>

Hi,

I have built a model using JuMP. Now, I want to be able to get the A matrix for my constraints (i.e., the coefficient matrix in Ax\<b if my problem is represented in standard form. Is there any way to get this matrix?

Alternatively, is there a way I can get the coefficient associated with a variable on a particular constraint in Julia? If I can get this, I can construct my A matrix via processing.

I shall be grateful for any pointers.

Thanks,  
Amulya

---

<div class="post-metadata">

**Author:** ![joaquimg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/joaquimg/32/223_2.png) [@joaquimg](https://discourse.julialang.org/u/joaquimg)\
**Post date:** [June 22, 2017, 6:30pm UTC](https://discourse.julialang.org/t/querying-the-coefficient-of-a-variable-in-a-constraint/4236/2 "2017-06-22T18:30:31Z")

</div>

If you go to the definition of the `build` function in JuMP source you can find functions used to build the problem such as: `A = prepConstrMatrix(m)`
