Skip to Main Content Skip to Search
Product Documentation

plot::Sumgraphical primitive for symbolic sums

plot::Sum(ex, i = m..n) creates a plot of summing ex over the range m..n.

→ Examples

Calls:

plot::Sum(ex, i = m .. n, <a = amin .. amax>, Options)

plot::Sum(sum(ex, i = m .. n), <a = amin .. amax>, Options)

Parameters:

ex

arithmetical expression in i and the animation parameter a, if that is used.
ex is equivalent to the attribute Function.

i

an identifier or indexed identifier.
i is equivalent to the attribute XName.

m .. n

the range of i. m and n may be expressions in the animation parameter a. Summation goes over m + integer. If n - m is not an integer, n will not be reached.
m .. n is equivalent to the attributes XRange, XMin, XMax.

See Also:

plot, plot::copy, plot::Function2d, plot::PointList2d

Details:

Example 1

It is well known that sum(1/j^2, j = 1..infinity) = PI^2/6. We use plot::Sum to display the first 100 partial sums:

plot(plot::Sum(1/j^2, j = 1..100),
     plot::Function2d(PI^2/6, x=1..101, LineStyle = Dashed))

MuPAD graphics

With more partial sums, the steps approximate points:

plot(plot::Sum(sin(j^2)/j, j=1..500))

MuPAD graphics

Example 2

To show some of the formatting options of plot::Sum, we use the following sum:

s := plot::Sum(1/j, j = 1..20)

plot::Sum(1/j, j = 1..20)

By default, this object is displayed as follows:

plot(s)

MuPAD graphics

To change parameters, we can select them in the inspector and change the values, we can give other values directly in the plot command or we can set the new values in our object s:

s::PointsVisible := TRUE:
s::LinesVisible := FALSE:
s::PointColor := RGB::Green:
plot(s)

MuPAD graphics

Example 3

plot::Sum allows animation in the usual way, for example, in the term to sum:

plot(plot::Sum(sin(a*i^2)/i, i = 1..50, a = 0..PI))

MuPAD graphicsimage

Another interesting parameter to animate is the summation range:

plot(plot::Sum((-1)^j/j, j = 1..jmax, jmax = 1..50))

MuPAD graphicsimage

  


Recommended Products

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.

 © 1984-2012- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS