Intersection of two lines
Example 12.1 from Numerically solving polynomial systems with Bertini, by Daniel J. Bates, Jonathan D. Haunstein, Andrew J. Sommese and Charles W. Wampler (SIAM 2013).
We will look for the intersection of two algebraic sets A and B with witness sets and
, where
This can be done with a user-defined homotopy, as described in the book.
polysyms x1 x2 y1 y2 T t gamma FA = x1; FB = y1*y2; L1 = gamma*t*(2*x1 + x2 - 2) + (1-t)*(x1 - y1); L2 = gamma*t*(x1 + 3*y2 + 4) + (1-t)*(x2 - y2); poly_system = BertiniLab('variable_group',[x1 x2 y1 y2],'function_def',[FA; FB; L1; L2], ... 'config',struct('UserHomotopy',2),'pathvariable',T,'parameter',[t T], ... 'random',gamma,'starting_points',[0; 2; -4; 0]); %[[x1; x2; y1; y2],polysym([0; 2; -4; 0])]); poly_system = poly_system.solve; sols = poly_system.match_solutions('finite_solutions'); disp([sols.x; sols.y].')
0.000000000000000e+00+(0.000000000000000e+00)*I -6.332138549240981e-19+(-4.171273987140348e-19)*I -4.114760204849467e-19+(-2.238855416779519e-19)*I 0.000000000000000e+00+(0.000000000000000e+00)*I