Items tagged with example



I am a maths teacher and would like to create an ebook for my students with explanations, examples and quizes in the same time. They should be able to access and work through it, even on mobile devices, using the free Maple player. I am new in Maple and don't know if all this is possible. I would like to see some samples of code to learn from and of course, some advice. I would highly apprecaite your support. Thank you.

Everything is simple, until you go underwater – This is what the University of Waterloo Submarine Racing team, or in short ‘WatSub’ coined as their motto. Never mind learning to scuba dive, and dealing with such things as rust, this newly formed team would have to compete against university teams with a decade or more of experience.

But that did not deter the team, and they started work on Ontario’s first submarine racing project. The team approached Maplesoft to be a sponsor and we are proud to have supported this ingenious venture. The team has used Maplesoft technology in the design and testing of the submarine.

“Maple has been our go-to calculations and analysis tool throughout the development of Amy (2015-2016 season), and we will continue using it throughout the development of Bolt (2016-2017 season),” said Gonzalo Espinoza Graham, President of the WatSub Team. “Its familiar interface and computing environment allowed us to set design benchmark targets from early on the design process and follow through with them on the later stage.”

What started as an engineering project in December 2014, becoming officially the first submarine racing team in Ontario. The team soon grew to over 130 general members and a tight core-team, who were eager to tackle new challenges.  The team resides inside the Sedra Student Design Centre, University of Waterloo’s state of the art facility that houses over 25 student teams, the largest of its kind in North America.  

WatSub made its first appearance on the European International Submarine Races (eISR) back in July 2016, with its 1st submarine ‘Amy’, where a single scuba diver piloted the submarine and propelled it through an unforgiving winding course marked by obstacles and turns 10 meters underwater. The team has since then participated in other competitions and is constantly improving the design and performance of the submarine, learning from each competition they participate in.  Next year Amy will participate in the 14th edition of the eISR international competition. “I think the greatest thing we learned is never to give up,” said Ana Krstanovic, a third-year political science student who manages communications for the team. “We’re more motivated now than ever.”


Ojaswi Tagore, Gonzalo Espinoza Graham, and Janna Henzl represented WatSub at the European International Submarine Race in Gosport, UK.


Another example of an innovative project that Maplesoft supported in 2016 is Waterloop: The Canadian SpaceX Hyperloop Competition Team, Canada's only SpaceX Hyperloop Pod Competition team. This project, which could change the way we travel in the future, is driven by a group of dedicated University of Waterloo students who have taken on the challenge to design and build a functional prototype Hyperloop pod. They will test it on a one-mile test track in Hawthorne, California in January 2017, pitting it against 22 of the 1200+ teams who originally entered the competition.

The Hyperloop is a conceptual next generation high-speed transit system that will take commuters between cities at speeds over 1,000 km/h. The technology will differ from previous rail transit by having pods ride on a cushion of air in a reduced pressure tube in order to reach greater speeds with a smoother ride, and is powered entirely by renewable energy.

 The Hyperloop Pod Competition was launched by Elon Musk, the billionaire engineer and founder of SpaceX and Tesla Motors.  The competition is separated into 3 rounds. The first one was held in late December, where selected teams sent in their initial designs to be reviewed. From there, 180 teams were chosen to compete at Texas A&M University. Each team set up a booth and a panel of judges critiqued them and chose 31 teams to move onto the final, build and test stage.

Waterloop Goose I

Waterloop Goose X

The GOOSE I is Waterloop’s half-scale, functional prototype vehicle pod, which will be the one in the competition.  The GOOSE X pod is a conceptual full size Hyperloop vehicle inspired by the prototype they are building. The full size pod will have a capacity of 26 passengers per pod.

"Our prototype has been designed to be as simple and economical as possible, while still performing all necessary functions for the full size Hyperloop. If it is successful, it has the potential to revolutionize the transit industry in the same manner the train and airplane has before it," said Montgomery de Luna, architectural design lead for Waterloop. “We would like to thank Maplesoft for their generous support.  Without sponsors like Maplesoft supporting our vision and encouraging innovative student projects, we wouldn’t be able to achieve our goal.”

Revolutionizing the transportation industry isn’t easy and is at times frustrating and time consuming for these teams, but having the best tools and resources will ensure that the teams have a good chance at excelling in competitions and creating innovative models that could change our future.

Walking into the big blue Maplesoft office on August 3rd was a bit nerve wracking. I had no idea who anyone was, what to expect, or even what I would be doing. As I sat in the front hall waiting for someone to receive me, I remember thinking, “What have I gotten myself into?”. Despite my worries on that first day, interning at Maplesoft has been a great experience! I never knew that I would be able to learn so much about programming and working in a company in such a short amount of time. Although Maple was a programming language that was foreign to me a couple weeks ago, I feel like I’m relatively well versed in it now. Trying to learn a new language in this short timespan hasn’t been easy, but I think that I picked it up quickly, even if I’ve had my fair share of frustrations.

Chaos Game example on Rosetta Code

At Maplesoft, I’ve been contributing to the Rosetta Code project by writing short programs using Maple. The Rosetta Code project is dedicated to creating programming examples for many different tasks in different programming languages. My summer project has been to create solutions using Maple for as many tasks as possible and to post these to Rosetta Code; the goal being to have the list of tasks without Maple implementation shrink with each passing day. It’s nice to feel like I’m leaving a mark in this world, even if it is in such a small corner of the internet.

Flipping Bits example on Rosetta Code/MapleCloud

This internship, of course, came with its share of challenges. During my work on the Rosetta Code project, I posted solutions for a total of 38 tasks. Some of them were easy, but some of them took days to complete. On some days, I felt like I was on top of the world. Everything I made turned out great and I knew exactly how to tackle each problem. Other days were slower. I’ve spent ages just staring at a computer monitor trying to figure out just how on earth I was going to make this machine do what I wanted it to do! The 24 Game task was particularly hard, but also very educational. Through this task, I learned about modules, a concept previously unknown to me. I’m fairly sure that the 24 Game also took me the longest, whereas the Increment a numerical string task took me no time at all. Despite it being easy, the Increment a numerical string task wasn’t particularly fun; a bit of a challenge is required for something to be entertaining, after all. My personal favourite was the Fibonacci n-step number sequences task. It was the first really challenging task I encountered, and for after which the feeling of finally completing a task that I spent so long on, of finally overcoming that mountain, was extremely satisfying. Not all challenges end in satisfaction, however. I often found myself accidentally doing something that made the window freeze. I would close the program, then cry a bit on the inside when I realized I just lost the past half an hour’s worth of unsaved work. Nevertheless, I’m glad I got to face all these obstacles because they have made me more resilient and a better programmer.

The following is the code for the Fibonacci n-step number sequences task

numSequence := proc(initValues :: Array)
	local n, i, values;
n := numelems(initValues);
values := copy(initValues);
for i from (n+1) to 15 do
values(i) := add(values[i-n..i-1]);
end do;
return values;
end proc:
initValues := Array([1]):
for i from 2 to 10 do
initValues(i) := add(initValues):
printf ("nacci(%d): %a\n", i, convert(numSequence(initValues), list));
end do:
printf ("lucas: %a\n", convert(numSequence(Array([2, 1])), list));

Maple was a great software to program with and a fairly straightforward language to learn. Having previously programmed in Java, I found Maple similar enough that transitioning wasn’t too difficult. In fact, every once in a while when I didn`t know what to do for a task, I would take a look at the Java example in Rosetta Code and it would point me in a direction or give me some hints. While the two languages are similar, there are still many differences. For example, I liked the fact that in Maple, lists started at an index of 1 rather than 0 and arrays could an arbitrary starting index. Although it was different from what I was used to, I found that it made many things much less confusing. Another thing I liked was that the for loop syntax was very simple. I never once had to run through in my head how many times something would loop for. There were such a wide variety of commands in Maple. There was a command for practically anything, and if you knew that it existed and how to use it, then so much power could be at your fingertips. This is where the help system came in extremely handy. With a single search you might find that the solution to the exact problem you were trying to solve already existed as a Maple command. I always had a help window open when I was using Maple.

Multiplication Tables example on Rosetta Code

Spending my summer coding at Maplesoft has been fun, sometimes challenging, but an overall rewarding experience. Through contributing to the Rosetta Code project, I’ve learned so much about computer programming, and it certainly made the 45 minute drive out to Waterloo worth it!

Yili Xu,
Maplesoft SHAD Intern


I am unable to see length of rigid body frame in MapleSim Examples - Physical Domain  - Multibody - 5 DOF robot? Is there a way to see them?



        General description of the method of solving underdetermined systems of equations. As a particular application of the idea proposed a universal method  kinematic analysis for all kinds of  spatial and planar link mechanisms with any number degrees of freedom.  The method can be used for powerful CAD linkages.   


      Some examples of a much larger number calculated by the proposed method. Examples gathered here not to look for them on the forum and opportunity to demonstrate the method.  Among the examples, I think, there are very complicated.



I would like to get some sort of table (maybe also a plot) that shows me the effect on the function if I change a variable.

For example, I have f(x,y,z)=x+yz

Now I would like to get a list with the results for f if I run z from, say, -10 to +10.

Is it also possible to do this with all variables at the same time?

I can;t seem to get DSOLVE working.  Will some kindly soul please send me a complete example, starting with an f(x) & clearly documented?   Many thanks.




Hello. I have a question. If you can help me, i am pleasure.

Have nice day. :)


Question: Enter a number after maple find(understand) to prime number or normal number.


> asal := proc(n)
> local m;
> if n<2 then
> m := s=n/2+1;
> print(m);
> else
> for i from 2 to n do
> if irem(n,i,0) then
> print("asal değil");
> if i = m then
> print("asaldir");
> end do;
> end if;
> end if;
> end proc;


Hi is there a way to identify curves in your plot? Especially when you dont know it yourself?


For example, I have 10 polynomials all order 5 and up, whilst I can trial and error identify which one is which it is very inefficient.

I used to use Mathematica, and I could manually label the curves with color which allows to see which curve is which. I assume there is something of the sort for Maple?

Hi, My name is mohammed and I am a P.h.D student . I am a new user with Maple . I had two questions

First one : How can I execute a number of commands by using worksheet or document mode ? can any one  provide me an example?

Second : How can I measure the time for a number of command? can any one provide with syntax of the command?



I've encountered a problem with Maple.


Is it possible to create a procedure which both displays some plots and also returns a value?


When I write a simple example:


It plots a circle as expected.

But when I add return:


It returns value 2, but no plot is displayed.

Is it possible to do both, display and return a value?

I used to write two copies of procedure, one for plotting and one for returning value.

But thats not "pretty" solution.


Thanks for help.

This is pretty similar to my last question. but I found this maple code on a website that is suppose to find a vertex coloring of a graph G. The output is is supposed to be a list for example like [3, table([y = 1, k = 2, c = 2, m = 3, h = 1, x = 1] where the first part (in this case 3) is the number of colors and 1,2,3 in the second part are the colors to which each vertex is assigned.  However, no matter what graph I run this on I get everything equal to 1. such as [1, table([y = 1, k = 1, c = 1, m = 1, h = 1, x = 1])]. Why is this happening?  
  local i, j, C, U, V, total_used;
  V:=Vertices(G); total_used:=1;
  for i from 2 to nops(V) do
  end do;
  for i from 2 to nops(V) do
      for j from 1 to nops(neighbors(V[i], G)) do
      U:=U union C[neighbors(V[i], G)[j]];
       end do;
    while member(j, U) do
     end do;
    if j>total_used then
    end if;
   end do;
  [total_used, eval(C)];

With your help I have a solution to a system of three equations:

(parameters are calculated on the basis of the data (for different values) - one example below)
A1=0.00002072968491, A2=0, A3=0.001946449287, A4=0.01946449287

B1=, B2=0, B3=0.0004773383613, B4=0.00004773383613

C1=, C2=0, C3=, C4=0.00009087604510


eqa1: = A1 * (diff (Tg (x), x, x)) + A2 * (diff (Tg (x), x)) + (A3 + A4) * tan (x) + A3 * Tg (x) + A4 * Tw (x) = 0;

eqa2: = B1 * (diff (Tw (x), x, x)) + B2 * (diff (Tw (x), x)) + (B3 + B4) * Tw (x) + B3 * Tg (x) + B4 * tan (x) = 0;

eqa3: = C1 * (diff (Tz (x), x, x)) + (C3 + C4) * Tg (x) + C3 * tan (x) + C4 * Tw (x) = 0;


indets ({eqa1, eqa2, eqa3}) minus {x};

res: = Dsolve (eval ({eqa1, eqa2, eqa3}) union {boundary conditions ??}, numeric);


for k from 0 to 20 evalf (res (k), 4); from;

c1:= 0.524:


m: = 0;

for m from 0 to 20 and

T (m): = c1 * rhs (op (6, res (m))) + c2 * rhs (op (2, res (m))) + (1-c1-c2) * rhs (op (4, res (m))); print (m, T (m)); end to:


How and what type boundary conditions (I was thinking about the simplest or third type) to be able to determine the values on the y-axis on the graph. For example, the values started at -10, and ended at 10 (at a point (x, -10), (x, 10) in the coordinate system for a predetermined x, for example, from 0 to 20 which start at the point (0, -10 ) and stop at the point (20,10)). My main purpose is to collect these three solutions  to one equation T (x) = az * Tz (x) + and * Tw (x) + ag * Tg (x), and the ends of the graph, they should be in the above-mentioned points (0, -10 ) - start and (20,10) - stop.


Now thank you very much for the advice.


Hi all.  I have researched into this problem.  But I could not find a solution to this.

Here is an example.

I have a set of independent variables, say there are 5 of them.  They are 1. Gender 2. Age group 3. Full or part time 4. First language.

I have a set of dependent variables.  Let us consider for an example 6 of them.  They are (i) Develops breast cancer (ii) Develops skin cancer (iii) Develops lung cancer (iv) develops prostate cancer (v) Lives till 50 (vi) Lives till 60 ...

How do I perform the following prediction:

(A) If a person is male and above 50, what are the chances that he is likely to develop prostate cancer?

(B) If a person is female and works part time, what are the chances that she is likely to develop breast cancer and lives till 60?

I need to develop a code and formula to do this?  Can someone please advise?

Many thanks.

Kind regards,


how gr operators work?

I tried to run example given there but it is not working,

where can I get more examples to understand working of Gr operators work?

specially for raychaudhuri equations.

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