WOLFRAM|DEMONSTRATIONS PROJECT

All Roots of Two Systems of Algebraic Equations

​
test problem 1
test problem 2
b
5
a
0.5
contour plot 1
contour plot 2
root list
This Demonstration illustrates how one can use NDSolve's WhenEvent option to determine the roots of a system of nonlinear algebraic equations:
f
1
(x,y)=0
and
f
2
(x,y)=0
. An attractive feature of the method is that one does not need not need to know at the outset an approximate guess for the roots. All one needs to do is specify the solution domain
:
x
1
<x<
x
2
,
y
1
<y<
y
2
.
Consider the two test problems consisting of two-dimensional systems of algebraic equations:
1. ​
f
1
(x,y)=
2
x
2
b
+
2
y
-1=0
,
f
2
(x,y)=axy-1=0
.
2. ​
f
1
(x,y)=cos(bx)-axy+1=0
,
f
2
(x,y)=xy-1=0
.
You can vary the parameters
a
and
b
.
This Demonstration finds all the roots of these two problems in the range
-20<x<20
(for test problem 1) and
0<x<10
(for test problem 2).
The first contour plot is the graph of
f
1
(x,y)=0
and
f
2
(x,y)=0
, and the second shows the level curves of
f
1
2
(x,y)
+
f
2
2
(x,y)
, which is minimized at a solution to the system.