MATLAB Examples

## Contents

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

This polynomial system is the set of 2x2 minors of a 2x4 matrix of variables. The next three examples are just different ways of running this same problem. Notice the difference in time.

```x = polysym('x',[3 4]); f = [x(1,1:3).*x(2,2:4) - x(1,2:4).*x(2,1:3) x(2,1:3).*x(3,2:4) - x(2,2:4).*x(3,1:3)].'; config = struct('TrackType',1); config.WitnessGenType=1; % dimension-by-dimension config.WitnessSupersetOnly = 1; % only compute a witness point superset poly_system = BertiniLab('variable_group',x,'function_def',f,'config',config); poly_system = poly_system.solve; results = poly_system.solve_summary; istart = strfind(results,'NOTE: nonsingular'); disp(results(istart:end)) ```
```NOTE: nonsingular vs singular is based on rank deficiency and identical endpoints |codim| paths |witness superset| nonsingular | singular |nonsolutions| inf endpoints | other bad endpoints ---------------------------------------------------------------------------------------------------------------- | 1 | 2 | 0 | 0 | 0 | 2 | 0 | 0 | 2 | 4 | 0 | 0 | 0 | 4 | 0 | 0 | 3 | 8 | 0 | 0 | 0 | 8 | 0 | 0 | 4 | 16 | 1 | 1 | 0 | 15 | 0 | 0 | 5 | 32 | 14 | 8 | 6 | 18 | 0 | 0 | 6 | 64 | 64 | 10 | 54 | 0 | 0 | 0 ---------------------------------------------------------------------------------------------------------------- |total| 126 **************************************************** ```

```poly_system.config.WitnessGenType = 0; poly_system = poly_system.solve; results = poly_system.solve_summary; istart = strfind(results,'NOTE: nonsingular'); disp(results(istart:end)) ```
```NOTE: nonsingular vs singular is based on rank deficiency and identical endpoints |codim| paths |witness superset| nonsingular | singular |nonsolutions| inf endpoints | other endpoints | bad endpoints -------------------------------------------------------------------------------------------------------------------------- | 1 | 64 | 0 | 0 | 0 | 49 | 15 | 0 | 0 | 2 | 49 | 0 | 0 | 0 | 49 | 0 | 0 | 0 | 3 | 49 | 0 | 0 | 0 | 49 | 0 | 0 | 0 | 4 | 49 | 1 | 1 | 0 | 48 | 0 | 0 | 0 | 5 | 48 | 12 | 8 | 4 | 36 | 0 | 0 | 0 | 6 | 36 | 36 | 10 | 26 | 0 | 0 | 0 | 0 -------------------------------------------------------------------------------------------------------------------------- |total| 295 **************************************************** ```
```poly_system.config.WitnessGenType = 2; poly_system = poly_system.solve; results = poly_system.solve_summary; istart = strfind(results,'NOTE: nonsingular'); disp(results(istart:end)) ```
```NOTE: nonsingular vs singular is based on rank deficiency and identical endpoints |codim| paths |witness superset| nonsingular | singular |nonsolutions| inf endpoints | other bad endpoints ---------------------------------------------------------------------------------------------------------------- | 1 | 2 | 0 | 0 | 0 | 2 | 0 | 0 | 2 | 4 | 0 | 0 | 0 | 4 | 0 | 0 | 3 | 8 | 0 | 0 | 0 | 8 | 0 | 0 | 4 | 16 | 1 | 1 | 0 | 15 | 0 | 0 | 5 | 30 | 12 | 8 | 4 | 18 | 0 | 0 | 6 | 36 | 36 | 10 | 26 | 0 | 0 | 0 ---------------------------------------------------------------------------------------------------------------- |total| 96 **************************************************** ```
```poly_system.config.WitnessSupersetOnly = 0; poly_system = solve(poly_system); results = poly_system.solve_summary; istart = strfind(results,'************** Decomposition'); disp(results(istart:end)) ```
```************** Decomposition by Degree ************** Dimension 8: 1 classified component ----------------------------------------------------- degree 1: 1 component Dimension 7: 4 classified components ----------------------------------------------------- degree 1: 2 components degree 3: 2 components Dimension 6: 1 classified component ----------------------------------------------------- degree 10: 1 component ***************************************************** ```