Skip to content

Commit

Permalink
Updated and published constraint qualifications notes
Browse files Browse the repository at this point in the history
  • Loading branch information
adowling2 committed Nov 26, 2024
1 parent c36f41a commit 5c7fd0b
Show file tree
Hide file tree
Showing 3 changed files with 461 additions and 99 deletions.
35 changes: 29 additions & 6 deletions notebooks/7-dev/Constraint-Qualifications.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
"\n",
"\\begin{equation*}\n",
"\n",
"\\text{KKT conditions (linearization,~first~order)} \\xleftrightarrow{\\text{constraint~qualifications}} \\text{Theorem~4.8}\n",
"\\text{KKT conditions (linearization, first order)} \\leftarrow \\text{constraint qualifications} \\rightarrow \\text{Theorem~4.8}\n",
"\\end{equation*}\n",
"\n",
"Constraint qualification act as the link between KKT conditions (which we numerical solve) and optimization theory.\n",
Expand Down Expand Up @@ -214,16 +214,19 @@
"\n",
"\n",
"The Lagrangian is defined as:\n",
"\n",
"$$\n",
"L(x,u) = f(x) + g(x)^T u\n",
"$$\n",
"\n",
"Specifically:\n",
"\n",
"$$\n",
"L = x_1 + u_1 (x_2 - x_1^3) + u_2 (-x_1^3 - x_2)\n",
"$$\n",
"\n",
"Set the gradient of the Lagrangian with respect to $x$ equal to zero:\n",
"\n",
"$$\n",
"\\nabla_x L = \n",
"\\begin{bmatrix}\n",
Expand Down Expand Up @@ -261,6 +264,7 @@
" $u_1 = 0$, $u_2 = 0$\n",
"\n",
" Gradient of the Lagrangian:\n",
" \n",
" $$\n",
" \\nabla_x L = \n",
" \\begin{bmatrix}\n",
Expand All @@ -273,12 +277,14 @@
" 0\n",
" \\end{bmatrix}\n",
" $$\n",
" **Solution is not bounded!**\n",
" \n",
" *Solution is not bounded!*\n",
"\n",
"2. **$g_1$ is active, $g_2$ is NOT strongly active** \n",
" $u_1 \\geq 0$, $u_2 = 0$\n",
"\n",
" Gradient of the Lagrangian:\n",
" \n",
" $$\n",
" \\nabla_x L = \n",
" \\begin{bmatrix}\n",
Expand All @@ -292,7 +298,7 @@
" \\end{bmatrix}\n",
" $$\n",
"\n",
" From this, $u_1 = 0$... **KKT conditions are not satisfied!**\n",
" From this, $u_1 = 0$... *KKT conditions are not satisfied!*\n",
"\n",
"3. **$g_1$ is NOT strongly active, $g_2$ is active** \n",
" Same problem as case 2.\n",
Expand All @@ -301,6 +307,7 @@
" $u_1 \\geq 0$, $u_2 \\geq 0$\n",
"\n",
" Gradient of the Lagrangian:\n",
"\n",
" $$\n",
" \\nabla_x L = \n",
" \\begin{bmatrix}\n",
Expand All @@ -317,16 +324,18 @@
" From $\\nabla_{x_2} L = 0$, we get $u_1 = u_2$.\n",
"\n",
" Substituting into $\\nabla_{x_1} L = 0$:\n",
"\n",
" $$\n",
" 1 - 3u_1 x_1^2 - 3u_2 x_1^2 = 0\n",
" $$\n",
"\n",
" Solving for $x_1$:\n",
" \n",
" $$\n",
" x_1 = \\sqrt{\\frac{1}{3u_1}}\n",
" $$\n",
"\n",
" This means we can see from visual inspection that the **optimal solution occurs at**:\n",
" This means we can see from visual inspection that the *optimal solution occurs at*:\n",
" - $x_1 \\to 0$, $x_2 \\to 0$\n",
" - $u_1, u_2 \\to \\infty$\n",
"\n",
Expand Down Expand Up @@ -381,8 +390,22 @@
"Recall both constraints are active at the solution $x_1 = x_2 = 0$:\n",
"\\begin{equation*}\n",
"\\begin{bmatrix}\n",
"\\sout{-3x_1^2}~{0} & 1 \\\\\n",
"\\sout{-3x_1^2}~{0} & -1\n",
"-3x_1^2 & 1 \\\\\n",
"-3x_1^2 & -1\n",
"\\end{bmatrix}\n",
"\\cdot d = \n",
"\\begin{bmatrix}\n",
"0 \\\\\n",
"0\n",
"\\end{bmatrix}\n",
"\\end{equation*}\n",
"\n",
"Substituting $x_1 = x_2 = 0$:\n",
"\n",
"\\begin{equation*}\n",
"\\begin{bmatrix}\n",
"0 & 1 \\\\\n",
"0 & -1\n",
"\\end{bmatrix}\n",
"\\cdot d = \n",
"\\begin{bmatrix}\n",
Expand Down
Loading

0 comments on commit 5c7fd0b

Please sign in to comment.