# How to compute expoents using JuMP?

**URL:** https://discourse.julialang.org/t/how-to-compute-expoents-using-jump/10727
**Category:** General Usage
**Tags:** jump
**Created:** [May 5, 2018, 3:32pm UTC](https://discourse.julialang.org/t/how-to-compute-expoents-using-jump/10727 "2018-05-05T15:32:23Z")
**Posts on this page:** 1
**Showing post:** 2

<div class="post-metadata">

### Author: ![tkoolen](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tkoolen/32/1603_2.png) [@tkoolen](https://discourse.julialang.org/u/tkoolen)
#### Post date: [May 6, 2018, 2:01am UTC](https://discourse.julialang.org/t/how-to-compute-expoents-using-jump/10727/2 "2018-05-06T02:01:56Z")

</div>

Could you [quote your code](https://discourse.julialang.org/t/psa-how-to-quote-code-with-backticks/7530) in the future? It makes it easier for people to run your code, and increases your chances of getting a quick response.

You seem to be using a very old version of JuMP (`@defVar` hasn’t been a thing for a long time). Which version of JuMP are you on? Which version of Julia are you on? FYI it’s not recommended to install Julia via `apt-get` as it’s changing so quickly (just a guess); just download 0.6.2 from [Download Julia](https://julialang.org/downloads/).

JuMP doesn’t define `^(::Float64, ::JuMP.Variable)`. This is because the ‘default’ interface (using `@expression`, `@objective`, and `@constraint` in the latest version of JuMP) only supports affine and quadratic expressions. Using a `JuMP.Variable` as the exponent cannot result in such an expression. you may want to use [`@NLexpression`](http://www.juliaopt.org/JuMP.jl/0.18/nlp.html) /`@NLobjective`/`@NLconstraint` instead

---

_[View the full topic](https://discourse.julialang.org/t/how-to-compute-expoents-using-jump/10727)._
