nm

10044 Reputation

19 Badges

12 years, 109 days

MaplePrimes Activity


These are questions asked by nm

I was trying to see if Maple contains equivalent to Mathematica FreeQ command to check inside a proc if an input expression contains an "x" or not.  I could not find such command in Maple. So now I call indets(), which is a nice function, that tells me all the symbols in the expression, then use member() to check.

Would this be correct way to do this? Here is an example

expr:=3+4*sqrt(2)-x+y*sin(3*t);
s:=indets(expr);
if member(x,s) then
   print(`yes, x is there`);
fi;

I can't use patmatch() for this, as I do not know what the expression will look like yet, I just needed to know if it contains an "x" (in this case), a free symbol "x", and that is all.

I thought to ask if there is a better way to do this.

Another worksheet dilemma  I am having with Maple.

I have number of "execution groups", like this, I created using CTRL-J

Now I wanted to put these in a section, so it becomes like this: (I had to make new worksheet now)

Since I did not know how put existing groups inside a new section I wanted to create (the section always comes at different level that does not include the groups), I thought I can create the section first, then go copy the groups and paste them to the new section.

The problem is how does one actually select multiple execution groups for the purpose of copying them?  The obvious way is to use the mouse, and select all groups with the mouse.

Well, this a big problem, since my groups are so large, I can spend 5-10 minutes scrolling down, very slowly to select them. my hand gets tired and I get tired doing this. I also one time got an error from Maple, saying selection too large, and something about rtf memory error or something. This is after wasting 10 minutes scrolling down carefully to select over 10,000 lines that is one large list.

In Mathematica, I can simply select a cell, no matter how large (an execution group in Maple talk) by just clicking on the edge of the cell.  I can select multiple cells the same way (hold, click on the edge of all). Very easy. I do not have to scroll down to select the content as I do with Maple

But here, with Maple, I put the mouse of the left edge, and can't select the group. Nothing happens. So I have to actually scroll down. I do not see the point of having a left [ edge to a group if one can't use it to select the group?

So my question is: How to select one or more execution groups without scrolling the mouse over all the content?

I had to use integration by parts to get the answer I need, but I do not think it is really needed for this. compare the output from:

r:=int(tan(x)^(n-2)*sec(x)^2,x);

(which is pages of very complicated output), with this:

r:=Int(tan(x)^(n-2)*sec(x)^2,x):
simplify(value(IntegrationTools:-Parts(r,tan(x))));

Does one really have to tell Maple to do integration by parts for this? I would have expected int() to do it as is.

Please compare to Mathematica:

Maple 18.02

added

The reason I think this should have been done by int() directly is that it is direct  application of the power rule of integration. I can't write Latex here, so I wrote it on my computer, and I copy the screen shot to explain for those interested:

Maple is so good in differential equations, but does not seem to be as good as it should when it comes to integration.

2 questions: How would one delete  an execution group that is at top of a work sheet? Like this:

No matter what I do, I get a beep. I select it, click DELETE and nothing happens.

THe second question, is how to delete the last section arrow I added by mistake and do not want, this one:

I found I can remove if I select it with the line above, but then that would delete the code above also, which I'd like to keep.

Why is so awkward to use Maple user interface like this? Is this by design?

To make it easier, I attach the above notebook.

 

hard_to_delete.mw

I prefer to write packge:-command(....) so I can see which package the command is from.

But sometimes I am forced to load  a package. Here is an example. IntegrationTools contains some useful types

At load time the IntegrationTools package defines three new types: Integral, DefiniteIntegral and IndefiniteIntegral, which can be used to access integrals involved in any given expression.

I thought I can access these just like the commands in the package, using ":-" notation, but this does not work

------------------
restart;
v := Int(sin(x), x);
type(v,IntegrationTools:-IndefiniteIntegral);
---------------------

 

Error, IndefiniteIntegral is not a command in the IntegrationTools package

But this works

-----------------------
restart;
with(IntegrationTools);
v := Int(sin(x), x);
type(v,IndefiniteIntegral);
----------------

It looks like :- only works to access functions/commands/procs in a package. and not to access types such as in this example.

Is there some other notation to use to reference types in package without having to load the whole package?

    

First 164 165 166 167 168 169 170 Last Page 166 of 184