- installed the Engine.
- installed your authentication token.

` ````
OCTERACT 111 0 0001020304 1 0 2 LP MIP RMIP NLP MCP MPEC RMPEC CNS DNLP RMINLP MINLP QCP MIQCP RMIQCP EMP
gmsgennt.cmd
gmsgennx.exe
libocteract.dll oct 1 0
```

` ````
$offdigit
*Declare variables
VARIABLES x1,x2,x3,x4,x5;
VARIABLES objvar;
*Declare equations (such as constraints, etc)
EQUATIONS con1,objeqn;
*Define what the equations declared above are equal to
con1 .. 4*x5+11*x3+7*x4+12*x2+20*x1+0=L=40;
objeqn .. (-50*(x5)**(2))+(-50*(x3)**(2))+(-50*(x2)**(2))
+(-50*(x1)**(2))+(-50*(x4)**(2))+47.5*x5+45*x3+
47*x4+44*x2+42*x1+0 - objvar =E= 0;
* set non default upper bounds
x1.up = 1;
x2.up = 1;
x3.up = 1;
x4.up = 1;
x5.up = 1;
* set non default lower bounds
x1.lo = 0;
x2.lo = 0;
x3.lo = 0;
x4.lo = 0;
x5.lo = 0;
*declare the model name and state that all equations should be included as part of it
Model m / all /;
m.limrow=0; m.limcol=0;
*setting 8 cores for usage with Octeract Engine
m.threads=8;
$if NOT '%gams.u1%' == '' $include '%gams.u1%'
*set Octeract as the solver to solve the problem
option nlp=octeract;
*state the model will be solved using the defined NLP solver and minimising the objective function
Solve m using NLP minimizing objvar;
```

` ````
*setting 8 cores for usage with Octeract Engine
m.threads=8;
```

If successful, it will print out the optimal solution for your model.

You've just solved an optimisation problem using GAMS.

- installed the Engine.
- installed your authentication token.

` ````
chmod 755 /home/$USER/Downloads/linux_x64_64_sfx.exe
```

`mkdir /home/$USER/Documents/gams`

in your Shell session. This will create a new folder called `pwd`

.
` ````
mkdir /home/$USER/Documents/gams
cd /home/$USER/Documents/gams
pwd
```

` ````
/home/$USER/Downloads/linux_x64_64_sfx_.exe
```

` ````
cd /home/$USER/Documents/gams/gams31.2_linux_x64_64_sfx
```

To start the installation, go into the GAMS installation folder and run

`./gamsinst`

. You’ll find an example in the snippet. ` ````
./gamsinst
```

` ````
cd location/to/octeract/engine/bin
```

`octeract-install-for-gams`

. Run it. ` ````
./octeract-install-for-gams
```

` ````
/home/$USER/Documents/gams/gams31.2_linux_x64_64_sfx
```

` ````
$offdigit
*Declare variables
VARIABLES x1,x2,x3,x4,x5;
VARIABLES objvar;
*Declare equations (such as constraints, etc)
EQUATIONS con1,objeqn;
*Define what the equations declared above are equal to
con1 .. 4*x5+11*x3+7*x4+12*x2+20*x1+0=L=40;
objeqn .. (-50*(x5)**(2))+(-50*(x3)**(2))+(-50*(x2)**(2))
+(-50*(x1)**(2))+(-50*(x4)**(2))+47.5*x5+45*x3+
47*x4+44*x2+42*x1+0 - objvar =E= 0;
* set non default upper bounds
x1.up = 1;
x2.up = 1;
x3.up = 1;
x4.up = 1;
x5.up = 1;
* set non default lower bounds
x1.lo = 0;
x2.lo = 0;
x3.lo = 0;
x4.lo = 0;
x5.lo = 0;
*declare the model name and state that all equations should be included as part of it
Model m / all /;
m.limrow=0; m.limcol=0;
*setting 8 cores for usage with Octeract Engine
m.threads=8;
$if NOT '%gams.u1%' == '' $include '%gams.u1%'
*set Octeract as the solver to solve the problem
option nlp=octeract;
*state the model will be solved using the defined NLP solver and minimising the objective function
Solve m using NLP minimizing objvar;
```

` ````
*setting 8 cores for usage with Octeract Engine
m.threads=8;
```

` ````
./gams /whole/path/to/where/my_example.gms
```

You've just solved an optimisation problem using GAMS.

htg/htg1003