# set terminal pngcairo transparent enhanced font "arial,10" fontscale 1.0 size 600, 400 # set output 'bivariat.8.png' set bar 1.000000 front set style circle radius graph 0.02, first 0.00000, 0.00000 set style ellipse size graph 0.05, 0.03, first 0.00000 angle 0 units xy set key inside right bottom vertical Right noreverse enhanced autotitle nobox set style textbox transparent margins 1.0, 1.0 border unset logscale set samples 500, 500 set style data lines unset paxis 1 tics unset paxis 2 tics unset paxis 3 tics unset paxis 4 tics unset paxis 5 tics unset paxis 6 tics unset paxis 7 tics set title "Finite summation of 10, 100, 1000 fourier coefficients" set xrange [ -10.0000 : 10.0000 ] noreverse nowriteback set yrange [ -0.400000 : 1.20000 ] noreverse nowriteback set paxis 1 range [ * : * ] noreverse nowriteback set paxis 2 range [ * : * ] noreverse nowriteback set paxis 3 range [ * : * ] noreverse nowriteback set paxis 4 range [ * : * ] noreverse nowriteback set paxis 5 range [ * : * ] noreverse nowriteback set paxis 6 range [ * : * ] noreverse nowriteback set paxis 7 range [ * : * ] noreverse nowriteback set colorbox vertical origin screen 0.9, 0.2, 0 size screen 0.05, 0.6, 0 front noinvert bdefault integral_f(x) = (x>0)?int1a(x,x/ceil(x/delta)):-int1b(x,-x/ceil(-x/delta)) int1a(x,d) = (x<=d*.1) ? 0 : (int1a(x-d,d)+(f(x-d)+4*f(x-d*.5)+f(x))*d/6.) int1b(x,d) = (x>=-d*.1) ? 0 : (int1b(x+d,d)+(f(x+d)+4*f(x+d*.5)+f(x))*d/6.) f(x)=sin(x-1)-.75*sin(2*x-1)+(x**2)/8-5 integral2_f(x,y) = (xy-d*.5) ? 0 : (int2(x+d,y,d) + (f(x)+4*f(x+d*.5)+f(x+d))*d/6.) ack(m,n) = (m == 0) ? n + 1 : (n == 0) ? ack(m-1,1) : ack(m-1,ack(m,n-1)) min(x,y) = (x < y) ? x : y max(x,y) = (x > y) ? x : y gcd(x,y) = gcd1(rnd(max(x,y)),rnd(min(x,y))) rnd(x) = int(x+0.5) gcd1(x,y) = (y == 0) ? x : gcd1(y, x - x/y * y) fourier(k, x) = sin(3./2*k)/k * 2./3*cos(k*x) sum10(x) = 1./2 + sum [k=1:10] fourier(k, x) sum100(x) = 1./2 + sum [k=1:100] fourier(k, x) sum1000(x) = 1./2 + sum [k=1:1000] fourier(k, x) delta = 0.2 GPFUN_integral_f = "integral_f(x) = (x>0)?int1a(x,x/ceil(x/delta)):-int1b(x,-x/ceil(-x/delta))" GPFUN_int1a = "int1a(x,d) = (x<=d*.1) ? 0 : (int1a(x-d,d)+(f(x-d)+4*f(x-d*.5)+f(x))*d/6.)" GPFUN_int1b = "int1b(x,d) = (x>=-d*.1) ? 0 : (int1b(x+d,d)+(f(x+d)+4*f(x+d*.5)+f(x))*d/6.)" GPFUN_integral2_f = "integral2_f(x,y) = (x