Product Tips & Techniques

Tips and Tricks on how to get the most about Maple and MapleSim
Since the book entries do not yet have their own tracker (like the forums, blogs, etc), I figured I would give a particular entry I crafted on advanced maple programming a bit of a boost by making a blog entry of it, at least until Will get the tracker back online. I did spend a huge amount of time on that book entry, so I want it to get some visibility!

So you have used Maple as a glorified calculator (Maple 101), then wrote a few 1 liners (Maple 201), and even a few larger procedures (Maple 301), where you were both amazed and horrified by 'op'. But when you get serious about programming in Maple, even for not-so-large procedures, what are the fundamental parts of the system that you should know? Other pages in this book talk about particular features. This one is instead a simple list of those Maple commands and concepts you need to know to be able to call yourself a Master Maple Programmer.

The frontend command is a bit tricky. The basic idea is that it replaces expressions in the arguments to a procedure with names, evaluates the procedure with the replaced arguments, then back-substitutes the expressions for the the names in the final result. The first argument passed to frontend is the procedure that is to be evaluated. The second argument is a list containing the arguments to be passed to the procedure. Remaining arguments are optional, we'll get to those in a second.

I had problems with interputing an LaTeX enumeration and continuing it after that. I finally found the solution:

 \begin{enumerate}
   \item ...
   \item ...
   \item \label{it:ob:last}
 \end{enumerate}
 ...
 \begin{enumerate}\setcounter{enumi}{\ref{it:ob:last}}
   \item ...
   \item ...
 \end{enumerate}

thank you to some web sites:

Because my ISP no longer offers home pages, I'm putting the source to maplev-mode here.

maplev-mode is an Emacs major mode for developing Maple code. Its features include:

  • font-lock (highlighting) of Maple keywords
  • automatic indentation
  • syntax checking (via Mint)
  • online Maple help
  • online display of Maple procedures
  • imenu support
  • auto-fill support

It works properly with NTEmacs on a Windows machine and with GNU Emacs on a Linux box. It has been tested with GNU Emacs 21.2. It is supposed to work with Xemacs but the testing done with Xemacs has been minimal. The manual is badly out of date.

The current version supports Maple 11 and previous releases of Maple.

I use a dark background, but the maplev-mode can be configured to use a light background. Clicking on the highlighted "on line 13" message in the mint buffer moves the point to that location in the source buffer. Download 84_maplev.zip
View file details

Maple Equation

Ref: Kahan (Jan 2007): How Futile are Mindless Assessments of Roundoff in Floating-Point Computation ?

I wanted to know, how Maple behaves on the example given in \2475 of that working paper (where other

systems are considered, mostly Matlab) and thought it might be of interest here in the forum.

> restart; Digits:=16; interface(version);

( 1+ c*10^(n+1) ) / ( 1+ c*10^(n) ): 'limit(%,n=infinity)': '%'=%;

                                        (n + 1)
                                1 + c 10
                      lim       --------------- = 10
                 n -> infinity             n
                                   1 + c 10

However if c = 0 then ...

Hello, I have a question about Mathematical Expression Component in document. I tried to use it in my maple document and of course I looked at the help about it. There is a discription about another component, I think. The reason of it is that the dialog of component property is different in a help and in a document. I do not know why. I try to use it in Maple 10.06. The following figures show the situation. Of course, problem of this component is not only in different property dialog but also in functionality. Figure from help Figure from document Problem with this component is described also in the document here. Thank you. Vladimir

restart; interface(version);

  Classic Worksheet Interface, Maple 10.06, Windows, Oct 2 2006 Build ID 255401


expr:=hypergeom([1-I*a,1-I*b],[1],x);
convert(expr, hypergeom, "lower c");

            expr := hypergeom([1 - a I, 1 - b I], [1], x)

                                  0

Digits:=14:
subs(a=1, b=2, c=1, expr):
eval(%,x=2); evalf(%);
#Re(%%%); plot( %, x=-1..0.9); plot( %%, x=1.1 .. 3);

                 hypergeom([1 - I, 1 - 2 I], [1], 2)

               0.010385802579659 + 0.068521539093061 I

I have a questing about using Maple document components, such as a plotter, a slider and a Math expression to display my own function that is inserted via Math Expression component. The inserted function (of variable x) is multiply by parametr a and then is displayed in Plotter0. Situation in Maple document is displayed in the following figure The code of Slider0 components is the folowing: a:=GetProperty( 'Slider0', 'value'); b:=MathML[Import](GetProperty('MathContainer0', 'value')); SetProperty( 'Plot0', 'value', plot(a*b,x=-5..5) ); When my function is a polynom and it is not included any other function such as sin, cos, etc., everything workes correctly. But when I try to display e.g. sin(x) it does not worked - it is an empty plot or the other message is generated. I think that it is because of Import function is not able to evaluate it correctly. Could you help me,please? Thank you Vladimir

I would expect, that evalhf works for that without 'manual' translation ...

restart;
interface(version);

  Classic Worksheet Interface, Maple 10.06, Windows, Oct 2 2006 Build ID 255401


tst1:=proc(a,z) (-z)^(-a); end proc:
evalhf(tst1(1.5, 2.5));

  Error, fractional power of a negative


'(-z)^(-a)': '%'= convert(%,exp);
 
tst2:=proc(a,z) exp(-a*ln(-z)); end proc:
evalhf(tst2(1.5, 2.5));

                          (-a)
                      (-z)     = exp(-ln(-z) a)

                                 -9
          0.155662521299999988 10   + 0.252982212799999995 I
I have a text file, named Gens.txt, in the followig format Heading1 : This is first line Heading2 : This is second line Heading3 : This is third line I want to write a code which does the following: 1. Reads a line from this file and substitutes the number of prefix spaces at the start of line and followed by #. 2. The portion after : is made uniform in terms of spaces i.e. each word is followed by only one space. 3. The line thus produced is to be written to a text file named GensByMaple.txt. For example the first two lines would become like the following:
Should penguins wear coats at these times? - Yes ... but please ... those shoes ... Can we have recipes for fine French meals? - Yes ... and include canteen food! How about everything but Maple stuff here? - Yes, that's the primal intention ... Must one clutter up this board? Hm ... Seems to be 'Le Must' ... Lehalle, please stop your nonsense postings, the tracker shows all of this flood. Regards, Axel
It is possible to pass to a procedure a name which will be used to name a geometric object.

> with(geometry):

> f:=proc(n, x,y); point(n, x,y); end proc;

> f('A', 1, 1);

First 53 54 55 56 57 58 59 Last Page 55 of 64