Mac Dude

1561 Reputation

17 Badges

12 years, 244 days

MaplePrimes Activity

These are answers submitted by Mac Dude

If you write

assign ma[1,2];

and add the missing ";" after the first three statements; your code runs. This is a "feature" of assign; it does not like the double indices [1][2].


 Edit: actually, it runs but does not do the assignments you want. Don't have the time to debug this further.

Here is what Help has to say:

  Under Windows, the initialization file is called maple.ini.
  If <Maple>\lib\maple.ini exists, it is loaded first (where <Maple> is your Maple installation directory). With a  network installation of Maple, the commands in this initialization file will be executed by all users on the network.
  To execute a user's personal set of commands, only the first initialization file in one of the following paths will be loaded.
  1) <Maple>\lib\maple.ini
  2) The binary directory of your current working directory (for example, "c:\Program_Files\Maple\\maple.ini")
  3) The <Maple>\Users directory (for example, "c:\Program_Files\Maple\Users\maple.ini")
  4) The user's personal profile directory (multiuser only) (for example, "c:\Documents_and_Settings\userid\maple.ini")
Maple reads and executes the network initialization file before the personal initialization file.

I include a print statement at the end of mine so I know it has executed:

print("Maple Init loaded...");

Mac Dude


How about providing the procedure you specified and that Maple is asking for?

Proofreading before posting may also help, the first half of your statement is not a sentence.

A bit more detail, like a piece of the code that triggers the error message and a statement of what you are trying to do, might just also  be appropriate.


I am running it right now with Maple 15 on my laptop, and it seems to qualify for the "crawl and hangs forever" category. It is technically not hanging, however, just churning along (on a not-fast-by-modern-standards PowerBook G4).

I don't use Maple 18 regularly, but Maple 17 is not in general slower than 15, and some things are faster (on the same platform). Your sheet has several parameters that will affect your run time: the resolution R (goes in squared), and the iteration parameters Niter and Jiter. Any chance you had some of these set different in Maple 18?

Also, assuming Maple 18 eventually finishes, are the results the same?

I do note that you appear to use global variables in proc J (e.g. lambda); I would advice against that as it may cause confusing behaviour of your code.


PS: It is still running so I don't have a result yet.

Well, you have seen the thread about Maple 18 on Yosemite so there may be an issue with that particular configuration. I myself run Maple 17 on Snow Leo and it has been stable and working well. I do find the GUI somewhat sluggish, but that is more an implementation problem of the GUI than a Mac OS X problem. It should be noted that Maple will take advantage of dual-processor machines: the GUI runs in a separate thread and will not compete with the kernel for CPU time in a dual-processor machine. Likewise I am almost certain that the memory space is different (an advantage when working in a 32bit environment as the kernel can use somewhat more than 2 GB; irrelevant for 64bit).

It should also be noted that there is no classic interface in Mac OS X. Not an issue for me but some people like the classic interface better. You can run a CLI (terminal) version of Maple in OS X; while of limited use in and of itself I can see possibilities on multiprocessor machines with a GUI version launching several CLI processes. At the same time there is no X-Windows version of Maple on OS X; this I consider a deficiency.

A bit technical: At some point I tried to increase the stack space for the kernel and had to learn that on OS X that is not possible/allowed. Having said that, further investigation revealed that stack space was not an issue at all for the specific case I was looking at, and the stack usage was a small fraction of the available space. So I have not been limited by lack of stack space.

I have had font issues switching back & forth between Maple 15 and Maple 17 on two different machines. Fixed by completely closing Maple and the worksheets and starting from scratch. Mildly annoying but with the work-around not a killer.

All-in-all I personally think Maple works well on OS X, and the user interface is not so Mac-unlike as to be grating.

If you have specific concerns, please let us know.


You have some problems you need to fix first:

1. If you want the exponential function, write it as exp(x). e^x is not what you expect in Maple.

2. A function definition is written like this in Maple: f:=(x,y) -> 1/(sqrt(2*Pi)) * exp(-1/2(x^2+y^2);
    (Ok, I think in Maple 18 you can get away with murder and assign to f(x,y),
but that isn't really standard Maple yet.)

3. As written, the exponent is interpreted as -1/(2*(x^2_y^2)). Is this what you want? I suspect not, because for that your total differential turns out to be 0. It is recommended to always write explicit multiplication operators, unless and until you really know what you are doing (and then you probably won't).

Once you fix these, Jacobian indeed will give you a meaningful result.



Maple is not executing worksheets upon opening them. Loading a large worksheet can take time, though. Notice that the space used by Maple's kernel is not large upon loading a worksheet but only grows once you run it.

However, your worksheet is not particularly large. I have some that are close to 100 (one hundred) MB large. These can take a minute to open, and are a pain to navigate, but they do load. So I wonder whether there is something else funky.

Once you have gotten one loaded you can remove the output before saving. In that way only the Maple source code gets saved and not the plots (which tend to be the space hogs).

Large sheets can take a lot of space for the Java VM (and that probably does get allocated upon loading). You could give the JVM more space; the default is 512 MB, which I find can get  tight at least with my 100 MB-type sheets. I increased mine to 1 GB; If you  are on Mac OS X I can find out how I enlarged it (I have forgotten that & am not on the right computer right now).

Now, you do want to monitor what is going on. Is your system paging like crazy? Is the Maple GUI process chewing up enormous amounts of memory? Or is your system memory-starved?

My first line of defense would be to attempt a load and brew some coffee. It may show up eventually.


To integrate this numerically as opposed to analytically you need to write the integrals as inert functions and use evalf:




As you can see, I specified two different (numeric-) integrators. Method=trapezoid, incidentally, does not exist.

Brian's solution for sure integrates analytically as the integrals are easily done. Even in my example I am not 100% sure how the inner integral is done although it should be numeric as well. You won't know for sure until you have a function that Maple cannot integrate analytically.


I am not sure what exactly you refer to as "text mode", but in Document mode a subscript is generally entered in square brackets, like theta[s], which would show as theta<sub>s.

There is a danger in that, if you use theta with a subscript, you cannot easily use theta without the subscript. After using a subscript in this way, Maple treats theta as some kind of table and gets confused if it is refered to without subscript.

For that reason I tend to avoid using subscripts unless I >really< need them, and then only with >very< careful checking of the results.


In your second J1 you write e^(something). If you want exp(something), write that.

With that change it works.


cos(60) and sin(30) don't evaluate because the result cannot be represented in an exact way. You can force evaluation with evalf but the result is a float, therefore approximate. 

Also note that the arguments are always in rad; cos(60) is cos(60rad), not 60 deg.


Try "return" rather than "enter"

Mac Dude


You are assigning functions to elements of phi. To get values you can plot, you need to evaluate these, specifying x and y.

Also, to make this work you need to construct the Vector phi first:


else you try to assign to non-existent elements.

Then, since your function has 2 arguments it seems like you need a 3d plot to plot the alue against the two prameters. And you get one surface for each index of phi. Like:

plot3d(phi[1],x1..x2,y1..y2); # x1,x2,y1,y2 are numbers


Mac Dude

The reason your 2nd example fails is because both equations (former (1) and (2)) are now in one execution group. The label then refers to the last equation.

While one can argue with this behaviour, it is not at all fragile, but in my experience 100% repeatable. In fact, i wrote a 250-page document making extensive use of labels and found them very dependable. When you section a document the labelling reflects the sectioning (1.1, 1.2, 2.1 etc.). There are peculiarities in the way labels and sections interact, however (the details of which I have forgotten).

I disagree with Alejandro in this case. Labels are useful and dependable if you make the effort to understand how they work (like many things in Maple), and they help organizing a document without inventing numerous names that quickly lose their mnemonic value. Note that the label references will recalculate if you insert something upstream or inbetween a label and the referencing statement, keeping your document intact. I have yet to find a case where the labelling loses track of it reference, so I will argue also with the claim of fragility. All in all a great feature which I am using extensively.

Mac Dude.

Not a comprehensive answer as I won't claim to be an expert on this and your problem is posted in a generic way, but solve will get you solutions at least for easier cases, and you may want to use the option explicit to see if you can avoid the RootOfs.

factor() may factorize your expression (which of course gives you at least some of the roots).

If your indeterminates are functions or expressions themselves, none of these work in a direct way. One way to use them is freeze/thaw like so:


(a generic made-up example where f(t) can be a function or expression). Another may be frontend, but I always get lost in its syntax, and therefore I don't like it. If freeze() looks too complicated or unfamiliar to you, you can also just subs a unique name for the function, do your thing, and then substitute back.

Do note that polynomials of 5th or higher order are not solvable analytically in general. you need to resort to fsolve in those cases and be careful of getting the solutions that actually apply to your problem out of the multitude of possible solutions. fsolve can be helped along by specifying initial points, points to avoid, or ranges within which to find the solution.




First 10 11 12 13 14 15 16 Last Page 12 of 20