MATLAB Examples

Parameter homotopy: Sextic Ab Initio

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

As a simple example of using a parameter homotopy, we solve a sextic polynomial in one variable. The first step is to do an ab initio run to get the starting parameters.

config = struct('ParameterHomotopy',1);
polysyms a0 a1 a2 a3 a4 a5 a6 x
f = a0+x*(a1+x*(a2+x*(a3+x*(a4+x*(a5+x*a6)))));
poly_system = BertiniLab('function_def',f,'variable_group',x, ...
    'parameter',[a0 a1 a2 a3 a4 a5 a6],'config',config);
poly_system = solve(poly_system,'sextic.input');

Now for the parameter homotopy run:

poly_system.config = struct('ParameterHomotopy',2);

% Make nonsingular solutions the starting points
vars = poly_system.read_solutions('nonsingular_solutions');
poly_system.starting_points = vars;

% Define final parameter values
poly_system.final_parameters = [1.1 2.4 0.8 3.6 -0.52 -1.8 4.4];
poly_system = solve(poly_system,'sextic.input');

% Display summary of results
summary = poly_system.solve_summary;
iStart = strfind(summary,'NOTE: nonsingular');
disp(summary(iStart:end))
NOTE: nonsingular vs singular is based on condition number and identical endpoints

		| Number of real solns	|  Number of non-real solns	|  Total
------------------------------------------------------------------------------------------
Non-singular	|	2		|		4		|   6
Singular	|	0		|		0		|   0
------------------------------------------------------------------------------------------
Total		|	2		|		4		|   6


Finite Multiplicity Summary

  Multiplicity	|  Number of real solns	|  Number of non-real solns
------------------------------------------------------------------------------------------
	1	|	2		|	4


------------------------------------------------------------------------------------------
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: 6

It would be easy to automate this process for a large number of parameter values, in one or more for loops. The package Paramotopy is designed to do this efficiently. We hope to extend the BertiniLab interface to Paramotopy in a future release.