{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

L2041-03

# L2041-03 - Plotting Summing and simple functions in Maple...

This preview shows pages 1–3. Sign up to view the full content.

Plotting, Summing and simple functions in Maple Data points are often stored as a " list " in Maple. A list is a structure of ordered elements deliminated by square brackets . For example, [a,b,c,d] is a list of 4 elements a, b, c, d, ordered from the first "a" to the last "d". Example: [1,2] is an ordered pair, a list with two elements, of which the first can be considered an X-coordinate, and the second a Y-coordinate. The elements of a list may themselves be lists. Example: [[1,2],[3,4],[5,6],[7,8]] is a list of ordered pairs, each ordered pair is a list itself. The elements of a list L can be accessed by specifying a coordinate. For example, L[3] is the third element of L. > L := [[1,2],[3,4],[5,6],[7,8]]; > L[3]; L[2][1]; A list of ordered pairs can be plotted using "plot": > plot(L, style=point); seq: A list can be efficiently generated by using "seq" (for sequence). Example: > List := [seq([i,i-1],i=1..10)]; Observe the outside square brackets (to make a list), and the dummy variable "i". > plot(List, style = point); One can list the elements of a list with "seq": > seq(List[i],i=1..10);

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
sum: Maple sums up lists or sequences of numbers using "sum". For example, the first elements of "List" can be summed up as follows: > sum(List[i][1],i=1..10); We note that the sum is 55. Exercise: a) Sum up the second elements of "List". b) Sum up all the elements of "List". More general uses of the "sum" function in Maple is illustrated by the following list of examples: > sum(i,i=0..100); > sum(1/i,i=1..100); > sum('c||i',i=0..10); Notice the creation of a sum of unknown coefficients ci in the last example. This was achieved by use of the concatenation operation ||, and c||i is concatenated to ci. The summation evaluates the i (gives it a value), and the single quotes instructs "sum" not to evaluate the resulting concatenated coefficient ci. Concatenation Concatenation is a method in Maple for generating new names by putting together old ones.
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern