# AMPL to jump

**URL:** <https://discourse.julialang.org/t/ampl-to-jump/56760>\
**Category:** Optimization (Mathematical)\
**Created:** [March 8, 2021, 7:26pm UTC](https://discourse.julialang.org/t/ampl-to-jump/56760 "2021-03-08T19:26:39Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![aaldik](https://avatars.discourse-cdn.com/v4/letter/a/7cd45c/32.png) [@aaldik](https://discourse.julialang.org/u/aaldik)\
**Post date:** [March 8, 2021, 7:26pm UTC](https://discourse.julialang.org/t/ampl-to-jump/56760/1 "2021-03-08T19:26:39Z")

</div>

Dears

I have a question regarding solving a problem that was written in AMPL using Jump. Is there a specific function that allows for translating an ampl file into a recognized file by jump? what is the most efficient way to achieve that?

Regards

---

<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:** [March 8, 2021, 7:34pm UTC](https://discourse.julialang.org/t/ampl-to-jump/56760/2 "2021-03-08T19:34:50Z")

</div>

> Is there a specific function that allows for translating an ampl file into a recognized file by jump?

No.

> what is the most efficient way to achieve that?

You should translate the problem manually.

---

<div class="post-metadata">

**Author:** ![tmigot](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tmigot/32/23914_2.png) [@tmigot](https://discourse.julialang.org/u/tmigot)\
**Post date:** [April 20, 2021, 6:10pm UTC](https://discourse.julialang.org/t/ampl-to-jump/56760/3 "2021-04-20T18:10:01Z")

</div>

Depending on what you want to do with your problem, it is possible to use NLPModels.jl structure instead of JuMP, and use [AmplNLReader](https://github.com/JuliaSmoothOptimizers/AmplNLReader.jl) to read .nl files generated by AMPL.

---

<div class="post-metadata">

**Author:** ![aaldik](https://avatars.discourse-cdn.com/v4/letter/a/7cd45c/32.png) [@aaldik](https://discourse.julialang.org/u/aaldik)\
**Post date:** [April 22, 2021, 6:30pm UTC](https://discourse.julialang.org/t/ampl-to-jump/56760/4 "2021-04-22T18:30:31Z")

</div>

If I have a working AMPL file, can I solve it with JuMP? Can JuMP solve .nl files if I could generate it from AMPL?

---

<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 22, 2021, 7:31pm UTC](https://discourse.julialang.org/t/ampl-to-jump/56760/5 "2021-04-22T19:31:29Z")

</div>

> Can JuMP solve .nl files if I could generate it from AMPL?

No. If you can generate an NL file from AMPL, why do you need JuMP?

You can go the reverse: use AmplNLWriter to get JuMP to write NL files

> **[GitHub - jump-dev/AmplNLWriter.jl: Julia interface to AMPL-enabled solvers](https://github.com/jump-dev/AmplNLWriter.jl)**
>
> Julia interface to AMPL-enabled solvers. Contribute to jump-dev/AmplNLWriter.jl development by creating an account on GitHub.
