MATLAB Examples

# Intersection of circle with y axis

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

Find the zeros of

$f(x,y) = \left((x-c)^2+y^2-1,x\right)$

for $c=1$ (which produces a singular solution). The constant $c$ can be modified to move the circle left or right.

poly_system = BertiniLab('function_def',{'(x-c)^2+y^2-1';'x'},'variable_group',{'x','y'}, ... 'constant',{'c',1}); poly_system = poly_system.solve; 

The summary for this run is:

disp(poly_system.solve_summary) 
 Bertini(TM) v1.4 (October 23, 2013) D.J. Bates, J.D. Hauenstein, A.J. Sommese, C.W. Wampler (using GMP v5.1.3, MPFR v3.1.2) NOTE: You have requested to use adaptive path tracking. Please make sure that you have setup the following tolerances appropriately: CoeffBound: 2.736856000000e+00, DegreeBound: 2.000000000000e+00 AMPSafetyDigits1: 1, AMPSafetyDigits2: 1, AMPMaxPrec: 1024 Tracking path 0 of 2 Finite Solution Summary NOTE: nonsingular vs singular is based on condition number and identical endpoints | Number of real solns | Number of non-real solns | Total ------------------------------------------------------------------------------------------ Non-singular | 0 | 0 | 0 Singular | 1 | 0 | 1 ------------------------------------------------------------------------------------------ Total | 1 | 0 | 1 Finite Multiplicity Summary Multiplicity | Number of real solns | Number of non-real solns ------------------------------------------------------------------------------------------ 2 | 1 | 0 ------------------------------------------------------------------------------------------ The following files may be of interest to you: main_data: A human-readable version of the solutions - main output file. raw_solutions: A list of the solutions with the corresponding path numbers. raw_data: Similar to the previous, but with the points in Bertini's homogeneous coordinates along with more information about the solutions. real_finite_solutions: A list of all real finite solutions. finite_solutions: A list of all finite solutions. nonsingular_solutions: A list of all nonsingular solutions. singular_solutions: A list of all singular solutions. ------------------------------------------------------------------------------------------ Paths Tracked: 2 

The solutions are singular, being nearly identical and having large condition numbers. The final tolerance by default is $10^{-11}$; displayed to that accuracy, the roots are identical:

sols = poly_system.match_solutions('singular_solutions'); solution_info = poly_system.read_raw_data; condnum = [solution_info.condition_number].'; xsols = double(sols.x); ysols = double(sols.y); fprintf('%17s %35s %32s\n','x','y','condition number') fprintf('%15.11f + %15.11fi %15.11f + %15.11fi %15.2g\n', ... [real(xsols) imag(xsols) real(ysols) imag(ysols) condnum].') 
 x y condition number -0.00000000000 + 0.00000000000i 0.00000000000 + 0.00000000000i 1.2e+13 -0.00000000000 + 0.00000000000i 0.00000000000 + 0.00000000000i 1.2e+13