compute the number of real solutions for each open cell
solution record, as returned by CellDecomposition
(optional) list of ranges for the parameters, of the form parameter=u..v, where u is a rational number or −∞ and v is a rational number or ∞
The NumberOfSolutions⁡m calling sequence computes the number of real solutions of the system
and returns it as a list of lists of the form i,ni, where i is the index of the open cell and ni is the number of real solutions of the non-parametric system resulting from substituting parameter values from this cell.
If l is given, only those open cells whose sample points lie inside the box specified by l are considered.
This command is part of the RootFinding[Parametric] package, so it can be used in the form NumberOfSolutions(..) only after executing the command with(RootFinding[Parametric]). However, it can always be accessed through the long form of the command by using RootFinding[Parametric][NumberOfSolutions](..).
sys ≔ x2+y2=a,x−y=b,0<a
m ≔ CellDecomposition⁡sys,x,y
Thus, the number of solution pairs x,y of the system sys is 2 if the parameters a and b are chosen from the blue or green cells, to the right of the parabola, and 0 otherwise.
You can restrict the cells for which you want the number of solutions.
In fact, the system sys has exactly one solution, of multiplicity 2, on the parabola itself. This cannot be inferred from the previous data. However, you can add the equation for the discriminant variety to the system and make b an indeterminate as well.
eqs ≔ op⁡m:-Equations,op⁡2,1,
Error, (in RootFinding:-Parametric:-CellDecomposition) cannot solve the system: either there are infinitely many complex solutions, or there are solutions of multiplicity > 1, for almost all parameter values
In order to proceed, you must remove multiplicities by computing the radical.
J ≔ PolynomialIdeal⁡eqs,variables=x,y,b:
R ≔ Generators⁡Simplify⁡Radical⁡J
m2 ≔ CellDecomposition⁡op⁡R,m:-Inequalities,x,y,b
Notice that there is only one cell, and that the equations eqs have two solutions, independent of the value of the parameter a. The following command computes these solutions for a=1:
Since the values of b are different for each of those two solutions, you can conclude that the original system sys has exactly one solution x,y for parameter values a and b on the parabola specified by the equation for the discriminant variety.
Download Help Document
What kind of issue would you like to report? (Optional)