nm

11353 Reputation

20 Badges

13 years, 12 days

MaplePrimes Activity


These are replies submitted by nm

@Carl Love 

thanks, this will work for me. I can select one group at a time (I do not want to merge them, but wanted to move them all to be under a section). So no problem to do one at time, at least I do not have to manually use the mouse now to select large group as before. (I think Mathematica way is much easier. Click on the edge of the cell to select it, but that is ok for now)

But I get this error on some groups

Would you know if there is some setting I can change to make Maple copy this large group? thanks

ps. I found it. It was under enable/RTF copy. I disable this and now I can copy large group. Problem solved. In case someone in the future gets this error:

 

@acer 

thanks for the sincos trick, I did not know about it. It looks like Maple does not know about the power rule in integration, or did not see it in this case. I added note on this in my question to clarify this.

@acer 

thanks! I never knew about CTRL-DEL before, this is a life saver when using Maple worksheet. I'll put it on a yellow stick now and keep it in front of me.

@Carl Love 

Is there a way to apply a patch to a function such as this and update the library locally on my PC or is this something that can't be done?  I tried the fix to Combine and now Combine does the right thing:

I simply changed

'And(DefiniteIntegral,Not(MultipleIntegral))')

with

'And(Or(IndefiniteIntegral,DefiniteIntegral),Not(MultipleIntegral))')

everywhere

---------------------
restart;
with(IntegrationTools): #needed to load the whole package to access DefiniteIntegral types...
ints:=indets(v,'And(Or(IndefiniteIntegral,DefiniteIntegral),Not(MultipleIntegral))'):
x := IntegrationTools:-GetVariable(ints[1]):
input := subsindets[':-flat'](v,'And(Or(IndefiniteIntegral,DefiniteIntegral),Not(MultipleIntegral))',t -> Change(t,GetVariable(t) = X)):
output := combine(input,'int'):
subs(X = x,Change(output,X = x));
----------------------

 

 

 

 

Where does the augment command come from??

It is not a good idea to do with(...) and then use the commands in the code. It better to write

restart:
s := {E[1], E[2], E[3]};
v := {x[1], x[2], x[3]};
A := LinearAlgebra:-GenerateMatrix(s, v);

Since now it is clear where each command/function comes from. Also this makes it easier to put these in a function later on. Inside a function it is not good idea to with(packages) any way. So you'd have to do this later any way.

 ps. why not use LinearAlgebra[LUDecomposition] ?


set in maple is mathematical set. In math, a set by definition has no duplicate elements. See http://en.wikipedia.org/wiki/Set_%28mathematics%29

@Carl Love 

thanks. This worked very well.

@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.

 

First 78 79 80 81 82 83 84 Last Page 80 of 91