acer

32617 Reputation

29 Badges

20 years, 43 days
Ontario, Canada

Social Networks and Content at Maplesoft.com

MaplePrimes Activity


These are replies submitted by acer

@exality The call to set interface(displayprecision) must be in its own Document Block or Execution Group, and not in one that is preceded with a call to restart. The GUI is finicky/buggy that way.

Having such a call be part of the document allows it to override the users' own GUI preferences for display precision (as set under Tools->Options from the menubar) , which can sometimes be useful.

You can also put such a call to interface() inside the Startup Region of a worksheet or Document. Here is an example: displayprec.mw

I suggest that you do not decrease Digits as any kind of general way to control the display precision since, as you mentioned, that is just going to interfere with your computations (unless you decrease and increase Digits or fine-tune your evalf calls, all of which is the opposite of the convenience you're going for).

As for Maple dynamically adjusting the numeric formatting as well as the units prefix, together, that sounds tricky to accomplish now, without a change in how the GUI performs its Numeric Formatting. It's an interesting suggestion. (It might be possible to get some similar effect now, using a customing `print/*` procedure, but it could get tricky and maybe even hairy in some corner cases of printing unusual things. I might give it a whirl.)

@Alex Bowden You just wrote [italics mine], "If (x-1)(1+x) were inherently ambiguous, why would Maple output it to me on the previous line? "

That is, you have claimed that Maple's output had no space between the brackets pairs.

Please upload a document where Maple returned output with that purported (x-1)(1+x) in it, lacking any space between the two brackets subexpressions.

Maple prints the product of x-1 and 1+x with a space between the brackets, which denotes multiplication. In 2D Input mode you can even enter it in that very same way, and that's the default mode for new users.

You can copy and paste that pretty-printed output into both a 1D or a 2D input line and get the appropriate product.

It looks to me as if you simply failed to notice the space that does appear between the brackets pairs in the pretty-printed output, and then re-entered the expression wrongly.

If you really want you can set the GUI's default to Worksheet instead of Document, set GUI's default to 1D rather than 2D input mode, and then issue the command interface(prettyprint=0). Then you can get input and output both with explicit multiplication symbols for this example. I think that'd be overkill, but you have the choice.

As I mentioned, the default for new users is 2D Input and pretty-printed 2D Output. Personally I prefer 1D Input and 2D Output (though I reach for the lprint command now and then. But you can set each as you wish.

@Kitonum I usually also pass the option adaptive=false alongside the numpoints option, to force a precise number of independent data points.

@_Maxim_ Thank you. Can you show how you arrived at the form in your det3?

@Markiyan Hirnyk I got as far as this ("unsigned Stirling numbers of the first kind", using OEIS on the coeffs of the expanded numerator): https://oeis.org/A132393. In other words, coefficients in terms of Maple's Stirling1 command. The coefficients were at increasing offsets into that sequence, with the offset being simple. I got that even for a and b without values.

When you say an "explicit formula" of n+1 terms, what precisely do you mean? Are you hoping to disallow any other nesting of summation? What, if any, special function calls are allowed?

I have no constructive proof of this guess yet. When you write that it must be done with Maple, does that allow for even this kind of preliminary observation, say using the OEIS package downloadable for Maple 2017? I realize that you want a proof, not a guess.

I converted your Post to a Question. Please enter future queries as Questions rather than Posts.

The behavior is consistent with the renumbering that occurs when earlier labeled equations are deleted.

So I suspect that it is all deliberate design.

Whether you consider that behavior in itself to be a bug depends on whether you agree with the design.

Personally I have no issue with it, as described above and if working properly as such.

@nm I think that your question was quite unclear about that point.

I think that it's still unclear exactly what your trying to accomplish. Why use a text editing program to write an explicit string in  a Maple procedure which itself simply writes out that string elsewhere. Why not use the text editor to write the output file directly? In that scenario you could import that string as a string and not get hit by the backslash terminator issue at all (ie. without having to work around it or use an explicit escape token or an extra blank space etc). You could import it, optionally alter it, and then export is once again without ever having to be bothered by writing explicit escape sequences or extra blank spaces after trailing backslash instances.

Btw, your posted Maple source has a syntax error, missing a statement terminator/separator (color or semicolon) after the local declaration. After fixing that then it seemed to me that the only issue was in the backslash as line continuation character for Maple code. But I could get the final process_file procedure to work regardless of whether I used read or readbytes, after handling the terminating backslash.

I still think it's very odd that you're apparently not very upset by having to deal with escaping backslashes but inconsistently much more concerned with anything extra related to newlines. But I can think of several other ways to get the newline following a terminating backslash without having to introduce an extra blank space. They don't all need \n after each line -- I just put those in for clarity because your restrictions weren't clear to me.

@vv For fun,

restart;

plot3d(evalc(Re(sqrt(1/(x+I*'convert(y,rational)'))*erf(sqrt(x+I*y)))),
       x = -2 .. 2, y = -2 .. 2,
       orientation=[-110,80,0]);

f:=z->sqrt(1/z)*erf(sqrt(z)):
f(0):=1:
A:=Matrix(40,40, (i,j)-> evalf(Re(f((i-20)/10 + I*(j-20)/10)))):
plots:-surfdata(A, view=-3..3, orientation=[-110,80,0]);

...compared with

B:=Matrix(40,40, (i,j)-> evalhf(Re(f((i-20)/10 + I*(j-20)/10)))):
plots:-surfdata(B, view=-3..3, orientation=[-110,80,0]);

evalf(Re(f((0-20)/10 + I*(20-20)/10)));
                          -2.668000514

evalf(Re(f((0.0-20.0)/10.0 + I*(20.0-20.0)/10.0)));
                          2.668000512

sqrt(1/(-2.0+0.0*I)), sqrt(1/(-2.0));
              0. - 0.7071067812 I, 0.7071067812 I

sqrt(-0.5-0.0*I), sqrt(-0.5);
              0. - 0.7071067812 I, 0.7071067812 I

@Elisha You misspelled stepsize as stepsise.

 

Please don't post duplicates of the problem, as you try and figure out correct syntax and problem formulation.

@animeplot I could spend some time on the weekend writing Maplet code to do all of that, so try and see what might be happening. But it'd save time and effort (and possibly red-herrings if my code did something importantly different) if you could just let me look at your full source.

If you'd rather not post it all here (in a single worksheet of zipped file) as an uploaded attachment on a Comment/Reply then please feel free to send me a private message via Mapleprimes. I'd respond via emai, and then you'd have an email address to send it to. I understand, if you are not free to do this, though.

@Rouben Rostamian  That is a very good answer (as is Kitonum's).

I have submitted a bug report, suggesting that the Help pages for commands like plottools:-disk contain such useful and directly accessible Examples. (That is to say, the details in the style option's description on the ?plot,options page are too far removed from the ?plottools,disk Help page.) And the same goes for several other plottools commands' individual Help pages.

[edited above]

@Christopher2222 That is because `sum` can act like `add` , in the sense of adding up a small finite number of terms. IIRC it is a cutoff of something like 1000 terms. So for that small range it acts like one of the earlier responses. Above that cutoff it tries for actual symbolic summation, striving for a closed form formula.

@Kitonum Ahh. Thanks. I ought to have tried at least this:
 

Q:=Sum(cos(2*Pi*k/(b-a+1)), k=a..b):
value(eval(Q,a=0));
                       0
First 266 267 268 269 270 271 272 Last Page 268 of 596