Maple Questions and Posts

These are Posts and Questions associated with the product, Maple

Way back in Maple 6, the rtable was introduced. You might be more familiar with its three types: Array, Matrix, and Vector. The name rtable is named after "rectangular table", since its entries can be stored contiguously in memory which is important in the case of "hardware" datatypes. This is a key aspect of the external-calling mechanism which allows Maple to use functions from the NAG and CLAPACK external libraries. In essence, the contiguous data portion of a hardware datatype rtable can be passed to a compiled C or Fortran function without any need for copying or preliminary conversion. In such cases, the data structure in Maple is storing its numeric data portion in a format which is also directly accessible within external functions.

You might have noticed that Matrices and Arrays with hardware datatypes (eg. float[8], integer[4], etc) also have an order. The two orders, Fortran_order and C_order, correspond to column-major and row-major storage respectively. The Wikipedia page row-major  explains it nicely.

There is even a help-page which illustrates that the method of accessing entries can affect performance. Since Fortran_order means that the individual entries in any column are contiguous in memory then code which accesses those entries in the same order in which they are stored in memory can perform better. This relates to the fact that computers cache data: blocks of nearby data can be moved from slower main memory (RAM) to very fast cache memory, often as a speculative process which often has very real benefits.

What I'd like to show here is that the relatively small performance improvement (due to matching the entry access to the storage order) when using evalhf can be a more significant improvement when using Maple's Compile command. For procedures which walk all entries of a hardware datatype Matrix or multidimensional Array, to apply a simple operation upon each value, the improvement can involve a significant part of the total computation time.

What makes this more interesting is that in Maple the default order of a float[8] Matrix is Fortran_order, while the default order of a float[8] Array used with the ImageTools package is C_order. It can sometimes pay off, to write your for-do loops appropriately.

If you are walking through all entries of a Fortran_order float[8] Matrix, then it can be beneficial to access entries primarily by walking down each column. By this I mean accessing entries M[i,j] by changing i in ther innermost loop and j in the outermost loop. This means walking the data entries, one at a time as they are stored. Here is a worksheet which illustrates a performance difference of about 30-50% in a Compiled procedure (the precise benefit can vary with platform, size, and what else your machine might be doing that interferes with caching).

Matrixorder.mw

If you are walking through all entries of an m-by-n-by-3 C_order float[8] Array (which is a common structure for a color "image" used by the ImageTools package) then it can be beneficial to access entries A[i,j,k] by changing k in the innermost loop and i in the outermost loop. This means walking the data entries, one at a time as they are stored. Here is a worksheet which illustrates a performance difference of about 30-50% in a Compiled procedure (the precise benefit can vary with platform, size, and what else your machine might be doing that interferes with caching).

Arrayorder.mw

Hello, 

 

I have to solve a system of two equations but I have the error message "Warning, cannot evaluate the solution past the initial point, problem may be complex, initially singular or improperly set up"

Here is what I did :

Maple 16 introduced dramatic changes to the postscript export facility of 3d plots. This is great news, but some bugs remain. Let me report here about my experience. (Note: Maple 15's 3d ps export was something like an encapsulated bmp, while Maple 16 is a genuine level3 postscript export tool)

The initial release in Maple 16.00 was buggy. In my experience, the export would hang most of the time. An improved release came with Maple 16.01. I have not experienced any...

I have a problem in determine the relation between two variables in a polynomial equation f(l2,v)=0. The results of two methods puzzled me.
The first method I tried is use the fsolve command.
In equation f(l2,v)=0,the range for v is [3405,5054] and l2 is a complex variable.
I plotted the figure for the l2=l2(v) in complex plane.Because the degree of l2 is 8, I have eight curves in the figure.
Obviously, the order in the result of fsolve is indefinite, so it can...

Maplesoft has these interesting bits of Math on their website.  For example this one here

http://www.maplesoft.com/mathmatters/airplanes.aspx

It is all nice and all but I would like to see some reference examples to maple for each one, a cool application worksheet that portrays each one nicely. 

Using the example link above I searched maplesoft application center for navier stokes...

Hello,

 

I am having probrems to do the following.

 

- I want to solve 2 equations A and B, which have to be solved numerically. (get x(t) and y(y))


- With the solution to A and B, I have to input a combination into other equation C. And then get the solution for other variable. (solve z''(t) + (k/t^2 + V(x(t),y(t))z(t)=0)

 

I could solve evertything togewther. The only problem is that the second part...

Which library is this hflogb implemented in? I could not find it in either libc or libm.

What is the exact name of the function that has been changed in 64bit distributions?

(Knowing this, there would be an easy fix. Even now, one can run older maple on newer linuxen: simply copy the old system libs (from /lib/x86_64-linux-gnu and /usr/lib/x86_64-linux-gnu to a library under the maple install dir and tweak LD_LIBRARY_PATH in the maple wrapper script), but identifying...

Not really a review but I think Maple has so much cool stuff one can do with it, that we get sidetracked from one project to the next.   Before you know it, a new release is out and you've put your project on hold to try out and play with the new features - and not really forging ahead on any projects.  One year between new releases isn't enough time to have customers really, and I mean really, dive into Maple.

Here is what a reviewer at computing world said about Maple16


 


 

restart

Dear MaplePrimes,

 

I have a problem findning an explicit solution to an equation solve((P[h]-tau[h])*q[hf] = (P[f]-tau[f])*q[fh], [lambda[h]])]. Is you can see from my syntax, I have assumed a RealDomain and also that all parameters including the varialbe I'm solving for lambda[h] are positive, and also that lambda[h] is between 0 and 1. This is my syntax:

 

test := `assuming`([RealDomain:-solve((P[h]-tau[h])*q[hf] = (P[f]-tau[f...

hi,

I am trying to solve a system of non linear simultaneous equations.

It keeps showing the warning that solution may have been lost.

I need urgent help.


Download eqn.mw

 

Thank you.

Dear All,

I am trying to create a matrix of a function nsi(m,k) file attached to the question.

I shall be very thankful if you could help me in creating a matrix as explained in the file.

maple1.mw

Best Regards

A.Q

 

I want to now how to convert from maple to letec

thankyou

What is the number of the Latin squares of order 5 (see http://en.wikipedia.org/wiki/Latin_squares
for more details), having all  entries of its diagonals different (e.g. Matrix( [[1,2,3,4,5],[5,3,4,1,2],[4,5,2,3,1],[2,4,1,5,3],[3,1,5,2,4]] )

Hi friends
This is strange for me, but Maple could not solve the below integral. I tried with online version
of Mathematica and it solved for me. The solution is Hypergeometry function. 
> f := ((1/2)*r+1/r)^(1/n);

> int(f, r);
What is the problem?
 
Regards!

First 1602 1603 1604 1605 1606 1607 1608 Last Page 1604 of 2253