Skip to content

Commit 8a303b7

Browse files
authored
Add intro details
1 parent b6ce64c commit 8a303b7

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

docs/src/examples/rosenbrock.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,19 @@ 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)$.
15+
```math
16+
f(x, y; a, b) = \left(a - x\right)^2 + b \left(y - x^2\right)^2
17+
```
18+
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.
20+
```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}
23+
```
24+
25+
An optimization problem can now be defined and solved to estimate the values for $\hat{x}$ that minimize the output of this function.
26+
1427
```@example rosenbrock
1528
# Define the problem to solve
1629
using Optimization, ForwardDiff, Zygote

0 commit comments

Comments
 (0)