## Simple Examples

## Apps.SimpleExamples History

Hide minor edits - Show changes to output

Changed line 8 from:

{$\begin{align}\mathrm{minimize} \quad & 100-x_1^2-2x_2^2-x_3^2-x_1x_2-x_1x_3 \\ \mathrm{subject\;to}\quad & 8x_1+14x_2+7x_3=56 \\ & x_1^2+x_2^2+x_3^2\~~geq0~~ \\ & x_1,x_2,x_3\ge0 \end{align}$}

to:

{$\begin{align}\mathrm{minimize} \quad & 100-x_1^2-2x_2^2-x_3^2-x_1x_2-x_1x_3 \\ \mathrm{subject\;to}\quad & 8x_1+14x_2+7x_3=56 \\ & x_1^2+x_2^2+x_3^2\geq25 \\ & x_1,x_2,x_3\ge0 \end{align}$}

Changed lines 10-14 from:

* %list list-page% [[Attach:min2.apm | View APMonitor ~~min2.apm~~]]

~~'''Solve~~ with [[https://gekko.readthedocs.io/en/latest/|Python Gekko]]~~'''~~

(:source lang=python:)

(:source lang=python:)

to:

* %list list-page% [[Attach:min2.apm | View APMonitor Solution]]

* Solve with [[https://gekko.readthedocs.io/en/latest/|Python Gekko]]

-> (:source lang=python:)

* Solve with [[https://gekko.readthedocs.io/en/latest/|Python Gekko]]

-> (:source lang=python:)

Deleted lines 7-10:

%width=200px%Attach:min2.png

Added lines 9-10:

* %list list-page% [[Attach:min2.apm | View APMonitor min2.apm]]

Added lines 11-12:

{$\begin{align}\mathrm{minimize} \quad & 100-x_1^2-2x_2^2-x_3^2-x_1x_2-x_1x_3 \\ \mathrm{subject\;to}\quad & 8x_1+14x_2+7x_3=56 \\ & x_1^2+x_2^2+x_3^2\geq0 \\ & x_1,x_2,x_3\ge0 \end{align}$}

Changed line 12 from:

'''Solve with~~''~~ [[https://gekko.readthedocs.io/en/latest/|Python Gekko]]'''

to:

'''Solve with [[https://gekko.readthedocs.io/en/latest/|Python Gekko]]'''

Added lines 11-23:

'''Solve with'' [[https://gekko.readthedocs.io/en/latest/|Python Gekko]]'''

(:source lang=python:)

from gekko import GEKKO

m = GEKKO(remote=False)

x1,x2,x3 = m.Array(m.Var,3,lb=0)

m.Minimize(1000-x1**2-2*x2**2-x3**2-x1*x2-x1*x3)

m.Equations([8*x1+14*x2+7*x3==56,

x1**2+x2**2+x3**2>=25])

m.solve(disp=False)

print(x1.value,x2.value,x3.value)

(:sourceend:)

Changed line 10 from:

%width=~~400px~~%Attach:min2.png

to:

%width=200px%Attach:min2.png

Changed line 10 from:

Attach:min2.png

to:

%width=400px%Attach:min2.png

Changed lines 1-2 from:

!! ~~Simple~~ Examples

to:

!! Tutorial Examples

Changed lines 6-7 from:

!! ~~Simple test~~ problem with 2 local minima

to:

!!!! Test problem with 2 local minima

Added lines 13-27:

----

!!!! Numerical Integration

This problem demonstrates how to numerically integrate a function. In this case, the function of interest is ''x = 2 t'' with an exact solution of ''y = t'^2^' ''.

Attach:integration_model.png

The following Python script runs the model and plots the results:

Attach:integration_script.png

Attach:integration_results.png

[[Attach:integration_script.zip | Download integration example problem]]

Changed line 3 from:

Models presented below are a test suite of optimization problems. They are part of the test suite used to verify modifications to the %blue%A%red%P%black%Monitor software. Users may also find this collection useful to compare %blue%A%red%P%black%Monitor syntax to other modeling languages, for solver benchmarking, or as example problems in optimization. Models may be submitted through the ~~%blue%[[https~~://~~apmonitor~~.~~ath.cx/sandbox/ | online submission platform]]~~.

to:

Models presented below are a test suite of optimization problems. They are part of the test suite used to verify modifications to the %blue%A%red%P%black%Monitor software. Users may also find this collection useful to compare %blue%A%red%P%black%Monitor syntax to other modeling languages, for solver benchmarking, or as example problems in optimization. Models may be submitted through the (:html:)<a href="/online/view_pass.php">Online Web-based Interface</a>(:htmlend:).

Added lines 7-8:

This optimization problem has 2 local minima. The two problem solutions are found at (0,0,8) with objective 936.0 (global minimum) and (7,0,0) with objective 951.0.

Added lines 1-18:

!! Simple Examples

Models presented below are a test suite of optimization problems. They are part of the test suite used to verify modifications to the %blue%A%red%P%black%Monitor software. Users may also find this collection useful to compare %blue%A%red%P%black%Monitor syntax to other modeling languages, for solver benchmarking, or as example problems in optimization. Models may be submitted through the %blue%[[https://apmonitor.ath.cx/sandbox/ | online submission platform]].

----

!! Simple test problem with 2 local minima

* %list list-page% [[Attach:min2.apm | View min2.apm]]

Attach:min2.png

----

!! Hock & Schittkowski Collection

* Link to [[HockSchittkowski | Hock & Schittkowski Collection]] page

* %list list-page% [[Attach:hs.zip | All 119 models in the collection (hs.zip)]]

----

Models presented below are a test suite of optimization problems. They are part of the test suite used to verify modifications to the %blue%A%red%P%black%Monitor software. Users may also find this collection useful to compare %blue%A%red%P%black%Monitor syntax to other modeling languages, for solver benchmarking, or as example problems in optimization. Models may be submitted through the %blue%[[https://apmonitor.ath.cx/sandbox/ | online submission platform]].

----

!! Simple test problem with 2 local minima

* %list list-page% [[Attach:min2.apm | View min2.apm]]

Attach:min2.png

----

!! Hock & Schittkowski Collection

* Link to [[HockSchittkowski | Hock & Schittkowski Collection]] page

* %list list-page% [[Attach:hs.zip | All 119 models in the collection (hs.zip)]]

----