plot::implicit
-- implicit plot
of smooth functionsplot::implicit
is used to get a plot of f=0
for a smooth f from |R^2->|R. f
must be regular almost everywhere on this curve.
plot::implicit(expr, x=a..b, y=c..d <,
options>)
plot::implicit([expr, ...], x=a..b, y=c..d <,
options>)
expr |
- | function(s) to plot, given as arithmetical expression(s) in two identifiers |
x, y |
- | identifiers used in expr |
a..b, c..d |
- | ranges to plot |
Grid = gridval |
- | grid division to use for finding starting points |
Colors =
[col1...] |
- | colors used for plotting the components. |
MinStepsize =
hmin |
- | minimum step-size for tracing a contour |
MaxStepsize =
hmax |
- | maximum step-size for tracing a contour |
StartingStepsize =
hstart |
- | step-size the iteration starts with |
Precision =
eps |
- | precision of the Newton iteration |
Contours =
[c1...] |
- | contours to plot |
Splines =
Boolean |
- | If set to TRUE , the contours will be plotted with
cubic splines; otherwise, straight lines will be used. Default:
FALSE . |
Factor =
Boolean |
- | If set to TRUE , each function will be factored
prior to iterating. This may improve the results. Default: FALSE . |
a graphical object of the domain type plot::Group
.
plot::contour
,
plotfunc2d
,
plot2d
plot::implicit
plots f=0 by a curve
tracking method. For this, it first generates start points with a
Newton iteration starting at grid points (the number of grid points can
be controlled with the option Grid) and then
iteratively applies the implicit function lemma to get a local
approximation to the curve. This approximation is then improved with
another Newton step. On hitting a point where f is not
regular, the iteration stops.gridval
gridval
must either be a list of two positive
integers, the number of divisions in the two coordinates, or a single
integer, which is equivalent to repeating this integer twice.[5, 5]
.[col1...]
Color=[Flat,...]
option of plot2d
.[[1.0, 0.0, 0.0], [0.0, 1.0, 0.0], [0.0, 0.0, 1.0],
[1.0, 1.0, 0.0], [1.0, 0.0, 1.0], [0.0, 1.0, 1.0], [1.0, 1.0,
1.0]]
.hmin
hmax
hstart
eps
[c1...]
[0]
.Let's have a look at elliptic curves:
>> plot( plot::implicit((x^3 + x + 2) - y^2, x = -5..5, y = -5..5), Scaling=Constrained )
To demonstrate how to plot multiple implicit functions, we plot y=x^2, y=x and x=y^2:
>> s:= plot::implicit( [x^2 - y, x - y, x - y^2], x = -4..4, y = -4..4 ): plot(s)
We plot the family x=y^2+c for c in [-5,5]:
>> p:= plot::implicit( y^2 - x, x = -1..25, y = -5..5, Contours = [$-5..5] ): plot(p, Axes = Origin)
plot::implicit
handles quite complex
expressions. In the following example, the circle around the origin is
left out by many similar tools:
>> plot( plot::implicit((1-0.99*exp(x^2+y^2))*(x^10-1-y), x=-1.25..1.25,y=-1.1..2) ):
>> F2 := (x,y) -> x^4*y^4+sin(x)*cos(y)-(x-1)*(y-2)*exp(-x^2): plot(plot::implicit(F2(x,y),x=-10..10,y=-10..10)):
>> delete F2:
In some cases, DIGITS
must be increased to get a
correct result. In the following example, problems occur around the
origin with the default setting of DIGITS
when a small region is to be
displayed. First, we display the whole picture:
>> F3 := (x,y) -> y*(3*x^2-y^2)-(x^2+y^2)^2: plot(plot::implicit(F3(x, y), x = -1..1, y = -1.3..0.7)):
Near the origin, numeric cancellation occurs. If you try
to depict a small area around the origin of the above curve, you need
to increase DIGITS
:
>> delete DIGITS: plot( plot::implicit(F3(x, y), x = -0.005..0.005, y = -0.005..0.005) ):
>> DIGITS := 15: plot( plot::implicit(F3(x, y), x = -0.005..0.005, y = -0.005..0.005) ): delete DIGITS:
We plot sin(5*sin(x)*y)=0. This is an example
where multiple implicit functions are found. With a low setting of
DIGITS
, strange
artefacts occur:
>> DIGITS := 50: plot( plot::implicit(sin(5*sin(x)*y), x = -5..5, y = -5..5) ): delete DIGITS: