Carl Love

Carl Love

28055 Reputation

25 Badges

12 years, 356 days
Himself
Wayland, Massachusetts, United States
My name was formerly Carl Devore.

MaplePrimes Activity


These are replies submitted by Carl Love

@tomleslie You wrote:

  • I can see quite a lot of freeze() and thaw() commands bweing used!

It only requires one freeze and one thaw. Indeed, it can all be done in a single line:

thaw([solve](subs(diff(y(x),x)= freeze(diff(y(x),x)), eq), y(x)))[],

where eq is the ODE in "normal" form (with diff, not D).

@adel-00 I did the following things:

1. I set Digits:= 15
2. I made the substitution for as we discussed.
3. I set epsilon = 1e-5 in the Int command. This means I was trying for about 5 digits precision.
4. I used -20.. 20 as the interval of integration.
5. I set d=1.
6. I attempted to numerically integrate the real part of the integrand, i.e., I wrapped it with Re.

After 4 hours or so, the integral returned unevaluated. I guess that that means that it couldn't achieve even the 5 or so digits of accuracy implied by epsilon=1e-5.

I also tried several other things.

@mmcdara 

The command index was added in Maple 2017. For older Maple, simply replace index with 

e-> e[_rest]

For horizontally displayed fractions, modify the table creation command to 

Fr:= table(
    sort([indets(P, And(string, float &under parse))[]]) =~
    map(
        f-> sprintf("%d/%d", op(f)),
        sort([indets(GraphTheory:-WeightMatrix(G), fraction)[]])
    )
):
subsindets[2](r, And(string, float &under parse), Fr, e-> e[_rest]);

@snowman You're welcome. See the followup "Aliasing" that I just added to my Answer.

I finally got a chance to look at the plots from your Question on a standard-resolution (HD) monitor instead the high-resolution HP (QHD) and Samsung Galaxy Note (WQHD) that I usually use. And now that I've done that, I'm convinced that the issue that causes the "roughness" is what I suspected when I wrote the Answer above: Technically, it's called aliasing, and it's a major issue in all computer graphics, and indeed in any discretized representation of a continuous process. In terms simplified to this particular application--the plotting of curves--it's a result of there being too many computed points (rather than too few) compared to the number of available pixels.

There are some things that you can do in Maple to ameliorate aliasing. The first of these applies in general, the second is specific to implicitplot, and the third could be applied to any curve-plotting command.

  1. Go to menu Tools --> Options --> Display and set "plot anti-aliasing" to "enabled" if it's not already so.
  2. Use the resolution option to reduce the number of points in the plot structure and hence the number of points sent to the renderer. The value of the option needs to be based on your specific output device.
  3. In this particular case, your curve is perfectly smooth (in the mathematical sense) and monotonic, so there's no need to compute a large number of points (via a high gridrefine) in the first place.

Wikipedia has detailed information about aliasing: "Anti-aliasing" is an index article to seven Wikipedia articles on the subject. The last of these, "The Nyquist-Shannon sampling theorem", provides a mathematically precise description of the phenomenon.

 

Please edit your MaplePrimes profile so that you have a username other than the empty string (click on Account in the upper right corner). It can be totally anonymous; it's just so that we have something to refer to you by. If you have some good reason to not have a username, please let me know, and I'll take it into consideration. Also, you can change your username at any time while retaining the same account. 

@adel-00 The square root of the absolute value of anything is real.

@mmcdara I mostly agree, but the average newbie Questioner can't be expected to deconstruct their worksheet into plaintext form, and just posting a link to a worksheet means that I can't read it on my phone.

The tools that exist for converting 2D Input and 2D Output (at prettyprint > 1) to plaintext form produce a hideous mess that is just barely suitable to be read by a human. 2D Output using prettyprint = 1 can be neatly displayed, but only by someone who's very familiar with the MaplePrimes editor.

@acer Off the the top of my head, here are six more issues to add to your list of two issues that didn't work right even when it was possible to post worksheets: 

3) A blank line that was intentionally inserted at the end of a text section (to offset it from the following executable section) would be removed. 

4) Equation labels that weren't wanted would be added.

5) Array plots (such as side-by-side plots) wouldn't be displayed.

6) Code edit regions wouldn't be displayed.

7) Output that was normally center justified (such as just about any prettyprinted output) would be left justified. 

8) Long lines of code would wrap rather than horizontally scroll.

@adel-00 Assuming that N, delta, Delta, w are real (which seems to be the case), how is your two-case formulation of any different from sqrt(abs(N*(N+1) - (delta-Delta+w)^2))?

@mmcdara You have implied that the resolution option can increase the number of points. Perhaps that is true for some weird example. But the purpose of the option, as stated on the help page, is to reduce the number of points.

There has been no official response about this matter, not even acknowledgement of the existence of a problem. As I understand it, no one can display worksheets now. Thus this new issue has superceded as well as overshadowed my Question, which hasn't been answered: Specifically, Why haven't I been able to post any worksheet for a year even at times when other people could? 

@adel-00 And what is d?

Note that r can be replaced by simply sqrt(abs(N*(N+1) - (delta-Delta+w)^2)).

@snowman You wrote:

  • You mean that when numpoints is specified, increasing the gridrefine may make the needed numpoints surpass the specified numpoints, as a result, making the figure is rougher?  Only when the number of needed numpoints for gridrefine is less than the specified numpoints, can the figure is smooth?

The numpoints option just causes confusion, and it shouldn't be used at all. It's functionality is completely superceded by the grid option. It causes confusion because it has no relation to the numpoints option of the regular plot command, nor does it specify the number of computed points, nor even the initial number of computed points, in an implicitplot. All that it does is set the initial grid at N, where is roughly sqrt(numpoints). I emphasize initial grid because the gridrefine option may increase the grid, but only within the rectangles that have a point of the curve.

  • By the way, how do you figure out that For gridrefine=3 F(x,y) is calculated at 515 points, while 4119 points are used for gridrefine=6.

As long as the resolution option is not used, the number of computed points can be determined as the number of rows in the point-data matrix of the plot structure. This is op([1,1,2,1,2], P) where is the plot structure (the return value of the implicitplot command). For example, using your F:

P||(0..6):= plots:-implicitplot~(F, 0..20, 0..10, gridrefine=~ [$0..6])[]:
map2(op, [1,1,2,1,2], [P||(0..6)]);

             
[83, 165, 331, 659, 1317, 2631, 5263]

We see that the number of computed points approximately doubles (and that's a very close approximation) for each unit increase in gridrefine, which is exactly what I'd expect for a monotonic curve.

  • There's a formula that The highest grid level for gridrefine=l will be [2^l*m,2^l*n] , which may not help me to achieve the value of 515, and 4119.

That formula is misleading because only grid rectangles that are already known to contain a point of the curve are subdivided. For a monotonic curve, that's relatively few of the rectangles. But suppose I change your F to a nearly space-filling curve:

F1:= (x,y)-> y-sin(99*x):
P||(0..6):= plots:-implicitplot~(F1, 0..20, -1..1, gridrefine=~ [$0..6])[]:
map2(op, [1,1,2,1,2], [P||(0..6)]);

       [759, 2647, 5935, 49501, 126235, 771225, 1892517]

  • The results of  "showstat(`plots/implicitplot`) )" are too long, which confuses me a lot.

You won't be able to understand the roughness issue by reading any Maple code. All the Maple code does is compute some number of points (x,y) such that F(x,y) = 0 (and some other trivialities like defining the axes and colors). The end result of the Maple code can be examined by using ​​​​​​op(P) (note: no index numbers for this op) on the returned plot structure P. You'll see that it's trivial, (which is not to say that the computations done by implicitplot are trivial, just that in this case the end result of those computations is), and it's still fairly far from an actual visual plot. To actually display the plot on a physical device, the plot structure is passed to rendering code. This code is not written in Maple, and you can't see it. Obviously, the number of points (or pixels) actually plotted on your screen is determined by your screen's resolution (the number of pixels that it has).

@adel-00 The expression L1 contains a parameter r. It can't be numerically integrated without specifying a value for r.

First 142 143 144 145 146 147 148 Last Page 144 of 709