Skip to content

Commit

Permalink
Merge pull request #150 from DonnaVakalis/new-typos
Browse files Browse the repository at this point in the history
Fixed minor typos in parametric programming tutorials
  • Loading branch information
drgona authored May 1, 2024
2 parents 73d8fe0 + 9962619 commit 4497780
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 16 deletions.
8 changes: 4 additions & 4 deletions examples/parametric_programming/Part_2_pQP.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -12,25 +12,25 @@
"This is an interactive notebook based on the python script [Part_2_LearnToOptimize_pQP.py](./Part_2_LearnToOptimize_pQP.py). \n",
"\n",
"Problem formulation pQP:\n",
" $$\n",
"$$\n",
" \\begin{align}\n",
" &\\text{minimize } && x^2 + y^2\\\\\n",
" &\\text{subject to} && -x - y + p1 \\le 0\\\\\n",
" & && x + y - p1 - 5 \\le 0\\\\\n",
" & && x - y + p2 - 5 \\le 0\\\\\n",
" & && -x + y - p2 \\le 0\\\\\n",
" \\end{align}\n",
" $$\n",
"$$\n",
"\n",
"\n",
"Problem formulation pQCQP:\n",
" $$\n",
"$$\n",
" \\begin{align}\n",
" &\\text{minimize } && x^2 + y^2\\\\\n",
" &\\text{subject to} && -x - y + p1 \\le 0\\\\\n",
" & && x^2 + y^2 \\le p2^2\\\\\n",
" \\end{align}\n",
" $$\n",
"$$\n",
"\n",
"with parameters $p, a$ and decision variables $x, y$."
]
Expand Down
20 changes: 10 additions & 10 deletions examples/parametric_programming/Part_3_pNLP.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -12,28 +12,28 @@
"This is an interactive notebook based on the python script [Part_3_LearnToOptimize_pNLP.py](./Part_3_LearnToOptimize_pNLP.py). \n",
"\n",
"Problem formulation:\n",
" $$\n",
"$$\n",
" \\begin{align}\n",
" &\\text{minimize } && f\\\\\n",
" &\\text{subject to} && \\left(\\frac{p}{2}\\right)^2 \\le x^2 + y^2 \\le p^2\\\\\n",
" & && x \\ge y\n",
" \\end{align}\n",
" $$\n",
"$$\n",
"\n",
"\n",
"problem parameters: $p$, \n",
"problem decition variables: $x, y$, \n",
"Search domain: $-5.0 \\le x, y \\le 5.0$\n",
"\n",
"Set of objective functions f: \n",
" Rosenbrock:$ \\,\\,\\,\\,\\,\\,\\,\\,\\,\\,\\,\\,\\,\\,\\,\\,\\,\\,\\,\\,\\,\\,\\,\\, f = (1 - x)^2 + (y - x^2)^2$ \n",
" GomezLevy:$ \\,\\,\\,\\,\\,\\,\\,\\,\\,\\,\\,\\,\\,\\,\\,\\,\\,\\,\\,\\,\\,\\,\\, f = 4x^2 - 2.1x^4 + 1/3x^6 + xy - 4y^2 + 4y^4$ \n",
" Himelblau:$ \\,\\,\\,\\,\\,\\,\\,\\,\\,\\,\\,\\,\\,\\,\\,\\,\\,\\,\\,\\,\\,\\,\\,\\,\\,\\,\\, f = (x^2 + y - 11)^2 + (x + y^2 - 7)^2$ \n",
" Styblinski-Tang:$ \\,\\,\\,\\,\\,\\,\\,\\,\\,\\,\\,\\,\\,\\,\\,\\, f = x^4 -15x^2 + 5x + y^4 -15y^2 + 5y$ \n",
" Simionescu:$ \\,\\,\\,\\,\\,\\,\\,\\,\\,\\,\\,\\,\\,\\,\\, \\,\\,\\,\\,\\,\\,\\,\\, f = 0.1xy$ \n",
" McCormick:$ \\,\\,\\,\\,\\,\\,\\,\\,\\,\\,\\,\\,\\,\\,\\,\\,\\,\\,\\,\\,\\,\\,\\, f = sin(x + y) + (x - y)^2 - 1.5x + 2.5y +1$ \n",
" Three-hump-camel:$ \\,\\,\\,\\,\\,\\,\\, f = 2x^2 - 1.05x^4 + (x^6)/6 + xy + y^2$ \n",
" Beale:$ \\,\\,\\,\\,\\,\\,\\,\\,\\,\\,\\,\\,\\,\\,\\,\\,\\,\\,\\,\\,\\,\\,\\,\\,\\,\\,\\,\\,\\,\\,\\,\\,\\,\\, \n",
"Rosenbrock:$ \\,\\,\\,\\,\\,\\,\\,\\,\\,\\,\\,\\,\\,\\,\\,\\,\\,\\,\\,\\,\\,\\,\\,\\, f = (1 - x)^2 + (y - x^2)^2$ \n",
"GomezLevy:$ \\,\\,\\,\\,\\,\\,\\,\\,\\,\\,\\,\\,\\,\\,\\,\\,\\,\\,\\,\\,\\,\\,\\, f = 4x^2 - 2.1x^4 + 1/3x^6 + xy - 4y^2 + 4y^4$ \n",
"Himelblau:$ \\,\\,\\,\\,\\,\\,\\,\\,\\,\\,\\,\\,\\,\\,\\,\\,\\,\\,\\,\\,\\,\\,\\,\\,\\,\\,\\, f = (x^2 + y - 11)^2 + (x + y^2 - 7)^2$ \n",
"Styblinski-Tang:$ \\,\\,\\,\\,\\,\\,\\,\\,\\,\\,\\,\\,\\,\\,\\,\\, f = x^4 -15x^2 + 5x + y^4 -15y^2 + 5y$ \n",
"Simionescu:$ \\,\\,\\,\\,\\,\\,\\,\\,\\,\\,\\,\\,\\,\\,\\, \\,\\,\\,\\,\\,\\,\\,\\, f = 0.1xy$ \n",
"McCormick:$ \\,\\,\\,\\,\\,\\,\\,\\,\\,\\,\\,\\,\\,\\,\\,\\,\\,\\,\\,\\,\\,\\,\\, f = sin(x + y) + (x - y)^2 - 1.5x + 2.5y +1$ \n",
"Three-hump-camel:$ \\,\\,\\,\\,\\,\\,\\, f = 2x^2 - 1.05x^4 + (x^6)/6 + xy + y^2$ \n",
"Beale:$ \\,\\,\\,\\,\\,\\,\\,\\,\\,\\,\\,\\,\\,\\,\\,\\,\\,\\,\\,\\,\\,\\,\\,\\,\\,\\,\\,\\,\\,\\,\\,\\,\\,\\, \n",
" f = (1.5 - x + xy)^2 + (2.25 -x + xy^2)^2 + (2.625 -x + xy^3)^2$ \n",
"\n",
"See the description of the test problems here: \n",
Expand Down
4 changes: 2 additions & 2 deletions examples/parametric_programming/Part_5_cvxpy_layers.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@
"id": "JZ9qrw0tlJhs"
},
"source": [
"Randomly sample parameters from a uniform distribution: $0.5\\le p\\le2.0$; $0.2\\le a\\le1.2$"
"Randomly sample parameters from a uniform distribution: $0.5\\le p\\le5.0$; $0.0\\le b\\le1.0$"
]
},
{
Expand Down Expand Up @@ -243,7 +243,7 @@
"outputs": [],
"source": [
"# define neural architecture for the trainable solution map\n",
"# mapping problem parameters to decitionv ariables\n",
"# mapping problem parameters to decision variables\n",
"func = blocks.MLP(insize=n_con+n_p, outsize=nx,\n",
" bias=True,\n",
" linear_map=torch.nn.Linear,\n",
Expand Down

0 comments on commit 4497780

Please sign in to comment.