acer

31285 Reputation

29 Badges

19 years, 106 days
Ontario, Canada

Social Networks and Content at Maplesoft.com

MaplePrimes Activity


These are questions asked by acer

Suppose that I wanted to produce a 2D plot which was coloured in the region between two functions.

I mean not just between two curves, but between two functions. I would like to make the curves appear as smooth as Maple knows how, but without getting any jaggedness due to using a high grid in an implicitpot.

Consider this example. These two curves are displayed as being quite smooth (using adaptive plotting or whatever `plot` knows to use). How best can the regions between these two curves be filled, without having to recourse perhaps to a rough implicit plot?

plot([x^2-1, -x-1], x=-1.5..1.5, y=-1.5..1.5, color=black);



A simple trick with a product provides a defined implicit region that `implicitplot` can handle. But there can be small gaps, or irregularities, because the formulas for the curves are being solved in a complicated way and no longer being used as mere functions.

plots:-implicitplot( (y - (x^2-1))*(y - (-x-1)),
                     x=-1.5..1.5, y=-1.5..1.5,
                     filledregions=true, gridrefine=4,
                     coloring=[COLOUR(RGB,.8,.8,.9),"white"],
                     axes=boxed, labels=["x","y"],
                     view=[-1.5..1.5,-1.5..1.5] );



Another technique is to overlay two simpler implicit plots, colouring and layering them carefully so as to give the impression that only the inner regions had been coloured. The problem here is that the intersections all have to be computed and the problem split up piecemeal (which I did not do) so that the layered colouring is adjusted to whichever curve lies on top. Without that care, then something like this happens, with odd subregions appearing uncoloured.

plots:-display(
   plots:-implicitplot( x^2-1 >= y, x=-1.5..1.5, y=-1.5..1.5,
                        filledregions=true, gridrefine=4,
                        coloring=["white","white"] ),
   plots:-implicitplot( -x-1 >= y, x=-1.5..1.5, y=-1.5..1.5,
                        filledregions=true, gridrefine=2,
                        coloring=[COLOUR(RGB,.8,.8,.9),"white"] ),
               axes=boxed, labels=["x","y"], view=[-1.5..1.5,-1.5..1.5]);



Did I miss something obvious? Is there some other calling sequence or command that makes this much easier (and smoother, by default)?

On the main page for the Rubi rule-based integrator, there is a table comparing results of Rubi against Maple and Mathematica.

On the face of it, the Maple results don't look so good. Maple is claimed as scoring about 82% correct on the author's example test suite. But only 42% of the suite gets an "optimal" result from Maple. The other 40% that Maple is claimed to get correct have results that are described as "Messy:

On the usenet newsgroup sci.math.symbolic Prof. Richard Fateman posted a question (or here) recently about what mechanisms a math application could use to handle the situation of negligible imaginary parts of computed data when plotting.

An example could...

Here's my first attempt at posting some 2DMath on this site.

First, I will paste directly from 2D output in a running Standard GUI Maple session.

BesselJ(0, x)+GAMMA(Psi)-sqrt(abs(omega))

Am I missing some justification for this last one?

> zip(`/`,Array([3]),Array([9]));
                                     [1/3]
 
> zip(`/`,Array([3],datatype=integer[4]),Array([9]));
                                     [1/3]
 
> zip(`/`,Array([3]),Array([9],datatype=integer[4]));
                                     [1/3]
 
> zip(`/`,Array([3],datatype=integer[4]),Array([9],datatype=integer[4]));
                            [0.333333333333333315]
1 2 3 Page 2 of 3