NSolveValues
NSolveValues[expr,vars]
attempts to find numerical approximations to the values of vars determined by the solutions of the system expr.
NSolveValues[expr,vars,Reals]
finds solutions over the domain of real numbers.
Details and Options


- The system expr can be any logical combination of:
-
lhs==rhs equations lhs!=rhs inequations lhs>rhs or lhs>=rhs inequalities expr∈dom domain specifications {x,y,…}∈reg region specification ForAll[x,cond,expr] universal quantifiers Exists[x,cond,expr] existential quantifiers - NSolveValues[{expr1,expr2,…},vars] is equivalent to NSolveValues[expr1&&expr2&&…,vars].
- A single variable or a list of variables can be specified.
- If a single variable is specified, the result is a list of values of the variable for which expr is True.
- If a list of variables is specified, the result is a list of lists of values for the variables for which expr is True.
- When a single variable is specified and a particular root of an equation has multiplicity greater than one, NSolveValues gives several copies of the corresponding solution.
- NSolveValues[expr,vars] assumes by default that quantities appearing algebraically in inequalities are real, while all other quantities are complex.
- In NSolveValues[expr,vars,Reals] all variables, parameters, constants and function values are restricted to be real.
- NSolveValues[expr&&vars∈Reals,vars,Complexes] solves for real values of variables, but function values are allowed to be complex.
- NSolveValues[…,x∈reg,Reals] constrains x to be in the region reg. The different coordinates for x can be referred to using Indexed[x,i].
- NSolveValues deals primarily with linear and polynomial equations.
- The following options can be given:
-
Method Automatic what method should be used RandomSeeding 1234 the seeding of pseudorandom generators VerifySolutions Automatic whether to verify solutions WorkingPrecision Automatic precision to be used in computations - Possible Method settings include "EndomorphismMatrix" and "Homotopy".
Examples
open allclose allBasic Examples (5)
Scope (45)
Complex Equations in One Variable (8)
Univariate polynomial equations:
Polynomial equations with inexact coefficients:
Polynomial equations with multiple roots:

Univariate elementary function equations over bounded regions:
Univariate holomorphic function equations over bounded regions:
Equation with a purely imaginary period over a vertical stripe in the complex plane:
Systems of Complex Equations in Several Variables (8)
Real Equations in One Variable (11)
Polynomial equations with multiple roots:
Transcendental equations, solvable using inverse functions:
Transcendental equations, solvable using special function zeros:
Transcendental inequalities, solvable using special function zeros:
High-degree sparse polynomial equations:
Algebraic equations involving high-degree radicals:
Equations involving irrational real powers:
Tame elementary function equations:
Systems of Real Equations and Inequalities in Several Variables (9)
Quantified polynomial systems:
Transcendental systems, solvable using inverse functions:
Systems exp-log in the first variable and polynomial in the other variables:
Systems elementary and bounded in the first variable and polynomial in the other variables:
Systems holomorphic and bounded in the first variable and polynomial in the other variables:


Options (3)
Method (1)
By default, NSolveValues introduces slicing hyperplanes for underdetermined complex systems:

With Method->{"UseSlicingHyperplanes"->False}, NSolveValues gives parametric solutions:

VerifySolutions (1)
NSolveValues verifies solutions obtained using non-equivalent transformations:
With VerifySolutions->False, NSolve does not verify the solutions:
Some of the solutions returned with VerifySolutions->False are not correct:
This uses a fast numeric test in an attempt to select correct solutions:
In this case, the simple numeric verification gives the correct solution set:
WorkingPrecision (1)
By default, NSolveValues finds solutions of exact equations using machine-precision computations:
Applications (11)
Geometry (11)
Find intersection points of a circle and a parabola:
Find the intersection of InfiniteLine[{0,0},{1,1}] and InfiniteLine[{{0,1},{1,0}}]:
Find the intersections of InfiniteLine[{0,0},{1,1}] and Circle[{0,0},1]:
Find all pairwise intersections between five random lines:
Use BooleanCountingFunction to express that exactly two conditions are true:
Find the pairwise intersections of the circles Circle[{1/3 Cos[k 2π/5],1/3 Sin[k 2π/5]}] for k=0,…,4:
Find the intersection of InfiniteLine[{{-1,1,1},{1,1,1}}] and InfinitePlane[{{2,0,0},{0,2,0},{0,0,2}}]:
Find the intersections of InfiniteLine[{{-1,1,1},{1,1,1}}] and Sphere[{0,0,0},3]:
Find the intersections of InfiniteLine[{{-1,1/3,1/2},{1,1/3,1/2}}] and the boundary of Tetrahedron[{{0,0,0},{1,0,0},{0,1,0},{0,0,1}}]:
Find the intersection for three random planes:
Find the intersections of the spheres Sphere[{1/3 Cos[k 2π/3],1/3 Sin[k 2π/3],0}] for k=0,1,2:
Find all the intersections of exactly three planes among 10 random planes:
Use BooleanCountingFunction to find the condition of exactly three things being true:
Properties & Relations (7)
Solutions approximately satisfy the equations:
For univariate equations, NSolveValues repeats solutions according to their multiplicity:
Find solutions over specified domains:
NSolveValues gives values of the solutions:
NSolve represents solutions in terms of replacement rules:
NSolveValues is a global equation solver:
FindRoot is a local equation solver:
NSolveValues gives approximate results:
Use SolveValues to get exact solutions:
Use FindInstance to get exact solution instances:
Use NDSolveValue to solve differential equations numerically:
Possible Issues (4)
Solutions obtained with machine-precision numeric computations may not be accurate:
With higher WorkingPrecision, more accurate results are produced:
Approximate solutions may not satisfy the equations due to numeric errors:
The equations are satisfied up to a certain tolerance:
Using higher WorkingPrecision will give solutions with smaller tolerance:
If the solutions set is infinite, NSolveValues gives its intersection with random hyperplanes:



Use ContourPlot and ContourPlot3D to view the real part of solutions:
With domain Reals specified, NSolveValues may not find solutions for which the function is not real valued in any neighborhood of the solution:
Text
Wolfram Research (2021), NSolveValues, Wolfram Language function, https://reference.wolfram.com/language/ref/NSolveValues.html.
CMS
Wolfram Language. 2021. "NSolveValues." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/NSolveValues.html.
APA
Wolfram Language. (2021). NSolveValues. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/NSolveValues.html