Skip to content

Commit 73d8505

Browse files
Merge pull request #453 from DanielVandH/patch-1
Link to NaNMath & fixed some typos
2 parents a095e27 + b0a0eda commit 73d8505

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

docs/src/API/FAQ.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
## The Solver Seems to Violate Constraints During the Optimization, Causing `DomainError`s, What Can I Do About That?
44

55
During the optimization, optimizers use slack variables to relax the solution to the constraints. Because of this,
6-
there is no guarentee that for an arbitrary optimizer the steps will all satisfy the constraints during the
6+
there is no guarantee that for an arbitrary optimizer the steps will all satisfy the constraints during the
77
optimization. In many cases, this can cause one's objective function code throw a `DomainError` if it is evaluated
88
outside of its acceptable zone. For example, `log(-1)` gives:
99

@@ -16,7 +16,7 @@ log will only return a complex result if called with a complex argument. Try log
1616
To handle this, one should not assume that the variables will always satisfy the constraints on each step. There
1717
are three general ways to handle this better:
1818

19-
1. Use NaNMath.jl
19+
1. Use [NaNMath.jl](https://github.com/JuliaMath/NaNMath.jl)
2020
2. Process variables before domain-restricted calls
2121
3. Use a domain transformation
2222

@@ -29,9 +29,9 @@ reason for the difference.
2929

3030
Alternatively, one can pre-process the values directly. For example, `log(abs(x))` is guaranteed to work. If one does
3131
this, there are two things to make note of. One is that the solution will not be transformed, and thus the transformation
32-
should be applied on `sol.u` as well. I.e., the solution could fine an optima for `x = -2`, and one should manually
32+
should be applied on `sol.u` as well. For example, the solution could find an optima for `x = -2`, and one should manually
3333
change this to `x = 2` if the `abs` version is used within the objective function. Note that many functions for this will
34-
introduce a disocontinuity in the derivative which can effect the optimization process.
34+
introduce a discontinuity in the derivative which can affect the optimization process.
3535

3636
Finally and relatedly, one can write the optimization with domain transformations in order to allow the optimization to
3737
take place in the full real set. For example, instead of optimizing `x in [0,Inf]`, one can optimize `exp(x) in [0,Inf]`
@@ -94,4 +94,4 @@ This will both be faster and numerically easier.
9494
and symbolic simplification passes, it does include the ability to specialize the solution process. For example,
9595
it can treat linear optimization problems, quadratic optimization problem, convex optimization problems, etc.
9696
in specific ways that are more efficient than a general nonlinear interface. For more information on the types of
97-
special solves that are allowed with JuMP, see [this page](https://jump.dev/JuMP.jl/stable/installation/#Supported-solvers).
97+
special solves that are allowed with JuMP, see [this page](https://jump.dev/JuMP.jl/stable/installation/#Supported-solvers).

0 commit comments

Comments
 (0)