Skip to content

Commit 1e25ec2

Browse files
authored
Cleanup writing
1 parent 70e0e73 commit 1e25ec2

File tree

1 file changed

+21
-6
lines changed

1 file changed

+21
-6
lines changed

docs/src/examples/rosenbrock.md

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,33 @@ for common workflows of the package and give copy-pastable starting points.
1111
the installation and usage of OptimizationOptimJL.jl package, see the
1212
[Optim.jl page](@ref optim).
1313

14-
The objective of this exercise is to determine the values $a$ and $b$ that minimize the Rosenbrock function, which is known to have a global minimum at $(a, a^2)$.
14+
The objective of this exercise is to determine the $(x, y)$ value pair that minimizes the result of a Rosenbrock function $f$ with some parameter values $a$ and $b$. The Rosenbrock function is useful for testing because it is known *a priori* to have a global minimum at $(a, a^2)$.
1515
```math
16-
f(x, y; a, b) = \left(a - x\right)^2 + b \left(y - x^2\right)^2
16+
f(x,\,y;\,a,\,b) = \left(a - x\right)^2 + b \left(y - x^2\right)^2
1717
```
1818

19-
The domains $x$ and $y$ are first captured as a new vector $\hat{x}$. Parameters $a$ and $b$ are captured as a new vector $\hat{p} and assigned values to produce the desired Rosenbrock function.
19+
The Optimization.jl interface expects functions to be defined with a vector of optimization arguments $\bar{x}$ and a vector of parameters $\bar{p}$, i.e.:
2020
```math
21-
\hat{x} = \begin{bmatrix} x \\ y \end{bmatrix} \\
22-
\hat{p} = \begin{bmatrix} a \\ b \end{bmatrix} = \begin{bmatrix} 1 \\ 100 \end{bmatrix}
21+
f(\bar{x},\,\bar{p}) = \left(p_1 - x_1\right)^2 + p_2 \left(x_2 - x_1^2\right)^2
22+
```
23+
24+
Parameters $a$ and $b$ are captured in a vector $\bar{p}$ and assigned some arbitrary values to produce a particular Rosenbrock function to be minimized.
25+
```math
26+
\bar{p} = \begin{bmatrix} a \\ b \end{bmatrix} = \begin{bmatrix} 1 \\ 100 \end{bmatrix}
27+
```
28+
29+
The original $x$ and $y$ domains are captured in a vector $\bar{x}$.
30+
```math
31+
\bar{x} = \begin{bmatrix} x \\ y \end{bmatrix}
2332
```
2433

25-
An optimization problem can now be defined and solved to estimate the values for $\hat{x}$ that minimize the output of this function.
34+
An initial estimate $\bar{x}_0$ of the minima location is required to initialize the optimizer.
35+
```math
36+
\bar{x}_0 = \begin{bmatrix} x_0 \\ y_0 \end{bmatrix} = \begin{bmatrix} 0 \\ 0 \end{bmatrix}
37+
```
38+
39+
40+
An optimization problem can now be defined and solved to estimate the values for $\bar{x}$ that minimize the output of this function.
2641

2742
```@example rosenbrock
2843
# Define the problem to solve

0 commit comments

Comments
 (0)