0.1 Summation, Sampled Trajectories, and Aggregate Metrics
CCD objectives and constraints often aggregate quantities across time samples, operating conditions, load cases, or uncertain scenarios. Summation notation lets us express those aggregates compactly and unambiguously.
Here we review the properties of finite sums, then connect the mean, variance, and standard deviation to trajectory metrics and uncertainty studies.
For example, if we take xi=i2, then i=1∑6i2 represents the sum of the squares of all integers from 1 to 6:
i=1∑6i2=12+22+32+42+52+62
Notice that both the starting and ending indices (1 and 6, respectively) are included in the sum. Summation notation allows us to express sums conveniently – the left-hand side above is more compact than the right-hand side.
Often, we’ll take the sum of the first n terms of a sequence. For example, the sum of the squares of the first n positive integers is:
i=1∑ni2
Note that the index of summation can be any variable name (i is just a typical choice). That is, j=1∑nj2, i=1∑ni2, and zebra=1∑nzebra2 all represent the same sum.
Summation notation can be thought of in terms of a for-loop. In Python, to compute the sum i=a∑bi2, we could write:
total = 0
for i in range(a, b + 1):
total = total + i ** 2
As we mentioned above, the ending index is inclusive in summation notation. This is in contrast to Python, where the ending index is exclusive, which is why we provided b + 1 as the second argument to the range function instead of b.
To illustrate various properties of summation notation, we’ll use the following fact:
i=0∑n2i=20+21+22+...+2n=2n+1−1
The expression 2n+1−1 is called a closed form for the summation. When closed forms exist, they make it easy to compute the value of a summation. You’ll also notice that in addition to writing the sum using summation notation, I also showed the first few and last terms of the sum, with a ... to indicate that the pattern continues in between. As convenient as summation notation is, explicitly writing the first few and last terms of a sum can sometimes make it easier to understand what exactly is being summed.
For example, i=0∑32i=20+21+22+23=1+2+4+8=15, which is indeed 23+1−1=15. The sequence 20,21,22,…,2n is called a geometric sequence, and the resulting sum is called a geometric series.
For convenience, we’ll define S(n)=i=0∑n2i; again, S(n)=2n+1−1.
The best way to learn through these examples is to try to solve them yourself before looking at the solution.
Determine the value of i=8∑192i. (Find an answer that doesn’t involve summation notation or a sum over many terms.)
Solution
We can’t use the formula for S(n) directly, because the starting index is 8, not 0. But, if we look at the expansion of S(19), we’ll see that it contains the sum we’re looking for:
As we did in the very first example, let’s try and write the sum as a difference of two calls to S(n). S(n) involves the sum of terms of the form 2i, and the sum we’re looking for involves the terms 2i−5, so we’ll need to shift the indices.
When i=10, i−5=5, and when i=20, i−5=15. So, we can rewrite the sum in question as:
i=10∑202i−5=i=5∑152i
This looks like S(15)−S(4), or 216−1−(25−1)=216−25=65536−32=65504.
We will frequently work with n scalar[1] samples x1,x2,…,xn. The index might identify time nodes along a trajectory, wind-speed bins, road profiles, Monte Carlo realizations, or experimental trials.
The mean, or average, of all n values is given the symbol xˉ (pronounced “x-bar”) and is defined as follows:
xˉ=nx1+x2+…+xn=n1i=1∑nxi
You’ve likely seen this definition before. But, an often-forgotten property of the mean is that the sum of the deviations from the mean is zero. By that, I mean (no pun intended) that if you:
compute the mean of a sequence of numbers,
compute the signed difference between each number and the mean, and then
sum all of those differences, the result will be zero.
Let’s first see this in action, then show why it is true in general. Suppose actuator force is sampled at four time nodes, giving 72, 63, 68, and 65 N. The mean force is:
xˉ=472+63+68+65=67
The deviations from the mean are:
72−6763−6768−6765−67=5=−4=1=−2
The sum of the four deviations, then, is:
5+(−4)+1+(−2)=0
So, the mean deviation from the mean is zero in this example.
This is also true in general. Precisely, I’m claiming that if x1,x2,...,xn−1,xn are any n numbers, and xˉ is their mean, then i=1∑n(xi−xˉ)=0.
So, the deviations sum to zero in general. The positive and negative deviations therefore cancel. In the actuator-force example, the positive deviations are 5 and 1 N and the negative deviations are -4 and -2 N. The mean can be viewed as the balance point of the sampled trajectory.
Because signed deviations always average to zero, they cannot measure how strongly a trajectory varies around its mean. A nearly constant response and a highly oscillatory response could both have zero mean deviation.
To measure the spread of sampled values, we remove the sign cancellation by squaring each deviation:
Compute the sample mean
Compute the deviation of each value from the mean
Square each deviation
Take the average of the squared deviations
The result of this process is called the variance, denoted s2 or σ2; its square root is called the standard deviation.
Following the above steps, the variance is given by:
σ2=n1i=1∑n(xi−xˉ)2
The same squared-error structure appears in ride-comfort objectives, tracking penalties, fatigue proxies, state-estimation covariances, and stochastic CCD formulations.
For a sampled signal, the root-mean-square value is
xRMS=n1i=1∑nxi2.
Unlike standard deviation, RMS is measured relative to zero rather than relative to the sample mean. It therefore captures both a nonzero offset and oscillation. Ride acceleration, tracking error, actuator effort, voltage, and structural response are often summarized with RMS or related quadratic measures.
A time integral is also commonly replaced by a weighted sum on a mesh:
J=∫t0tfL(t)dt≈k=0∑NwkL(tk).
The weights wk depend on the integration or transcription scheme. Consequently, changing the mesh without checking convergence can change the apparent CCD optimum.
Suppose a sampled sensor signal x1,x2,…,xn has mean xˉ and variance σ2.
A calibrated sensor reports yi=−4xi+3. Find the mean and variance of y1,y2,…,yn, and justify your answer using the definitions of mean and variance.