# JuMP Model Syntax

**URL:** https://discourse.julialang.org/t/jump-model-syntax/78668
**Category:** Optimization (Mathematical)
**Tags:** question, jump
**Created:** [March 29, 2022, 10:44am UTC](https://discourse.julialang.org/t/jump-model-syntax/78668 "2022-03-29T10:44:57Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![iAnkiit](https://avatars.discourse-cdn.com/v4/letter/i/c67d28/32.png) [@iAnkiit](https://discourse.julialang.org/u/iAnkiit)
#### Post date: [March 29, 2022, 10:44am UTC](https://discourse.julialang.org/t/jump-model-syntax/78668/1 "2022-03-29T10:44:57Z")

</div>

Do we need to write expression with jump macros only ? like @variable, @constraint, @Objective  
Or we can write it as plain text like model = ax+by^2

If yes, can we write in combination

Example : model = Model(Optimizer) (Optimizer :: MOI.OptimizerWithAttributes)  
@expression(model, eObj, 0)  
also ,  
model= ax+by^2

---

<div class="post-metadata">

### Author: ![Henrique\_Becker](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/henrique_becker/32/15443_2.png) [@Henrique\_Becker](https://discourse.julialang.org/u/Henrique_Becker)
#### Post date: [March 29, 2022, 1:50pm UTC](https://discourse.julialang.org/t/jump-model-syntax/78668/2 "2022-03-29T13:50:03Z")

</div>

I do believe the options are:

1. Use the JuMP macros.
2. You can directly construct the objects `@expression` will return to you (using, for example, [Expressions · JuMP](https://jump.dev/JuMP.jl/stable/reference/expressions/#JuMP.GenericAffExpr)).
3. You can write the model in some common format (to a file or a string) and then read the model from it (see: [Overview · JuMP](https://jump.dev/JuMP.jl/stable/moi/submodules/FileFormats/overview/#Read-from-file)).

I am not entirely sure what you mean by writing in plain text. In your example, `a`, `x`, `b`, and `y` are what? They were already defined before this point?
