nm

8552 Reputation

19 Badges

12 years, 352 days

MaplePrimes Activity


These are replies submitted by nm

@acer 

Your method of checking for op(0,....) does not work for all cases. Sometimes Maple returns partial result, which has "int" inside. i.e. not complete evaluation. How would I check for such cases? I need to check that expression returned is free of "int" any where. But I do not know how to do this in Maple.

Here is an example

restart;
g:=int(exp(m*x)*tan(x)^2,x);

For me, the above is not fully solved. There is an antiderivative for this but maple does not find it. But if I use your method, it says it passed:

if op(0,eval(g,1)) = int then
  print('failed');
else
  print('success');
fi;

                success

I hope there is a method to check for such cases.  Fyi, here is Mathematica result for the above

Integrate[E^(m*x)*Tan[x]^2, x]

@acer 

I find the idea of `int` emitting an error instead of an unevaluated return to be generally poor

The correct API should always return a status code, some kind of indication of success or faliure code. In addition to result if any. I did not mean to just throw an error in place of what is currently done. I should have made this more clear.

For example, one can do   

    g,status = int(sin(x),x)

and one checks for status first, which would indicate success of failure. i.e. if int was able to complete or not, this does not mean the result is mathematically valid, which is another issue. Now the user can check for status, and if indicates success, then they know g will contain the antiderivative. If status is missing, the above becomes the same as currently done.

If the API can't be changed, another option is to set a global symbol, say $STATUS_OF_LAST_CALL, and now once can check on that instead, while the API remain unchanged so older code do not break.

This is very useful for automated regression test scripts, to be able to verify against.

But your method of op(0,eval(g,1)) = int  worked, thank you, so will use this. But my point is that a common approach is need for all commands of this nature, such as dsolve, etc... which works the same instead of having to figure how to check the status case by case depending on the command currently used.

@Axel Vogt 

Thanks, when I saw size option, I tried it on z2 directly and it worked:

simplify(z2,size);

So why did you use combine(%, Int); before that? It works without doing combine.

But I still do not know why simplify worked on z1, but not on term+z1, since "term" did not enter into play at all in all of this.

 

You should post plain text code. How do you expect someone to try your code?? Think about it a little

You need to execute the line

printf("Number of players is %s\n",numplayers);

again to clear the output from last run.

@acer 

Thanks, this worked. But when I want to add new code there, it goes back to 2D math input for any new code added. It also as you said, remain in document mode basically. Also for large document, I had to select all first, else will spend the next 5 years converting one by one. seems to messed the the text part also.

I'll try the export to mpl method now.

(the more I use Maple, the more confusing it gets)

 

@Carl Love 

This result does not look correct. I am not able to plot it or evaluate it to anything due to division by zero. It has GAMMA(0) which is infinity in denominator.

r:=int(cos(t)^n, t= 0..x):
subs({n=1,x=Pi},r);

evalf(%);

Error, (in GAMMA) numeric exception: division by zero

I tried different values and keep getting different error messages:

r:=int(cos(t)^n, t= 0..x):
subs({n=2,x=Pi/3},r);
evalf(%);

Error, (in hypergeom/check_parameters) function doesn't exist: found the number 0 in the second list of parameters

r:=int(cos(t)^n, t= 0..x):
subs({n=3,x=.0212},r);
evalf(%);

Error, (in GAMMA) numeric exception: division by zero

any idea what is going on? I am using Maple 18.02, windows 7

@Carl Love 

I think my point is still not clear. Bringing up help page on ?pi is exactly the reason I thought pi was known to Maple.

If maple has said, like Mathematics does, no such symbol "pi", then I would not have used it in the equation and would have known it is "Pi", since if "pi" is not known, then I would have searched for "Pi".  I am not saying Maple should not have help on "pi" in general. Just do not use ? for this. Use something else.

My point is that ?name should be only for known actual commands and known names with actual values. And not for wild card greping on help pages with text that first matches part of the string.

It is a user interface/usability issue. But I said all I have on this. Maple can do whatever it wants. I just think it bad way to overload ? with grep like this.

 

@Preben Alsholm 

I am not being unreasonable, I am simply being a user.

I find it very confusing to mix ?name with general search, which seems what ? is doing.

If ?name is meant to be like wild card search, which picks any help page with "name" in it, then it should be something else, and not overload ?name on top of it.

You can have ??name for example, or new command, call it search(name), which will act as general wild search. But ?name should be reserved for only known system command and symbols. period.  ?foo should not bring up a help page on units of length. This makes no sense.

 

 

@Carl Love 

What does Mathematica do if you use lowercase pi?

it is as if one typed x and x was not defined.

The difference is that in maple, when I do ?pi  it does actually brings up an official help page on Pi. Which makes one thinks they are the same or they might not notice the upper vs. lower case.

In Mathematica, if I do  ?pi, it returns message saying symbol pi unknown.

 

If pi is just like any random symbol, then I would suggest that ?pi should return symbol not found in Maple. It is very confusing to bring up help pages on something that is not defined in Maple.  I even now tried  ?foo and Maple brought up a help page  titled "units of length" 

Amazing.

 

 

I do not have E:\ drive on my computer and do not have shootlib. and no Shoot package either.

 

@tomleslie 

thanks, that works. It was a syntax issue. I did not know the Maple syntax for this. I tried what you have, but used different syntax, which did not work for me:

solve({eq>0,0<x<1,0<y<1} , {x, y});

The syntax 0<x<1 woks in Mathematica, but now I know it does not work in Maple. One must write 0<x,x<1.

No problem. Thanks. (I find it simpler to 0<x<1 than 0<x and x<1. I wonder why Maple could not support this in the future. Might break old code?)

 

@Carl Love 

that answer does not explain why the author did not simply include the option subtype= Matrix to the rtable command.

How would doing the above changes things? Is it just more efficient to have done so when creating the rtable since one anticipate to convert it to Matrix?

 

@Alejandro Jakubi 

Yes, it is buggy, This is what it looks now in Browse()

Which is impossible to read. I use
interface(verboseproc=3);
print(dsolve);

which is much better. (but would have liked to have line numbers as well, but at least one can read it).

@acer 

What you see at the end of the AiryBiZeros procedure is an unevaluated return

Thanks. But now I am more confused. Then where is the actual code that evaluates this:

evalf(AiryBiZeros(10))
           -12.3864

All what I see in the listing is checking for arguments?

 

First 58 59 60 61 62 63 64 Last Page 60 of 71