# Converting GAMS script to JuMP: Marginal values

**URL:** <https://discourse.julialang.org/t/converting-gams-script-to-jump-marginal-values/11199>\
**Category:** Optimization (Mathematical)\
**Tags:** question, jump\
**Created:** [May 28, 2018, 2:31pm UTC](https://discourse.julialang.org/t/converting-gams-script-to-jump-marginal-values/11199 "2018-05-28T14:31:27Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Libbum](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/libbum/32/3935_2.png) [@Libbum](https://discourse.julialang.org/u/Libbum)\
**Post date:** [May 28, 2018, 2:31pm UTC](https://discourse.julialang.org/t/converting-gams-script-to-jump-marginal-values/11199/1 "2018-05-28T14:31:27Z")

</div>

Hi all,

Hopefully just a quick question here: I’m new to optimisation solvers in general so this may something I’ve missed.

I’m converting a GAMS script into a JuMP solution (using Ipopt). After the optimisation step, my GAMS script sometimes uses the ‘level’ values of a time dependent variable `var.l(t)`, and at other times the ‘marginal’ value `var.m(t)`.

Is this marginal value equivalent to the ‘reduced cost’ available via `getdual(var)` in JuMP parlance?

Not all of my implementation is matching up, so I can’t quite test the answer for myself at the moment.

---

<div class="post-metadata">

**Author:** ![NiclasMattsson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/niclasmattsson/32/21988_2.png) [@NiclasMattsson](https://discourse.julialang.org/u/NiclasMattsson)\
**Post date:** [May 28, 2018, 2:58pm UTC](https://discourse.julialang.org/t/converting-gams-script-to-jump-marginal-values/11199/2 "2018-05-28T14:58:57Z")

</div>

Yes. And similarly for shadow costs (dual values of constraints): `constraint.m` in GAMS is the same as `getdual(constraint)` in JuMP.

---

<div class="post-metadata">

**Author:** ![Libbum](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/libbum/32/3935_2.png) [@Libbum](https://discourse.julialang.org/u/Libbum)\
**Post date:** [May 29, 2018, 12:03pm UTC](https://discourse.julialang.org/t/converting-gams-script-to-jump-marginal-values/11199/3 "2018-05-29T12:03:07Z")

</div>

Excellent! Thanks Niclas.
