plot::implicit -- implicit plot
of smooth functions
Introductionplot::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.
Call(s)plot::implicit(expr, x=a..b, y=c..d <,
options>)
plot::implicit([expr, ...], x=a..b, y=c..d <,
options>)
Parametersexpr |
- | 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 |
OptionsGrid = 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. |
Returnsa graphical object of the domain type plot::Group.
Related
Functionsplot::contour,
plotfunc2d,
plot2d
Detailsplot::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.
Option: Grid = gridvalgridval 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].
Option: Colors = [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]].
Option: MinStepsize = hmin
Option: MaxStepsize = hmax
Option: StartingStepsize = hstart
Option: Precision = eps
Option: Contours = [c1...][0].
Example
1Let's have a look at elliptic curves:
>> plot(
plot::implicit((x^3 + x + 2) - y^2,
x = -5..5, y = -5..5),
Scaling=Constrained
)
Example
2To 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)
Example
3We 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)
Example
4plot::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:
Example
5In 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:
Example
6We 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:
Background