MATLAB Examples

Evaluating a system and Jacobian

Section 7.3.1 from Numerically solving polynomial systems with Bertini, by Daniel J. Bates, Jonathan D. Haunstein, Andrew J. Sommese and Charles W. Wampler (SIAM 2013).

This code instructs Bertini to evaluate the system of polynomials and its Jacobian for the intersection of a circle and its parabola. This system was already solved in "Sharpening using Newton's method".

With TrackType = -4, Bertini will evaluate the system, while with TrackType = -3, it will evaluate the Jacobian as well.

A start file must be provided with the points, which in this example are $(3/4,2)$ and $(10^{-15},1/4)$.

polysyms x y

circle_parabola_intersection.config = struct('TrackType',-3,'MPType',1,'Precision',64);
circle_parabola_intersection.starting_points = [.75, 2; 1e-15 .25].';
circle_parabola_intersection = solve(circle_parabola_intersection);
results = circle_parabola_intersection.solve_summary;
istart = strfind(results,'Evaluating point');
disp(results(istart:end))
Evaluating point 0 of 2

------------------------------------------------------------------------------------------
The following files may be of interest to you:

function:  The function values evaluated at the given points.
Jv:        The Jacobian w.r.t. variables evaluated at the given points.
------------------------------------------------------------------------------------------

The files function and Jv can be read using the basic utility read_solutions. This simply returns a column for each solution:

fvals = circle_parabola_intersection.read_solutions('Jv');
fprintf('%15.11g %15.11g\n',double(fvals).')
            1.5           2e-15
              2            -1.5
             -3          -4e-15
              1               1

The matrices are presented in row major ordering, so they correspond to the matrices

$$ \left[ \begin{array}{cc} 1.5 & 2\\ -3 & 1 \end{array} \right] $$ and
$$ \left[ \begin{array}{cc} 2\cdot 10^{-15} & -1.5\\
-4\cdot 10^{-15} & 1 \end{array} \right]. $$