MATLAB Examples

# Straight-line programs

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

Subfunctions can be defined in Bertini to simplify expressions, as in this example:

```polysyms z a b p poly_system = BertiniLab('variable_group',z,'subfunction',[a z^3+z+1; b z^2+2],... 'function_def',a^4-5*b^3+6); poly_system = solve(poly_system); results = poly_system.solve_summary; istart = strfind(results,'Finite Solution'); disp(results(istart:end)) ```
```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 | 2 | 9 | 11 Singular | 0 | 1 | 1 ------------------------------------------------------------------------------------------ Total | 2 | 10 | 12 Finite Multiplicity Summary Multiplicity | Number of real solns | Number of non-real solns ------------------------------------------------------------------------------------------ 1 | 2 | 10 ------------------------------------------------------------------------------------------ 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: 12 ```