Items tagged with maple maple Tagged Items Feed

Maple’s Code Generation makes it possible to translate your Maple code to various other programming languages including C, Python, and several others. In Maple 2015, we added a new Code Generation target to one of my other personal favourite languages, R. R is a programming language designed for statistical computing and graphics, so no code translation from Maple to R would be complete without attempting to translate as many commands as possible from Maple’s Statistics package. 

Translating code from one language to another is tricky business. Maple 2015 represented the first time that any Code Generation target language added the ability to translate commands from the Statistics package. With R, we found that many common statistics commands had almost a one-to-one mapping, such as Statistics:-Mean = mean, but several others were much more complicated, including several commands for dealing with probability functions that did not have direct mappings due to differences in how the systems handle symbolic probability functions.

A list of statistics commands that can be translated from Maple to R can be found here.

In addition to assisting me recall the correct syntax in R, having worked with CodeGeneration[R] for several months now, I find that one of my most common uses for Maple’s code generation to R is simply to pass data between the systems. A simple example:

 CodeGeneration:-R( LinearAlgebra:-RandomMatrix( 5, 2 ) );

translates to the following in R:

 cg <- matrix(c(-4,27,8,69,99,29,44,92,-31,67),nrow=5,ncol=2)

To see a couple more short examples, here’s a short video that I recorded on Code Generation to R:


A little known fact about Code Generation is that the translation files can be viewed in from the “samples” directory in your Maple install directory. Similar to many of Maple’s packages, you can view all of the source code that Code Generation uses for its translations. For example, you can view the translations for the commands that I mentioned above from the “” file inside of your “%MapleInstallDir%/ samples/CodeGeneration/R” directory.

Should you have any feedback on this translation, or any other, please feel free to contact us. We’re also on the hunt for our next code generation targets, so let us know what other languages you would like to see added as Code Generation targets.

Hello guys, I have a question. Is there any possibility to calculate two or more procedures at same time in the maple18 ?. I m thinking about using of the Grid or threads tools.

My problem is:

Given two functions/ procedures, f1(x,y) and f2(x,y). I need make an parallel computation of f1 and f2 and after i need get

f3 = f1+f2.

I am very grateful for the help.

Hello people

i have a quetion

what is the perposes of these softwares,maple,matlab,mathmatica and latex.

for example i listened from somewhere that matlab is best for matrices, then what are the major task of these softwares which i listed above including matlab,

how we make comparison of these softwares.



Hello people in mapleprimes,

I have a question about why what is shown by maple by simplify(-8)^(1/3) is 1+ Complex(1)* (3)^(1/2)?

Solutions of x^3=-8 are -2, 1+Complex(1)*(3)^(1/2) and 1- Complex(1)*(3)^(1/2). And, as for the last one, 1- Complex(1)*(3)^(1/2), it is 

the conjugate of the second, so it might not need to be written, because of it being easily seen so.

Is it the same reason why just -2 is not shown as the result of simplify((-8)^(1/3))?

PS. I know the instruction to use surd in such a case.

the reason I asked this question is this:

I am reading Essential Maple, where

ln(z) = ln(rho*exp(Complex(1)*theta));






"Because of

exp(w*Pi*Complex(1)*k)=cos(2*Pi*k) + Complex(1)*sin(2*Pi*k);


cos(2*Pi*k) + Complex(1)*sin(2*Pi*k)=1;

we could equally well have chosen

ln_k z = ln(z) + 2*Pi*Complex(1)*k"

are written.

 Supposing these, there is a sentence that

"we choose k=0, and thus -Pi<=theta<=Pi to be the one (that for our canonical logarithm).

Every computer algebra language and numerical language follows this standard and takes the

complex logarithm to have its imaginary part in this range.

With this definition, (-8)^(1/3)=1 + Complex(1)*sqrt(3), and not -2. (the end of quotation)"


And, I can't understand the last sentence"With this definition", so I asked the above question.


I hope someone give an answer to the above question.


Thanks in advance.



Hello all ,

Having read a recent post about comparing Maple and Mathematica I'd like to throw my 2 cents (FWIW).

It is *silly* (not to say stupid) to compare these two softwares.

Maple can do "things" that Mathematica can't. For examples Differential Geometry, Lie Algrebra, covariant derivative and the like.

And Mathematica Manipulate command is far better than Maple Explore (just another exemple).

I have being using Maple since Release V.2 (1992) and Mathematica since Release 1.1.a (1991).

I use both of them on a daily basis and I *LOVE* them both.

Inputs are welcome :-)

Kind regards to all,



Could someone explain what are the main (functional) differences between professional and personal Maple editions for 2845$ and 299$ respectively?

Tx, Andras

Dear All,

I am new to maple and trying to write a recursive function with two input variables, but when i execute the statement it shows error "Error, (in B) too many levels of recursion"

Following is the set of instructions which i am trying to execute:

if n=1 then  




end if

After execution, i try to access B(1,1) or B(2,1), the following error occurs

B(1, 1);
Error, (in B) too many levels of recursion

I'll be grateful, if someone can help me to fix this problem. 

I created my own package and one procudure inside this package is to calculate the eigenvalues of a identity matrix, as shown below




Then, I use this package in another document, all other procedures work well except the procedure calculating egigenvalues, as shown below




How to solve this problem? Thank you.

Ok so I managed to get my data into a google spreadsheet by using a google app script (JavaScript in the cloud).
The data is updated daily. I now want to access it from Maple. Axel has helped me write the following
procedure to do just that for (https websites and not just http):

X := proc (Url) local theDLL, URLDownloadToFile, myDirectory, myFile, Destination, DL;

theDLL := "C:\\WINDOWS\\SYSTEM32\\urlmon.dll";

URLDownloadToFile := define_external('URLDownloadToFileA', pCaller::(integer[4]), szURL::string, szFileName::string, dwReserved::(integer[4]), lpfnCB::(integer[4]), 'RETURN'::(integer[4]), LIB = theDLL);

myDirectory := "C:\\mydir";
myFile := "data1.csv";
Destination := cat(myDirectory, "\\", myFile);

DL := proc () URLDownloadToFile(0, Url, Destination, 0, 0);
ImportMatrix("C:\\mydir\\data1.csv", source = csv)
end proc;

return DL(), FileTools:-RemoveDirectory("C:\\mydir", recurse = true, forceremove = true)

end proc:



However now I get an error message saying:

Error, (in ImportMatrix) no delimiter found after line 768, column 2

Any ideas how to solve this?

Dear Maple users

Sometimes I would like to place certain Maple content on my website, for example making it possible for the user to rotate 3d objects (created in Maple) directly on the webpage, in the browser. I did that on one of my own webpages, written in Danish though:

If you scroll to the Catenoid shape, almost at the bottom of the page, one should be able to click this object to have a Javaapplett started. I made this years ago with the help of the great tools created by Konrad Polthier:

It wasn't easy, but I made it work. Things have changed since that time, however. Java is more and more "in bad standing". I was blocked when I tried opening it because of security. Banks is looking for alternatives, also because of security. And the mostly used browser now, Chrome, has stopped supporting it.

Now my question: Is there an alternative? Will HTML5 make it possible to make some kind of "Maple plugin" for Interactive Maple objects to be placed on webpages and interacted with in a Webbrowsers?





In a course I am looking at, the system of units is mostly in FPS.  Wich I never use.  But they ask sometime to convert it to SI.  But with Maple, I have a problem:

For Force, it use lb that I cannot convert into N

So what unit should I use to convert FPS to SI for the force.


I know that slug*ft*s^(-2) convert to N with no problem.


Thank you for your help.



Mario Lemelin
Maple 2015 Ubuntu 14.04 - 64 bits
Maple 2015 Win 7 - 64 bits messagerie : téléphone :  (819) 376-0987

What is the best source of learning maple for an abecedarian to become a professional?

i am very new with Maple.

I have the following two equations:



I wish to express the first equation in terms of y1 and x2, so that

x1 = c - b*y1+d*x2;

where c=a-a*d and b=1-d^2. How can I get maple to rearrange the original equation x1 in term of y1, x2, c and b? 



      I am a student doing some self study over the summer trying to work through some of the John Taylor computer problems from his classcial mechanics book. Currently I hit a snag that most likely comes from the fact I am not well acquinted with Maple for solving IVP and DE's (we used Matlab in my DE class). I just need to know how I remove the following error:

Error, (in dsolve/numeric/SC/IVPsetup) initial conditions must be numeric

Here is a copy of my code:

R := 5;
g := 9.8;
deq1 := {diff(x(t), [`$`(t, 2)]) = -g*sin(x(t))/R, x(0) = 20};
/ d / d \ \
{ --- |--- x(t)| = -1.960000000 sin(x(t)), x(0) = 20 }
\ dt \ dt / /
dsol1 := dsolve(deq1, numeric);
Error, (in dsolve/numeric/SC/IVPsetup) initial conditions must be numeric

My hunch is that I need to set x'(0)=0 or something like I do not have enough intial values to solve the problem, but I could be wrong. Anyway anyone who can point out my mistake feel free to do so! Thank you!

1 2 3 4 5 6 7 Last Page 2 of 271