nm

8552 Reputation

19 Badges

13 years, 30 days

MaplePrimes Activity


These are questions asked by nm

To run Maple script, on windows, I type

cmaple.exe   my_file.mpl

and this works well. So if my_file.mpl has the line int(sin(x),x);  the result of the above is:

> int(sin(x),x);
                                                        -cos(x)
> quit
memory used=0.9MB, alloc=8.3MB, time=0.05

 

sometimes, it will be nice to use cmaple to quickly do one time calculation on the fly such as the above, without having to open Maple GUI or write/edit a file. For example, I'd like to be able to do something like

cmaple.exe   "int(sin(x),x);"

but ofcourse the above does not work as is, since it expects its input to be a file. I tried

cmaple.exe   << "int(sin(x),x);"

but that did not work (for obvious reasons, since the input string is not a file name).

I tried different re-directions, as shown in this page for windows, but maple expects the input to be a file.

Is there a way to use cmaple with command directly written as string as above? I am using Maple 2015.

 

I have this (which finds each Fourier term of a sequence)

term := proc(lst,k::integer)
    local n;
    n := nops(lst);     
    seq(lst[m+1]*exp(-I * 2*Pi/n *(k*m)),m=0..n-1);
end proc;

Now I call it as

term([1,2,3],1);

and it returns

So it evaluated and convert the exp(-I * 2*Pi/n *(k*m)) terms. I wanted to keep these as is, so I can compare result with textbook. Then do simplify if I wanted to above output. 

I can do that if I use small pi instead of large Pi, like this

term := proc(lst,k::integer)
    local n;
    n := nops(lst);     
    seq(lst[m+1]*exp(-I * 2*pi/n *(k*m)),m=0..n-1);
end proc;

and now r:=term([1,2,3],1); return

Which is what I wanted, but with Pi instead of pi.  now how would I evaluate the above?

I tried to use subs to replace small pi with large Pi, but it does not work

subs(pi=Pi,r); #error

Then I tried eval, which worked

eval(r,pi=Pi);

So, I can use the above method.

My question is: Is the above a common way to handle such case? Is there another way to use Pi but at the same time prevent Maple from automatic simplification of the exp() terms?

 

 

 

 

There is a slight display difference of the code between showstate() and print(). It has to do with '` name `' use where print does not show the outside '' characters.

Here is an example

restart;
showstat(`dsolve`);

and now using print

restart;
interface(verboseproc=3);
print(`dsolve`);

When I used

with(LibraryTools);
Browse();

and looked at the source code there, it matched what showstat(`dsolve`); gave and not the print command. Is there a reason why print does not show all those extra characters exactly as in the source code? It seems a formatting issue, but it is better to be looking at an exact copy of the source code.

Under what is new in Maple 2015, it gives lists of commands that has been updated. For example

 

So suppose one wants to find what changed in the "add" command, how would they find this out? Clicking on the add command shows no indication of what was changed or what options added or modified. For example, with Mathematica, clicking on command, shows the changes in the current releases with different color (light yellow) when clicking on "show changes" (here is an example)

Is  this information available somewhere else? May be using the command line with some option?

Just giving list of commands changed, without any indication of what changed, is not very useful really.

 

 

When I export to latex a matrix  <<a|b>,<c|d>>, the latex uses \begin[ and \end]

\left[ \begin {array}{cc} a&b\\ \noalign{\medskip}c&d\end {array} \right]
Is there a way to make Maple use () parenthesis instead of []? The screen display is not important for me in Maple, but I'd the latex to use () instead.  It will be nice if there is way to configure this. I looked but could not find an option.

 

First 142 143 144 145 146 147 148 Last Page 144 of 164