nm

12323 Reputation

20 Badges

14 years, 20 days

MaplePrimes Activity


These are replies submitted by nm

@dharr 

"I guess with infinity it is safer to routinely use limit."

Yes ofcourse, but as I said, this is all done in code.

The code that use eval does not check now if the value to replace in the expression is infinity or not. I can add this check, but eval() is used in 1,000 of places and no check now is done.

I can ofcourse make my own my_eval() and inside it add this check so it is done in one place and change all current calls to eval() to my_eval().

But the bigger question is not any of this.

It is this:  should the underlying CAS system handle this itself and do the right thing (which would be to return undefined in this example), or should user code be the one responsible for calling eval with correct arguments?

Returning wrong value from a Maple builtin function is never an acceptable option, no matter what the user calls it with, and even if it is documented.  One can not document away wrong design in a function by saying

              "This function can return wrong answers if called with wrong input, so make sure to use correct input"

Also speed and performance should never be consideration when it comes to returning correct result or not. I'd rather have a very slow function that always return correct results than a super fast one that once in a while returns a wrong result.

@Kitonum 

The problem with this Maple design is that eval can then return wrong results.

This is all done in code.   

How is a function supposed to know that there is issue such as this before using eval on an expression being passed to it?

It seems then one should always use limit to replace symbol by value in expression to be safe. right?

So I have now to go over all my code and replace each place eval is used by limit.

I found this by accident when I was getting wrong result from some computation. 

It would be much better design if eval returns undefined instead in such case. This way the code can detect this problem instead of returning wrong result.

Fyi, using the view option is correct, it is what Maple AI says to do when I just asked it how to set x range using plots:-display

AI said:

To set the x-range (and optionally the y-range) when combining plots with plots:-display, pass the view option to display. 
The view option takes a list [xmin..xmax, ymin..ymax]. If you only want to control the x-range you 
still supply both ranges, e.g. use the full y-span that you want to keep.

Below is a short example showing two plots combined while fixing the x-range to 0..2*Pi and the y-range to -1.5..1.5.

Notes:
• If the individual plots already have different x-ranges, the view option passed to display overrides them.
• You can also use numeric endpoints (e.g. 0..6.283185307179586) or symbolic expressions (e.g. 0..2*Pi).
• If you only want to set x-range but leave y autoscaled, give a wide y-interval (for example -infinity..infinity is not accepted; instead choose a sufficiently large range or compute the needed y-limits beforehand).

@acer 

That is strange. But I just updated the link, and checked it works OK.

https://mapleprimes.com/questions/231890-How-To-Make-Maple-Write-Sqrt22-As-1sqrt2-


Hopefully the link is OK now. I must have pasted wrong link first.

This is builtin transformation and there is no easy way or option to disable it. But see same question here

https://mapleprimes.com/questions/231890-How-To-Make-Maple-Write-Sqrt22-As-1sqrt2-

May be Maplesoft should have an option to turn this off.

fyi,

Maple 2026 introduced new type just for this, called variable

So one can now just do indets(expr,variable)

I do not use equations labels, but I just turned it on, and labels do show. Maple 2026 on windows 10.

Did you check under options,  that equations labels are turned on?

If so, then this could be windows 11 issue.

 

@Alfred_F 

You could also look at 

PolynomialTools:-Split(x^4-12*x-12,x);

But factors are given in terms of RootOf.  see ?Split for more info.

@janhardo 

Thanks for code. So which do you think is better for making UI in Maple? Maplets or Explore?

@janhardo 

Thanks, but are you saying Maplets do not have sliders?  I need sliders to change parameters as it is much easier to use.

I've had same exact error many times.   Unable-To-Upload-Worksheet-To-MaplePrimes

It seems random and no one knows what causes it.  

@sand15 

Thanks for checking. Then it is a bug in recent versions of Maple. Will report it now. I doubt this will be fixed by Maple 2026 but may be in a future version it will.

@dharr 

You are right, I did not check Maple 2025.2. I've been using Maple 2026 Beta 2 for testing all the time now, and that is what I was using. Yes, Maple 2025 gives undefined for second argument. 

@dharr 

"My point is that the OP presumably got that from odetest, though they do not explicitly say that, "

Yes, from odetest. Here is screen shot and code below

 

ode:=x^2*diff(y(x),x)+cos(2*y(x)) = 1; 
ic:=y(infinity) = 5/4*Pi; 
mysol:=cot(y(x))=2/x+1;
odetest(mysol,[ode,ic]);

 

@sand15 

"You say that other CAS answer differently?"

Fyi, Here is sympy result

Here is Fricas

Here is Mathematica

Mathematica does give  +Pi*c1  but leaves c1 integer undefined. So it can be zero, 1, 2 etc....  but it adds Pi*c1 in both cases as you see.

1 2 3 4 5 6 7 Last Page 2 of 95