@@ -17,10 +17,9 @@ to solve nonlinear equations.
1717
1818As an illustrative example, we consider the following nonlinear system of two equations
1919with two unknowns:
20-
2120\begin{align* }
22- z_1 &= y_1 - \theta_1 \\
23- z_2 &= y_1 y_2 + \theta_2
21+ z_1 &= y_1 - \theta_1 \\
22+ z_2 &= y_1 y_2 + \theta_2
2423\end{align* }
2524
2625Our goal is to simultaneously solve all equations for
@@ -60,8 +59,8 @@ The body of the system function here could also be coded using a row
6059vector constructor and transposition,
6160
6261```
63- return [ y[1] - theta[1],
64- y[1] * y[2] - theta[2] ]';
62+ return [ y[1] - theta[1],
63+ y[1] * y[2] - theta[2] ]';
6564```
6665
6766As systems get more complicated, naming the intermediate expressions
@@ -120,9 +119,9 @@ must only involve parameters. Note there are no restrictions on the initial gues
120119The Jacobian of the solution with respect to the parameters is computed
121120using the implicit function theorem, which imposes certain restrictions. In particular,
122121the Jacobian of the algebraic function $f$ with respect to the unknowns $x$ must
123- be invertible. This requires the Jacobian to be square, meaning \textit{ $f(y)$ and
124- $y$ have the same length} or, in other words \textit{ the number of equations in
125- the system is the same as the number of unknowns.}
122+ be invertible. This requires the Jacobian to be square, meaning $f(y)$ and
123+ $y$ have the same length or, in other words * the number of equations in
124+ the system is the same as the number of unknowns.*
126125
127126### Pathological Solutions {-}
128127Certain systems may be degenerate, meaning they have multiple solutions. The
@@ -142,15 +141,15 @@ allows three additional parameters, all of which must be supplied if any of them
142141supplied.
143142
144143```
145- y = algebra_solver(system, y_guess, theta, x_r, x_i,
146- rel_tol, f_tol, max_steps);
144+ y = algebra_solver(system, y_guess, theta, x_r, x_i,
145+ rel_tol, f_tol, max_steps);
147146```
148147
149148The three control arguments are relative tolerance, function tolerance, and maximum
150149number of steps. Both tolerances need to be satisfied. If one of them is not met, the
151150metropolis proposal gets rejected with a warning message explaining which criterion
152151was not satisfied. The default values for the control arguments are respectively
153- ` 1e-10 ` ($10^{-10}$), ` 1e-6 ` ($10^{-6}$), and ` 1e3 ` ($10^3$).
152+ ` rel_tol = 1e-10` ($10^{-10}$), ` f_tol = 1e-6` ($10^{-6}$), and ` max_steps = 1e3` ($10^3$).
154153
155154### Tolerance {-}
156155
0 commit comments