RootFinding
WitnessPoints
sample real connected components of a polynomial system
Calling Sequence
Parameters
Description
Notes
Examples
WitnessPoints(sys)
WitnessPoints(sys, vars)
WitnessPoints(sys, vars, digits=d)
sys
-
list of equations or list of inequations and strict inequalities
vars
(optional) list of names; the indeterminates
d
(optional) positive integer; number of significant digits
The function WitnessPoints returns at least one point in each connected component of the real solutions of sys.
The system sys is either:
a list of polynomial equations with rational coefficients
or, a list of polynomial inequations of the form p≠q and strict inequalities of the form p>q with rational coefficients
The output is a list of points with rational coordinates.
A point is represented by a list of equations of the form variable=rational.
When sys is a list of equations, then each point of the output is a rational approximation of a solution of sys, the precision of which is controlled by the option digits=d (default value: Digits). More precisely, if a is a point returned by the command WitnessPoints, then there exists a solution x of sys such that:
|| a - x ||1<10−d⁢|| a ||1
When the list of names vars is provided, it must contain all the indeterminates appearing in sys. In this case, the coordinates of the points returned by WitnessPoints are ordered according to vars.
Several points can belong to the same connected component.
For some inputs, repeated execution of the command WitnessPoints may return different outputs due to the use of randomization in the implementation. A way to keep the function deterministic is to use the command randomize with a fixed seed (see Examples below).
with⁡RootFinding:
WitnessPoints computes sample solutions of an equation:
WitnessPoints⁡x2+y+3=0
x=0,y=−3
WitnessPoints⁡x2+y−122=0
x=0,y=1
or a system of equations
WitnessPoints⁡x2+y2,z−x3=0
x=0,y=0,z=0
or a set of inequalities:
evalf⁡WitnessPoints⁡0<x2+y+3,3⁢y3−x5<10
x=−3.,y=−11.,x=0.,y=−2.
The following example computes points on the interior and the exterior of the unit circle, with x-coordinates in the interval −1,1.
WitnessPoints⁡x2+y2−1≠0,x2<1,x,y
x=0,y=−2,x=−14236565851525870529,y=−12,x=0,y=−12,x=14236565851525870529,y=−12,x=−14236565851525870529,y=12,x=0,y=12,x=14236565851525870529,y=12,x=0,y=2
In the following example, we check that a system with the equation x2<−1 has no real solutions.
WitnessPoints⁡x2+y2−1≠0,x2<−1,x,y
The following example illustrates the precision of the computed solutions.
sols20≔WitnessPoints⁡x−32+y4−y=0,digits=20:
sols30≔WitnessPoints⁡x−32+y4−y=0,digits=30:
sols50≔WitnessPoints⁡x−32+y4−y=0,digits=50:
A20≔eval⁡x,y,sols201
A20≔2236643505812287089619314196714065569170333976494082437041740630213823534634538685626227668133590597632
A30≔eval⁡x,y,sols301
A30≔9606310710274558964877975332055956341538374868278621028243970633760768104670145749936828015683713499914833166153499473114484112975882535043072
X≔eval⁡x,y,sols501
X≔28352824826395170252212036438729579929395810572048135085122599643269271108668667762172024734689499129774688174083089317425291139509418491362021802368803636151984679782349039857307708443467467104868809893875799651909875269632
with⁡LinearAlgebra:
Norm⁡A20−X,1.Norm⁡A20,1.
3.639830510×10−26
Norm⁡A30−X,1.Norm⁡A30,1.
5.423126944×10−36
In the next example we give a seed to the rand function in order to transform the command WitnessPoints in a deterministic function.
WitnessPoints⁡y⁢z,x⁢y−z2,x,y,z
x=0,y=0,z=0,x=18,y=0,z=0
x=0,y=0,z=0,x=75,y=0,z=0
seed≔123456789
randomize⁡seed:
x=0,y=0,z=0,x=79,y=0,z=0
The command doesn't handle mixed equations and inequalities/inequations.
WitnessPoints⁡x<0,x=3
Error, (in RootFinding:-WitnessPoints) WitnessPoints does not handle mixed equations and inequalities/inequations
See Also
HasRealRoots
Parametric
randomize
Download Help Document