Converting math notation into maxscript can be quite difficult, take our full-wave rectified sine equation. It contains sigma (summation) of n=1 to infinity do cos(n*omega*t)/(n^2-1). So in max this cant happen as its a for loop going from 1 to infinity adding the results! So we have to use less iterations.
Sigma is basically a for loop adding up the results, where as PI (II) is multiplication of the results. With this knowledge we first have to get our variables:
t = time
0 = omega
a = amplitude
r = 0
(r) is used for the summation of cos(n*o*t)/(n^2-1) which we get with:
for n = 1 to 30 do
(
r = r + (cos(n*o*t)/(n^2-1))
)
So now we have (r) which is basically the accuracy of our equation, we could go to 1000 iterations but max would probably crash. Now all we do is multiply the front of the equation by (r):
2*a/pi-4*a/pi*r