(kill(all),ratprint:false,showtime:true,now:elapsed_run_time(),ratepsilon:10^-50,fpprec:50,load(pw),timedate()); assume(a>0); define(p(x), between(x,0,inf)*a^6/120*x^5*exp(-a*x)); define(dc(x),pwint(p(x-t)*p(t),t,minf,inf)); n:50; b:50b0; M1:makelist([x/100,p(x/100)],x,0,800),a=b\$ M2[0]:makelist([x/60,dc(x/60)],x,0,480),a=b\$ for i : 1 thru n do ( coeff_action:'factor, define(dc(x),pushout(pwint(p(x-t)*dc(t),t,minf,inf),'signum)), a:b, M2[i]:makelist([x/60,dc(x/60)],x,0,480), remvalue(a) ); apply ( draw, append([terminal='animated_gif, file_bgcolor="#aaaaff",delay=20, pic_width=1100,pic_height=450,file_name="c:/rich/Approaching a Gaussian"], makelist(gr2d(title= "Convolution Integral of a Piecewise Function Approaching a Gaussian",nticks=600, yrange=[-.1,xreduce('max, map(lambda([z], second(z)),M1))*1.2], label([concat("variance = 6 * ", k+2, " / a^2 "),2,xreduce('max, map(lambda([z], second(z)),M1))]), color=blue, label(["p(x):=(a^6*x^5*%e^(-a*x)*(signum(x)+1))/240,a=50",2,xreduce('max, map(lambda([z], second(z)),M1))*1.1]), fill_color = goldenrod, border=true, line_width=1, color = black, line_type=solid, polygon(M2[k]), point_size = 1, point_type=dot, points_joined = true, color = blue, points(M1)), k,0,n) ) ); elapsed_run_time()-now;