(*^
::[ Information =
"This is a Mathematica Notebook file. It contains ASCII text, and can be
transferred by email, ftp, or other text-file transfer utility. It should
be read or edited using a copy of Mathematica or MathReader. If you
received this as email, use your mail application or copy/paste to save
everything from the line containing (*^ down to the line containing ^*)
into a plain text file. On some systems you may have to give the file a
name ending with ".ma" to allow Mathematica to recognize it as a Notebook.
The line below identifies what version of Mathematica created this file,
but it can be opened using any other version as well.";
FrontEndVersion = "X Window System Mathematica Notebook Front End Version 2.2";
X11StandardFontEncoding;
fontset = title, inactive, noPageBreakBelow, noPageBreakInGroup, nohscroll, preserveAspect, groupLikeTitle, center, M7, bold, e8, 24, fontName, "times";
fontset = subtitle, inactive, noPageBreakBelow, noPageBreakInGroup, nohscroll, preserveAspect, groupLikeTitle, center, M7, bold, e6, 18, fontName, "times";
fontset = subsubtitle, inactive, noPageBreakBelow, noPageBreakInGroup, nohscroll, preserveAspect, groupLikeTitle, center, M7, italic, e6, 14, fontName, "times";
fontset = section, inactive, noPageBreakBelow, nohscroll, preserveAspect, groupLikeSection, grayBox, M22, bold, a20, 18, fontName, "times";
fontset = subsection, inactive, noPageBreakBelow, nohscroll, preserveAspect, groupLikeSection, blackBox, M19, bold, a15, 14, fontName, "times";
fontset = subsubsection, inactive, noPageBreakBelow, nohscroll, preserveAspect, groupLikeSection, whiteBox, M18, bold, a12, 12, fontName, "times";
fontset = text, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, 12, fontName, "times";
fontset = smalltext, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, 10, fontName, "times";
fontset = input, noPageBreakInGroup, nowordwrap, preserveAspect, groupLikeInput, M42, N23, bold, 12, fontName, "courier";
fontset = output, output, inactive, noPageBreakInGroup, nowordwrap, preserveAspect, groupLikeOutput, M42, N23, L-5, 12, fontName, "courier";
fontset = message, inactive, noPageBreakInGroup, nowordwrap, preserveAspect, groupLikeOutput, M42, N23, 12, fontName, "courier";
fontset = print, inactive, noPageBreakInGroup, nowordwrap, preserveAspect, groupLikeOutput, M42, N23, 12, fontName, "courier";
fontset = info, inactive, noPageBreakInGroup, nowordwrap, preserveAspect, groupLikeOutput, M42, N23, 12, fontName, "courier";
fontset = postscript, PostScript, formatAsPostScript, output, inactive, noPageBreakInGroup, nowordwrap, preserveAspect, groupLikeGraphics, M7, l34, w282, h287, 12, fontName, "courier";
fontset = name, inactive, noPageBreakInGroup, nohscroll, preserveAspect, M7, italic, B65535, 10, fontName, "times";
fontset = header, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, italic, 12, fontName, "times";
fontset = leftheader, 12, fontName, "times";
fontset = footer, inactive, nohscroll, noKeepOnOnePage, preserveAspect, center, M7, italic, 12, fontName, "times";
fontset = leftfooter, 12, fontName, "times";
fontset = help, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, 12, fontName, "times";
fontset = clipboard, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, 12, fontName, "times";
fontset = completions, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, 12, fontName, "courier";
fontset = special1, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, 12, fontName, "times";
fontset = special2, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, 12, fontName, "times";
fontset = special3, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, 12, fontName, "times";
fontset = special4, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, 12, fontName, "times";
fontset = special5, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, 12, fontName, "times";paletteColors = 128; automaticGrouping; currentKernel;
]
:[font = title; inactive; preserveAspect; cellOutline; left; fontColorRed = 65535; fontColorGreen = 65535; fontColorBlue = 65535; backColorRed = 21845; backColorGreen = 21845; backColorBlue = 21845; startGroup]
This notebook discusses Fourier-Bessel series approximations of functions on an interval between x=0 and x=R.
:[font = subsection; inactive; preserveAspect; plain; bold; italic; startGroup]
These first five commands are basic to the rest of this notebook. They are automatically executed if you started this session by "initallizing the notebhook".
:[font = text; inactive; preserveAspect]
We begin by defining an example of a function g[x] and the interval [0,R] over which it is given.
;[s]
5:0,0;46,1;50,2;68,3;74,4;98,-1;
5:1,0,0 ,times,0,12,0,0,0;1,0,0 ,times,1,12,0,0,0;1,0,0 ,times,0,12,0,0,0;1,0,0 ,times,1,12,0,0,0;1,0,0 ,times,0,12,0,0,0;
:[font = input; initialization; preserveAspect]
*)
g[x_]:=If[x<1,-(x^2)-1,((x-2)^2)+1]
R:=2
(*
:[font = text; inactive; preserveAspect]
For simplicity on notation we will use the function p[n,x] to represent the sequence of orthogonal functions constructed using Bessel functions of order zero so we take:
;[s]
3:0,0;52,1;58,2;178,-1;
3:1,0,0 ,times,0,12,0,0,0;1,0,0 ,times,1,12,0,0,0;1,0,0 ,times,0,12,0,0,0;
:[font = input; initialization; preserveAspect]
*)
p[n_,x_]:= BesselJ[0,(x*z[n])/R]
(*
:[font = text; inactive; preserveAspect]
The values of z[n] are the roots of the Bessel functions so that BesselJ[0,z[n]]=p[n,z[n]]=0 for values of n= 1,2,3,... We need to find these z[n]'s. To get some idea of where these roots are we plot the Bessel function.
;[s]
9:0,0;14,1;18,2;65,3;93,4;108,5;120,6;144,7;149,8;222,-1;
9:1,0,0 ,times,0,12,0,0,0;1,0,0 ,times,1,12,0,0,0;1,0,0 ,times,0,12,0,0,0;1,0,0 ,times,1,12,0,0,0;1,0,0 ,times,0,12,0,0,0;1,0,0 ,times,1,12,0,0,0;1,0,0 ,times,0,12,0,0,0;1,0,0 ,times,1,12,0,0,0;1,0,0 ,times,0,12,0,0,0;
:[font = input; initialization; preserveAspect; startGroup]
*)
Plot[BesselJ[0,x],{x,0,10}]
(*
:[font = postscript; PostScript; formatAsPostScript; output; inactive; preserveAspect; pictureLeft = 34; pictureWidth = 281.75; pictureHeight = 174.125]
%!
%%Creator: Mathematica
%%AspectRatio: .61803
MathPictureStart
%% Graphics
/Courier findfont 10 scalefont setfont
% Scaling calculations
0.0238095 0.0952381 0.183714 0.419605 [
[(2)] .21429 .18371 0 2 Msboxa
[(4)] .40476 .18371 0 2 Msboxa
[(6)] .59524 .18371 0 2 Msboxa
[(8)] .78571 .18371 0 2 Msboxa
[(10)] .97619 .18371 0 2 Msboxa
[(-0.4)] .01131 .01587 1 0 Msboxa
[(-0.2)] .01131 .09979 1 0 Msboxa
[(0.2)] .01131 .26763 1 0 Msboxa
[(0.4)] .01131 .35156 1 0 Msboxa
[(0.6)] .01131 .43548 1 0 Msboxa
[(0.8)] .01131 .5194 1 0 Msboxa
[(1)] .01131 .60332 1 0 Msboxa
[ -0.001 -0.001 0 0 ]
[ 1.001 .61903 0 0 ]
] MathScale
% Start of Graphics
1 setlinecap
1 setlinejoin
newpath
[ ] 0 setdash
0 g
p
p
.002 w
.21429 .18371 m
.21429 .18996 L
s
P
[(2)] .21429 .18371 0 2 Mshowa
p
.002 w
.40476 .18371 m
.40476 .18996 L
s
P
[(4)] .40476 .18371 0 2 Mshowa
p
.002 w
.59524 .18371 m
.59524 .18996 L
s
P
[(6)] .59524 .18371 0 2 Mshowa
p
.002 w
.78571 .18371 m
.78571 .18996 L
s
P
[(8)] .78571 .18371 0 2 Mshowa
p
.002 w
.97619 .18371 m
.97619 .18996 L
s
P
[(10)] .97619 .18371 0 2 Mshowa
p
.001 w
.0619 .18371 m
.0619 .18746 L
s
P
p
.001 w
.1 .18371 m
.1 .18746 L
s
P
p
.001 w
.1381 .18371 m
.1381 .18746 L
s
P
p
.001 w
.17619 .18371 m
.17619 .18746 L
s
P
p
.001 w
.25238 .18371 m
.25238 .18746 L
s
P
p
.001 w
.29048 .18371 m
.29048 .18746 L
s
P
p
.001 w
.32857 .18371 m
.32857 .18746 L
s
P
p
.001 w
.36667 .18371 m
.36667 .18746 L
s
P
p
.001 w
.44286 .18371 m
.44286 .18746 L
s
P
p
.001 w
.48095 .18371 m
.48095 .18746 L
s
P
p
.001 w
.51905 .18371 m
.51905 .18746 L
s
P
p
.001 w
.55714 .18371 m
.55714 .18746 L
s
P
p
.001 w
.63333 .18371 m
.63333 .18746 L
s
P
p
.001 w
.67143 .18371 m
.67143 .18746 L
s
P
p
.001 w
.70952 .18371 m
.70952 .18746 L
s
P
p
.001 w
.74762 .18371 m
.74762 .18746 L
s
P
p
.001 w
.82381 .18371 m
.82381 .18746 L
s
P
p
.001 w
.8619 .18371 m
.8619 .18746 L
s
P
p
.001 w
.9 .18371 m
.9 .18746 L
s
P
p
.001 w
.9381 .18371 m
.9381 .18746 L
s
P
p
.002 w
0 .18371 m
1 .18371 L
s
P
p
.002 w
.02381 .01587 m
.03006 .01587 L
s
P
[(-0.4)] .01131 .01587 1 0 Mshowa
p
.002 w
.02381 .09979 m
.03006 .09979 L
s
P
[(-0.2)] .01131 .09979 1 0 Mshowa
p
.002 w
.02381 .26763 m
.03006 .26763 L
s
P
[(0.2)] .01131 .26763 1 0 Mshowa
p
.002 w
.02381 .35156 m
.03006 .35156 L
s
P
[(0.4)] .01131 .35156 1 0 Mshowa
p
.002 w
.02381 .43548 m
.03006 .43548 L
s
P
[(0.6)] .01131 .43548 1 0 Mshowa
p
.002 w
.02381 .5194 m
.03006 .5194 L
s
P
[(0.8)] .01131 .5194 1 0 Mshowa
p
.002 w
.02381 .60332 m
.03006 .60332 L
s
P
[(1)] .01131 .60332 1 0 Mshowa
p
.001 w
.02381 .03266 m
.02756 .03266 L
s
P
p
.001 w
.02381 .04944 m
.02756 .04944 L
s
P
p
.001 w
.02381 .06622 m
.02756 .06622 L
s
P
p
.001 w
.02381 .08301 m
.02756 .08301 L
s
P
p
.001 w
.02381 .11658 m
.02756 .11658 L
s
P
p
.001 w
.02381 .13336 m
.02756 .13336 L
s
P
p
.001 w
.02381 .15015 m
.02756 .15015 L
s
P
p
.001 w
.02381 .16693 m
.02756 .16693 L
s
P
p
.001 w
.02381 .2005 m
.02756 .2005 L
s
P
p
.001 w
.02381 .21728 m
.02756 .21728 L
s
P
p
.001 w
.02381 .23407 m
.02756 .23407 L
s
P
p
.001 w
.02381 .25085 m
.02756 .25085 L
s
P
p
.001 w
.02381 .28442 m
.02756 .28442 L
s
P
p
.001 w
.02381 .3012 m
.02756 .3012 L
s
P
p
.001 w
.02381 .31799 m
.02756 .31799 L
s
P
p
.001 w
.02381 .33477 m
.02756 .33477 L
s
P
p
.001 w
.02381 .36834 m
.02756 .36834 L
s
P
p
.001 w
.02381 .38512 m
.02756 .38512 L
s
P
p
.001 w
.02381 .40191 m
.02756 .40191 L
s
P
p
.001 w
.02381 .41869 m
.02756 .41869 L
s
P
p
.001 w
.02381 .45226 m
.02756 .45226 L
s
P
p
.001 w
.02381 .46905 m
.02756 .46905 L
s
P
p
.001 w
.02381 .48583 m
.02756 .48583 L
s
P
p
.001 w
.02381 .50261 m
.02756 .50261 L
s
P
p
.001 w
.02381 .53618 m
.02756 .53618 L
s
P
p
.001 w
.02381 .55297 m
.02756 .55297 L
s
P
p
.001 w
.02381 .56975 m
.02756 .56975 L
s
P
p
.001 w
.02381 .58653 m
.02756 .58653 L
s
P
p
.002 w
.02381 0 m
.02381 .61803 L
s
P
P
0 0 m
1 0 L
1 .61803 L
0 .61803 L
closepath
clip
newpath
p
p
.004 w
.02381 .60332 m
.02505 .6033 L
.02629 .60325 L
.02753 .60316 L
.02877 .60303 L
.03125 .60268 L
.03373 .60218 L
.03621 .60154 L
.03869 .60076 L
.04365 .59878 L
.04861 .59623 L
.05357 .59314 L
.06349 .5853 L
.08333 .56333 L
.10317 .53357 L
.14286 .45474 L
.18254 .35878 L
.22222 .2576 L
.2619 .16341 L
.28175 .1224 L
.30159 .08699 L
.32143 .05806 L
.33135 .04623 L
.34127 .03626 L
.35119 .02816 L
.36111 .02196 L
.36607 .01958 L
.37103 .01767 L
.37599 .01624 L
.37847 .0157 L
.38095 .01528 L
.38343 .01498 L
.38467 .01487 L
.38591 .01479 L
.38715 .01474 L
.38839 .01472 L
.38963 .01472 L
.39087 .01476 L
.39211 .01482 L
.39335 .01491 L
.39583 .01518 L
.39831 .01556 L
.40079 .01605 L
.40575 .01737 L
.41071 .01911 L
.42063 .02385 L
.43056 .03019 L
.44048 .03801 L
.46032 .05767 L
.5 .10919 L
Mistroke
.53968 .16884 L
.57937 .22651 L
.59921 .25169 L
.61905 .27313 L
.63889 .29006 L
.64881 .29665 L
.65873 .30193 L
.66369 .30406 L
.66865 .30585 L
.67361 .30729 L
.67609 .30789 L
.67857 .30839 L
.68105 .30881 L
.68353 .30915 L
.68477 .30928 L
.68601 .3094 L
.68725 .30949 L
.68849 .30956 L
.68973 .30961 L
.69097 .30964 L
.69221 .30964 L
.69345 .30963 L
.69469 .30959 L
.69593 .30953 L
.69717 .30946 L
.69841 .30936 L
.70337 .30875 L
.70585 .30832 L
.70833 .3078 L
.71825 .30494 L
.72321 .30302 L
.72817 .3008 L
.7381 .29547 L
.75794 .2815 L
.77778 .26373 L
.81746 .22027 L
.85714 .17283 L
.89683 .12941 L
.91667 .11147 L
.93651 .09701 L
.94643 .09127 L
.95635 .08658 L
.96131 .08464 L
.96627 .08299 L
.97619 .08052 L
Mfstroke
P
P
% End of Graphics
MathPictureEnd
:[font = output; output; inactive; preserveAspect; endGroup]
Graphics["<<>>"]
;[o]
-Graphics-
:[font = text; inactive; preserveAspect]
You can see that the function crosses the x-axis in three places on this graph, around x=2, x=5.5 and x=9. Let's use Mathematica to find them exacly. To get the first one we do
:[font = input; initialization; preserveAspect; startGroup]
*)
FindRoot[BesselJ[0,x]==0,{x,2.5}]
(*
:[font = output; output; inactive; preserveAspect; endGroup]
{x -> 2.404825557695579}
;[o]
{x -> 2.40483}
:[font = text; inactive; preserveAspect]
Thus, we define
:[font = input; initialization; preserveAspect]
*)
z[1]:=2.404825558
(*
:[font = text; inactive; preserveAspect]
You can use the same method to find the rest of the zeros of BesselJ[0,x] or perhaps find them in a table like in the CRC Handbook Of Math Tables. Or, you can click on the next cell and hit shift-return to accept the coefficents I found using Mathematica. Notice that the remaining cells are not part of the initialization process and you must now begin to execuite commands manually using the shift--enter key stroke.
;[s]
5:0,0;190,1;203,2;394,3;406,4;418,-1;
5:1,0,0 ,times,0,12,0,0,0;1,0,0 ,times,1,12,0,0,0;1,0,0 ,times,0,12,0,0,0;1,0,0 ,Clean,1,12,0,0,0;1,0,0 ,times,0,12,0,0,0;
:[font = input; preserveAspect]
z[2]:=5.52007811
z[3]:=8.653727913
z[4]:=11.79153444
z[5]:=14.93091771
z[6]:=18.07106397
z[7]:=21.21163663
z[8]:=24.35247153
z[9]:=27.49347913
z[10]:=30.63460647
z[11]:=33.77582021
z[12]:=36.91709835
z[13]:=40.05842576
z[14]:=43.19979171
z[15]:=46.34118837
z[16]:=49.4826099
z[17]:=52.62405184
z[18]:=55.76551076
z[19]:=58.90698393
z[20]:=62.04846919
z[21]:=65.1899648
z[22]:=68.33146933
z[23]:=71.4729816
z[24]:=74.61450064
z[25]:=77.75602563
:[font = text; inactive; preserveAspect]
The next line defines a macro that can compute the sum of any number of terms in the Fourier-Bessel Series.
:[font = input; preserveAspect]
s[n_,x_]:=Sum[c[m]*p[m,x],{m,1,n}]
:[font = text; inactive; preserveAspect]
The standard formula in the Kreyszig text, Page ???, defines the coefficients of the series using the following formula.
;[s]
3:0,0;28,1;51,2;120,-1;
3:1,0,0 ,times,0,12,0,0,0;1,0,0 ,Courier,0,12,0,0,0;1,0,0 ,times,0,12,0,0,0;
:[font = input; preserveAspect]
c[m_]:=NIntegrate[p[m,x]*g[x]*h[x],{x,0,R}]/
NIntegrate[p[m,x]*p[m,x]*h[x],{x,0,R}]
:[font = text; inactive; preserveAspect]
Here, h(x) is the weight function. For the functions that we will be approximating in this notebook it turns out that we need
:[font = input; preserveAspect]
h[x_]:=x
:[font = text; inactive; preserveAspect]
Next, we define a way to make Mathematica plot all of the partial sum approximations
s[M, x], s[M+1, x] , s[M+2, x], ...., s[N, x]
on the same coordinate system.
;[s]
5:0,0;30,1;41,2;116,3;168,4;199,-1;
5:1,0,0 ,times,0,12,0,0,0;1,0,0 ,Clean,0,12,0,0,0;1,0,0 ,times,0,12,0,0,0;1,0,0 ,times,1,12,0,0,0;1,0,0 ,times,0,12,0,0,0;
:[font = input; preserveAspect]
plt440[M_,N_]:=Plot[Release[Table[s[n,x],{n,M,N}]],{x,0,R}]
:[font = text; inactive; preserveAspect]
The next command is quite simmilar to the previous one except that it allows us to specifiy the x range we want to plot the series approximation over. a and b define the end points of the period while a1 and b1 define the end points of the plot. Also, the AspectRatio->Automatic part of the command will make sure that the graph will be scaled correctly.
;[s]
13:0,0;96,1;97,2;152,3;153,4;158,5;159,6;202,7;204,8;209,9;211,10;257,11;281,12;357,-1;
13:1,0,0 ,times,0,12,0,0,0;1,0,0 ,times,1,12,0,0,0;1,0,0 ,times,0,12,0,0,0;1,0,0 ,times,1,12,0,0,0;1,0,0 ,times,0,12,0,0,0;1,0,0 ,times,1,12,0,0,0;1,0,0 ,times,0,12,0,0,0;1,0,0 ,times,1,12,0,0,0;1,0,0 ,times,0,12,0,0,0;1,0,0 ,times,1,12,0,0,0;1,0,0 ,times,0,12,0,0,0;1,0,0 ,times,1,12,0,0,0;1,0,0 ,times,0,12,0,0,0;
:[font = input; preserveAspect]
pl44[M_,N_,a1_,b1_]:=
Plot[Release[Table[s[n,x],{n,M,N}]],{x,a1,b1},
AspectRatio->Automatic]
:[font = text; inactive; preserveAspect; cellOutline; plain; bold; fontColorRed = 65535; fontColorGreen = 65535; fontColorBlue = 65535; backColorRed = 21845; backColorGreen = 21845; backColorBlue = 21845; fontName = "Itc Souvenir"; endGroup]
Note: When you opened this notebook Mathematica asked you if you wanted it initialized. If you clicked "yes" then all of the above definitions are in effect. You can find out if that is true by typeing ?h; Mathematica should tell you that h is defined as h[x_]:=1 ( of course, you can do that for any of the above definitions if you need to look at them. However, you will need to manually execute all of the other commands in this notebook. Also, note we have taken most of the graphs out of this notebook. We are including just a few for your viewing pleasure.
;[s]
6:0,0;36,1;47,2;205,3;206,4;217,5;563,-1;
6:1,0,0 ,Itc Souvenir,1,12,65535,65535,65535;1,0,0 ,Clean,1,14,65535,65535,65535;1,0,0 ,Itc Souvenir,1,12,65535,65535,65535;1,0,0 ,Clean,1,12,65535,65535,65535;1,0,0 ,Clean,1,14,65535,65535,65535;1,0,0 ,Itc Souvenir,1,12,65535,65535,65535;
:[font = section; inactive; preserveAspect; plain; bold; italic; fontName = "Times"; startGroup]
Graphing and Calculations for the above example.
:[font = text; inactive; preserveAspect]
First we will start by graphing g[x] over the interval.
;[s]
3:0,0;32,1;37,2;56,-1;
3:1,0,0 ,times,0,12,0,0,0;1,0,0 ,times,1,12,0,0,0;1,0,0 ,times,0,12,0,0,0;
:[font = input; preserveAspect; startGroup]
aa=Plot[g[x],{x,0,R}]
:[font = postscript; PostScript; formatAsPostScript; output; inactive; preserveAspect; pictureLeft = 34; pictureWidth = 282; pictureHeight = 174]
%!
%%Creator: Mathematica
%%AspectRatio: .61803
MathPictureStart
%% Graphics
/Courier findfont 10 scalefont setfont
% Scaling calculations
0.0238095 0.47619 0.308634 0.147343 [
[(0.5)] .2619 .30863 0 2 Msboxa
[(1)] .5 .30863 0 2 Msboxa
[(1.5)] .7381 .30863 0 2 Msboxa
[(2)] .97619 .30863 0 2 Msboxa
[(-2)] .01131 .01395 1 0 Msboxa
[(-1)] .01131 .16129 1 0 Msboxa
[(1)] .01131 .45598 1 0 Msboxa
[(2)] .01131 .60332 1 0 Msboxa
[ -0.001 -0.001 0 0 ]
[ 1.001 .61903 0 0 ]
] MathScale
% Start of Graphics
1 setlinecap
1 setlinejoin
newpath
[ ] 0 setdash
0 g
p
p
.002 w
.2619 .30863 m
.2619 .31488 L
s
P
[(0.5)] .2619 .30863 0 2 Mshowa
p
.002 w
.5 .30863 m
.5 .31488 L
s
P
[(1)] .5 .30863 0 2 Mshowa
p
.002 w
.7381 .30863 m
.7381 .31488 L
s
P
[(1.5)] .7381 .30863 0 2 Mshowa
p
.002 w
.97619 .30863 m
.97619 .31488 L
s
P
[(2)] .97619 .30863 0 2 Mshowa
p
.001 w
.07143 .30863 m
.07143 .31238 L
s
P
p
.001 w
.11905 .30863 m
.11905 .31238 L
s
P
p
.001 w
.16667 .30863 m
.16667 .31238 L
s
P
p
.001 w
.21429 .30863 m
.21429 .31238 L
s
P
p
.001 w
.30952 .30863 m
.30952 .31238 L
s
P
p
.001 w
.35714 .30863 m
.35714 .31238 L
s
P
p
.001 w
.40476 .30863 m
.40476 .31238 L
s
P
p
.001 w
.45238 .30863 m
.45238 .31238 L
s
P
p
.001 w
.54762 .30863 m
.54762 .31238 L
s
P
p
.001 w
.59524 .30863 m
.59524 .31238 L
s
P
p
.001 w
.64286 .30863 m
.64286 .31238 L
s
P
p
.001 w
.69048 .30863 m
.69048 .31238 L
s
P
p
.001 w
.78571 .30863 m
.78571 .31238 L
s
P
p
.001 w
.83333 .30863 m
.83333 .31238 L
s
P
p
.001 w
.88095 .30863 m
.88095 .31238 L
s
P
p
.001 w
.92857 .30863 m
.92857 .31238 L
s
P
p
.002 w
0 .30863 m
1 .30863 L
s
P
p
.002 w
.02381 .01395 m
.03006 .01395 L
s
P
[(-2)] .01131 .01395 1 0 Mshowa
p
.002 w
.02381 .16129 m
.03006 .16129 L
s
P
[(-1)] .01131 .16129 1 0 Mshowa
p
.002 w
.02381 .45598 m
.03006 .45598 L
s
P
[(1)] .01131 .45598 1 0 Mshowa
p
.002 w
.02381 .60332 m
.03006 .60332 L
s
P
[(2)] .01131 .60332 1 0 Mshowa
p
.001 w
.02381 .04342 m
.02756 .04342 L
s
P
p
.001 w
.02381 .07289 m
.02756 .07289 L
s
P
p
.001 w
.02381 .10235 m
.02756 .10235 L
s
P
p
.001 w
.02381 .13182 m
.02756 .13182 L
s
P
p
.001 w
.02381 .19076 m
.02756 .19076 L
s
P
p
.001 w
.02381 .22023 m
.02756 .22023 L
s
P
p
.001 w
.02381 .2497 m
.02756 .2497 L
s
P
p
.001 w
.02381 .27917 m
.02756 .27917 L
s
P
p
.001 w
.02381 .3381 m
.02756 .3381 L
s
P
p
.001 w
.02381 .36757 m
.02756 .36757 L
s
P
p
.001 w
.02381 .39704 m
.02756 .39704 L
s
P
p
.001 w
.02381 .42651 m
.02756 .42651 L
s
P
p
.001 w
.02381 .48544 m
.02756 .48544 L
s
P
p
.001 w
.02381 .51491 m
.02756 .51491 L
s
P
p
.001 w
.02381 .54438 m
.02756 .54438 L
s
P
p
.001 w
.02381 .57385 m
.02756 .57385 L
s
P
p
.002 w
.02381 0 m
.02381 .61803 L
s
P
P
0 0 m
1 0 L
1 .61803 L
0 .61803 L
closepath
clip
newpath
p
p
.004 w
.02381 .16129 m
.02505 .16129 L
.02629 .16129 L
.02753 .16128 L
.02877 .16128 L
.03001 .16127 L
.03125 .16126 L
.03373 .16123 L
.03621 .16119 L
.03869 .16115 L
.04365 .16104 L
.04861 .16089 L
.05357 .16072 L
.06349 .16027 L
.07341 .15969 L
.08333 .15899 L
.10317 .1572 L
.12302 .1549 L
.14286 .15208 L
.18254 .14492 L
.22222 .13571 L
.2619 .12446 L
.30159 .11115 L
.34127 .09581 L
.38095 .07841 L
.42063 .05897 L
.44048 .04848 L
.46032 .03748 L
.47024 .03179 L
.48016 .02597 L
.48512 .02301 L
.49008 .02002 L
.49256 .01852 L
.49504 .017 L
.49628 .01624 L
.49752 .01548 L
.49876 .01472 L
.5 .60332 L
.50248 .60179 L
.50496 .60027 L
.50992 .59724 L
.51984 .5913 L
.53968 .57979 L
.57937 .5583 L
.61905 .53886 L
.65873 .52146 L
.69841 .50611 L
.7381 .49281 L
.77778 .48156 L
.81746 .47235 L
Mistroke
.85714 .46519 L
.87698 .46237 L
.89683 .46007 L
.91667 .45828 L
.92659 .45758 L
.93651 .457 L
.94643 .45655 L
.95139 .45638 L
.95635 .45623 L
.96131 .45612 L
.96379 .45608 L
.96627 .45604 L
.96875 .45601 L
.96999 .456 L
.97123 .45599 L
.97247 .45599 L
.97371 .45598 L
.97495 .45598 L
.97619 .45598 L
Mfstroke
P
P
% End of Graphics
MathPictureEnd
:[font = output; output; inactive; preserveAspect; endGroup]
Graphics["<<>>"]
;[o]
-Graphics-
:[font = text; inactive; preserveAspect]
Now we will graph it again to use it as a back drop for the approximations and also as an illustration of how to modify existing plots.
:[font = input; preserveAspect]
ab=Plot[g[x],{x,0,R},PlotStyle->GrayLevel[.5]]
:[font = text; inactive; preserveAspect]
Now we will look at the first 10 coefficents of the Fourier-Bessel series (posotion the cursor and hit the SHIFT--ENTER combination). After a bit you will see a string of 10 decimal numbers and some error messages that may be ignored.
;[s]
4:0,0;108,1;120,2;134,3;235,-1;
4:1,0,0 ,times,0,12,0,0,0;1,0,0 ,Clean,1,12,0,0,0;1,0,0 ,Courier,0,12,0,0,0;1,0,0 ,Charter,0,12,0,0,0;
:[font = input; preserveAspect]
Table[c[m],{m,1,10}]
:[font = text; inactive; preserveAspect]
The next command generates the 10-th partial sum of the Fourier-Bessel Series using these coeffecients.
;[s]
2:0,0;105,1;106,-1;
2:1,0,0 ,times,0,12,0,0,0;1,0,0 ,Courier,0,12,0,0,0;
:[font = input; preserveAspect]
s[10,x]
:[font = text; inactive; preserveAspect; plain; bold; italic]
The above operation spit out something in terms of BesselJ[0,something], don't worry, Mathematica knows what that is.
:[font = text; inactive; preserveAspect]
Now, let's take a look at the first approximation to the function.
:[font = input; preserveAspect]
bb=pl44[1,1,0,4]
:[font = text; inactive; preserveAspect]
Compare that to g(x).
;[s]
2:0,0;16,1;21,-1;
2:1,0,0 ,times,0,12,0,0,0;1,0,0 ,times,1,12,0,0,0;
:[font = input; preserveAspect]
Show[ab,bb]
:[font = text; inactive; preserveAspect]
Not very close, is it? Well, this is just the first term in an infinite series. Let's see if we can get a better approximation.
:[font = text; inactive; preserveAspect]
The next command will generate and plot the 3rd, 4th, and 5th partial sum approximations.
;[s]
2:0,0;90,1;92,-1;
2:1,0,0 ,times,0,12,0,0,0;1,0,0 ,Charter,0,12,0,0,0;
:[font = input; preserveAspect]
bc=pl44[3,5,0,2]
:[font = text; inactive; preserveAspect]
Now compare it to g[x].
;[s]
2:0,0;18,1;23,-1;
2:1,0,0 ,times,0,12,0,0,0;1,0,0 ,times,1,12,0,0,0;
:[font = input; preserveAspect]
Show[ab,bc]
:[font = text; inactive; preserveAspect]
This approximation is begining to look better. To make it even better we will plot 15 terms in the series. This may take your machine a while to do.
;[s]
4:0,0;106,1;107,2;147,3;148,-1;
4:1,0,0 ,times,0,12,0,0,0;1,0,0 ,times,1,12,0,0,0;1,0,0 ,times,3,12,0,0,0;1,0,0 ,times,2,12,0,0,0;
:[font = input; preserveAspect]
bd=pl44[15,15,0,2]
:[font = text; inactive; preserveAspect]
Let's take a look.
:[font = input; preserveAspect]
Show[ab,bd]
:[font = text; inactive; preserveAspect]
This approximation is now getting quite close isn't it?
;[s]
3:0,0;26,1;48,2;55,-1;
3:1,0,0 ,times,0,12,0,0,0;1,0,0 ,Charter,0,12,0,0,0;1,0,0 ,times,0,12,0,0,0;
:[font = text; inactive; preserveAspect]
Now we will take a very large number of terms.We will go up to 25 coefficient because that is as high as I have defined the coefficents above. If you want to go higher you need to find more z[n]'s. Warning: if you try this on your machine it may die on you.
;[s]
4:0,0;190,1;195,2;199,3;258,-1;
4:1,0,0 ,times,0,12,0,0,0;1,0,0 ,times,1,12,0,0,0;1,0,0 ,times,0,12,0,0,0;1,0,0 ,times,3,12,0,0,0;
:[font = input; preserveAspect; startGroup]
be=pl44[25,25,0,2]
:[font = postscript; PostScript; formatAsPostScript; output; inactive; preserveAspect; pictureLeft = 34; pictureWidth = 130; pictureHeight = 287]
%!
%%Creator: Mathematica
%%AspectRatio: 2.20591
MathPictureStart
%% Graphics
/Courier findfont 10 scalefont setfont
% Scaling calculations
0.0238095 0.47619 1.10645 0.47619 [
[(0.5)] .2619 1.10645 0 2 Msboxa
[(1)] .5 1.10645 0 2 Msboxa
[(1.5)] .7381 1.10645 0 2 Msboxa
[(2)] .97619 1.10645 0 2 Msboxa
[(-2)] .01131 .15407 1 0 Msboxa
[(-1)] .01131 .63026 1 0 Msboxa
[(1)] .01131 1.58264 1 0 Msboxa
[(2)] .01131 2.05883 1 0 Msboxa
[ -0.001 -0.001 0 0 ]
[ 1.001 2.20691 0 0 ]
] MathScale
% Start of Graphics
1 setlinecap
1 setlinejoin
newpath
[ ] 0 setdash
0 g
p
p
.002 w
.2619 1.10645 m
.2619 1.1127 L
s
P
[(0.5)] .2619 1.10645 0 2 Mshowa
p
.002 w
.5 1.10645 m
.5 1.1127 L
s
P
[(1)] .5 1.10645 0 2 Mshowa
p
.002 w
.7381 1.10645 m
.7381 1.1127 L
s
P
[(1.5)] .7381 1.10645 0 2 Mshowa
p
.002 w
.97619 1.10645 m
.97619 1.1127 L
s
P
[(2)] .97619 1.10645 0 2 Mshowa
p
.001 w
.07143 1.10645 m
.07143 1.1102 L
s
P
p
.001 w
.11905 1.10645 m
.11905 1.1102 L
s
P
p
.001 w
.16667 1.10645 m
.16667 1.1102 L
s
P
p
.001 w
.21429 1.10645 m
.21429 1.1102 L
s
P
p
.001 w
.30952 1.10645 m
.30952 1.1102 L
s
P
p
.001 w
.35714 1.10645 m
.35714 1.1102 L
s
P
p
.001 w
.40476 1.10645 m
.40476 1.1102 L
s
P
p
.001 w
.45238 1.10645 m
.45238 1.1102 L
s
P
p
.001 w
.54762 1.10645 m
.54762 1.1102 L
s
P
p
.001 w
.59524 1.10645 m
.59524 1.1102 L
s
P
p
.001 w
.64286 1.10645 m
.64286 1.1102 L
s
P
p
.001 w
.69048 1.10645 m
.69048 1.1102 L
s
P
p
.001 w
.78571 1.10645 m
.78571 1.1102 L
s
P
p
.001 w
.83333 1.10645 m
.83333 1.1102 L
s
P
p
.001 w
.88095 1.10645 m
.88095 1.1102 L
s
P
p
.001 w
.92857 1.10645 m
.92857 1.1102 L
s
P
p
.002 w
0 1.10645 m
1 1.10645 L
s
P
p
.002 w
.02381 .15407 m
.03006 .15407 L
s
P
[(-2)] .01131 .15407 1 0 Mshowa
p
.002 w
.02381 .63026 m
.03006 .63026 L
s
P
[(-1)] .01131 .63026 1 0 Mshowa
p
.002 w
.02381 1.58264 m
.03006 1.58264 L
s
P
[(1)] .01131 1.58264 1 0 Mshowa
p
.002 w
.02381 2.05883 m
.03006 2.05883 L
s
P
[(2)] .01131 2.05883 1 0 Mshowa
p
.001 w
.02381 .24931 m
.02756 .24931 L
s
P
p
.001 w
.02381 .34454 m
.02756 .34454 L
s
P
p
.001 w
.02381 .43978 m
.02756 .43978 L
s
P
p
.001 w
.02381 .53502 m
.02756 .53502 L
s
P
p
.001 w
.02381 .7255 m
.02756 .7255 L
s
P
p
.001 w
.02381 .82073 m
.02756 .82073 L
s
P
p
.001 w
.02381 .91597 m
.02756 .91597 L
s
P
p
.001 w
.02381 1.01121 m
.02756 1.01121 L
s
P
p
.001 w
.02381 1.20169 m
.02756 1.20169 L
s
P
p
.001 w
.02381 1.29692 m
.02756 1.29692 L
s
P
p
.001 w
.02381 1.39216 m
.02756 1.39216 L
s
P
p
.001 w
.02381 1.4874 m
.02756 1.4874 L
s
P
p
.001 w
.02381 1.67788 m
.02756 1.67788 L
s
P
p
.001 w
.02381 1.77311 m
.02756 1.77311 L
s
P
p
.001 w
.02381 1.86835 m
.02756 1.86835 L
s
P
p
.001 w
.02381 1.96359 m
.02756 1.96359 L
s
P
p
.001 w
.02381 .05883 m
.02756 .05883 L
s
P
p
.001 w
.02381 2.15407 m
.02756 2.15407 L
s
P
p
.002 w
.02381 0 m
.02381 2.20591 L
s
P
P
0 0 m
1 0 L
1 2.20591 L
0 2.20591 L
closepath
clip
newpath
p
p
p
.004 w
.02381 .79958 m
.02505 .79915 L
.02629 .79787 L
.02753 .79575 L
.02877 .79279 L
.03001 .78903 L
.03125 .78449 L
.03373 .77322 L
.03869 .74315 L
.04365 .70606 L
.05357 .62792 L
.05853 .59534 L
.06101 .58221 L
.06349 .57162 L
.06597 .56374 L
.06721 .56086 L
.06845 .55869 L
.06969 .55724 L
.07093 .55649 L
.07217 .55643 L
.07341 .55705 L
.07465 .55831 L
.07589 .56019 L
.07837 .56567 L
.08085 .57317 L
.08333 .5823 L
.09325 .62623 L
.09821 .64624 L
.10069 .65432 L
.10193 .65773 L
.10317 .66069 L
.10441 .66316 L
.10565 .66512 L
.10689 .66655 L
.10813 .66745 L
.10937 .66781 L
.11062 .66762 L
.11186 .66689 L
.1131 .66563 L
.11558 .66157 L
.11682 .65882 L
.11806 .65561 L
.12302 .63897 L
.13294 .59628 L
.1379 .57628 L
.14038 .56786 L
.14286 .56086 L
.1441 .55796 L
.14534 .55549 L
.14658 .55346 L
Mistroke
.14782 .55189 L
.14906 .55078 L
.1503 .55013 L
.15154 .54994 L
.15278 .5502 L
.15402 .5509 L
.15526 .55203 L
.1565 .55356 L
.15774 .55547 L
.1627 .56632 L
.17262 .5953 L
.17758 .60792 L
.17882 .61044 L
.18006 .61263 L
.1813 .61447 L
.18254 .61593 L
.18378 .61699 L
.18502 .61764 L
.18626 .61785 L
.1875 .61762 L
.18874 .61695 L
.18998 .61583 L
.19246 .61227 L
.1937 .60984 L
.19494 .60701 L
.19742 .60022 L
.20238 .58284 L
.2123 .54129 L
.21726 .52245 L
.21974 .51461 L
.22222 .50815 L
.22346 .50549 L
.2247 .50324 L
.22594 .5014 L
.22718 .49999 L
.22842 .49901 L
.22966 .49847 L
.2309 .49834 L
.23214 .49863 L
.23338 .49933 L
.23462 .50041 L
.23586 .50185 L
.2371 .50364 L
.24206 .51356 L
.24702 .52616 L
.25198 .53874 L
.25446 .54416 L
.25694 .54856 L
.25818 .55029 L
.25942 .55168 L
Mistroke
.26066 .55268 L
.2619 .55327 L
.26314 .55344 L
.26438 .55317 L
.26563 .55245 L
.26687 .55128 L
.26811 .54964 L
.26935 .54754 L
.27183 .54199 L
.27431 .53475 L
.27679 .52597 L
.28175 .50479 L
.29167 .45714 L
.29663 .43648 L
.29911 .4281 L
.30159 .42136 L
.30283 .41867 L
.30407 .41645 L
.30531 .41471 L
.30655 .41346 L
.30779 .4127 L
.30903 .41243 L
.31027 .41264 L
.31151 .41331 L
.32143 .43237 L
.32639 .44699 L
.33135 .46084 L
.33383 .46644 L
.33507 .46873 L
.33631 .47064 L
.33755 .47211 L
.33879 .47311 L
.34003 .47362 L
.34127 .47359 L
.34251 .47303 L
.34375 .47189 L
.34499 .47018 L
.34623 .46789 L
.34747 .46501 L
.34871 .46155 L
.35119 .45296 L
.35615 .42967 L
.36111 .40026 L
.36607 .36801 L
.37103 .33686 L
.37599 .31078 L
.37847 .30074 L
.37971 .29662 L
.38095 .29316 L
.38219 .29037 L
Mistroke
.38343 .28828 L
.38467 .28691 L
.38591 .28626 L
.38715 .28633 L
.38839 .28712 L
.38963 .28862 L
.39087 .29079 L
.40079 .32805 L
.40575 .35364 L
.41071 .37724 L
.41319 .38658 L
.41443 .39035 L
.41567 .39341 L
.41691 .39571 L
.41815 .39716 L
.41939 .39773 L
.42063 .39734 L
.44048 .25503 L
.44544 .19215 L
.4504 .13158 L
.45288 .1051 L
.45536 .08277 L
.4566 .07355 L
.45784 .06582 L
.45908 .05971 L
.46032 .05538 L
.46156 .05294 L
.4628 .05252 L
.46404 .05424 L
.46528 .05819 L
.46652 .06448 L
.46776 .07319 L
.47024 .09813 L
.47272 .13344 L
.4752 .17934 L
.48016 .30259 L
.48512 .46503 L
.49008 .66032 L
.5 1.10993 L
.50992 1.55732 L
.51488 1.75019 L
.51984 1.90982 L
.52232 1.9752 L
.5248 2.03034 L
.52728 2.07503 L
.52976 2.10933 L
.531 2.12265 L
.53224 2.13349 L
.53348 2.1419 L
.53472 2.14796 L
Mistroke
.53596 2.15175 L
.5372 2.15338 L
.53844 2.15295 L
.53968 2.15058 L
.54092 2.14637 L
.54216 2.14048 L
.5434 2.13302 L
.54464 2.12413 L
.5496 2.07728 L
.55952 1.95935 L
.56448 1.90504 L
.56696 1.88193 L
.56944 1.86224 L
.57192 1.84633 L
.57316 1.83986 L
.5744 1.83439 L
.57564 1.82993 L
.57688 1.82646 L
.57813 1.82397 L
.57937 1.82244 L
.58061 1.82182 L
.58185 1.82208 L
.58309 1.82316 L
.58433 1.82502 L
.58557 1.82759 L
.58681 1.83081 L
.58929 1.83891 L
.59921 1.88232 L
.60169 1.89286 L
.60417 1.90216 L
.60665 1.90976 L
.60789 1.91281 L
.60913 1.91531 L
.61037 1.91722 L
.61161 1.91853 L
.61285 1.9192 L
.61409 1.91924 L
.61533 1.91863 L
.61657 1.91738 L
.61781 1.91549 L
.61905 1.91298 L
.62153 1.90615 L
.62401 1.89712 L
.62897 1.87367 L
.63889 1.81631 L
.64385 1.7893 L
.64633 1.77758 L
.64881 1.76744 L
.65129 1.75909 L
.65253 1.75564 L
Mistroke
.65377 1.75268 L
.65501 1.75023 L
.65625 1.74828 L
.65749 1.74683 L
.65873 1.74586 L
.65997 1.74538 L
.66121 1.74535 L
.66245 1.74576 L
.66369 1.74658 L
.66493 1.74779 L
.66617 1.74935 L
.66865 1.75337 L
.67857 1.77556 L
.68105 1.78089 L
.68353 1.78548 L
.68601 1.78905 L
.68725 1.79037 L
.68849 1.79136 L
.68973 1.79198 L
.69097 1.79223 L
.69221 1.79208 L
.69345 1.79154 L
.69469 1.79059 L
.69593 1.78923 L
.69841 1.78532 L
.70089 1.77986 L
.70337 1.77298 L
.70833 1.75574 L
.71825 1.71459 L
.72321 1.69536 L
.72569 1.68705 L
.72817 1.67989 L
.73065 1.67405 L
.73189 1.67166 L
.73313 1.66963 L
.73437 1.66798 L
.73562 1.6667 L
.73686 1.6658 L
.7381 1.66526 L
.73934 1.66508 L
.74058 1.66524 L
.74182 1.66574 L
.74306 1.66655 L
.7443 1.66766 L
.74554 1.66903 L
.74802 1.67247 L
.75794 1.69103 L
.76042 1.69552 L
.7629 1.69941 L
.76538 1.70248 L
Mistroke
.76662 1.70365 L
.76786 1.70454 L
.7691 1.70513 L
.77034 1.70541 L
.77158 1.70537 L
.77282 1.705 L
.77406 1.70429 L
.7753 1.70324 L
.77654 1.70185 L
.77778 1.70012 L
.78026 1.69569 L
.78274 1.69003 L
.7877 1.67563 L
.79762 1.64063 L
.80258 1.62414 L
.80506 1.61703 L
.80754 1.61096 L
.81002 1.60609 L
.81126 1.60416 L
.8125 1.60257 L
.81374 1.60133 L
.81498 1.60045 L
.81622 1.59993 L
.81746 1.59977 L
.8187 1.59996 L
.81994 1.60049 L
.82118 1.60136 L
.82242 1.60256 L
.82366 1.60405 L
.8249 1.60582 L
.82738 1.61013 L
.8373 1.63308 L
.84226 1.64423 L
.84474 1.64876 L
.84598 1.65066 L
.84722 1.65227 L
.84846 1.65359 L
.8497 1.65457 L
.85094 1.65521 L
.85218 1.65549 L
.85342 1.6554 L
.85466 1.65493 L
.8559 1.65406 L
.85714 1.65281 L
.85962 1.64915 L
.8621 1.64398 L
.86706 1.62966 L
.87698 1.59124 L
.88194 1.57189 L
.88442 1.56334 L
Mistroke
.8869 1.55597 L
.88938 1.55007 L
.89062 1.54774 L
.89187 1.54587 L
.89311 1.54448 L
.89435 1.54358 L
.89559 1.54319 L
.89683 1.54333 L
.89807 1.544 L
.89931 1.54521 L
.90179 1.54921 L
.90303 1.55199 L
.90427 1.55527 L
.90675 1.56325 L
.91171 1.58402 L
.91667 1.60901 L
.92163 1.63475 L
.92411 1.64664 L
.92659 1.65717 L
.92907 1.66578 L
.93031 1.66921 L
.93155 1.67195 L
.93279 1.67396 L
.93403 1.67517 L
.93527 1.67553 L
.93651 1.67497 L
.93775 1.67345 L
.93899 1.67093 L
.94023 1.66736 L
.94147 1.66269 L
.94395 1.64998 L
.94643 1.63258 L
.95139 1.58336 L
.95635 1.51521 L
.96627 1.33027 L
.97619 1.10645 L
Mfstroke
P
P
P
% End of Graphics
MathPictureEnd
:[font = output; output; inactive; preserveAspect; endGroup]
Graphics["<<>>"]
;[o]
-Graphics-
:[font = text; inactive; preserveAspect]
Now compare to g[x].
;[s]
2:0,0;15,1;20,-1;
2:1,0,0 ,times,0,12,0,0,0;1,0,0 ,times,1,12,0,0,0;
:[font = input; preserveAspect; startGroup]
Show[ab,be]
:[font = postscript; PostScript; formatAsPostScript; output; inactive; preserveAspect; pictureLeft = 34; pictureWidth = 281; pictureHeight = 173]
%!
%%Creator: Mathematica
%%AspectRatio: .61803
MathPictureStart
%% Graphics
/Courier findfont 10 scalefont setfont
% Scaling calculations
0.0238095 0.47619 0.309996 0.133415 [
[(0.5)] .2619 .31 0 2 Msboxa
[(1)] .5 .31 0 2 Msboxa
[(1.5)] .7381 .31 0 2 Msboxa
[(2)] .97619 .31 0 2 Msboxa
[(-2)] .01131 .04317 1 0 Msboxa
[(-1)] .01131 .17658 1 0 Msboxa
[(1)] .01131 .44341 1 0 Msboxa
[(2)] .01131 .57683 1 0 Msboxa
[ -0.001 -0.001 0 0 ]
[ 1.001 .61903 0 0 ]
] MathScale
% Start of Graphics
1 setlinecap
1 setlinejoin
newpath
[ ] 0 setdash
0 g
p
p
.002 w
.2619 .31 m
.2619 .31625 L
s
P
[(0.5)] .2619 .31 0 2 Mshowa
p
.002 w
.5 .31 m
.5 .31625 L
s
P
[(1)] .5 .31 0 2 Mshowa
p
.002 w
.7381 .31 m
.7381 .31625 L
s
P
[(1.5)] .7381 .31 0 2 Mshowa
p
.002 w
.97619 .31 m
.97619 .31625 L
s
P
[(2)] .97619 .31 0 2 Mshowa
p
.001 w
.07143 .31 m
.07143 .31375 L
s
P
p
.001 w
.11905 .31 m
.11905 .31375 L
s
P
p
.001 w
.16667 .31 m
.16667 .31375 L
s
P
p
.001 w
.21429 .31 m
.21429 .31375 L
s
P
p
.001 w
.30952 .31 m
.30952 .31375 L
s
P
p
.001 w
.35714 .31 m
.35714 .31375 L
s
P
p
.001 w
.40476 .31 m
.40476 .31375 L
s
P
p
.001 w
.45238 .31 m
.45238 .31375 L
s
P
p
.001 w
.54762 .31 m
.54762 .31375 L
s
P
p
.001 w
.59524 .31 m
.59524 .31375 L
s
P
p
.001 w
.64286 .31 m
.64286 .31375 L
s
P
p
.001 w
.69048 .31 m
.69048 .31375 L
s
P
p
.001 w
.78571 .31 m
.78571 .31375 L
s
P
p
.001 w
.83333 .31 m
.83333 .31375 L
s
P
p
.001 w
.88095 .31 m
.88095 .31375 L
s
P
p
.001 w
.92857 .31 m
.92857 .31375 L
s
P
p
.002 w
0 .31 m
1 .31 L
s
P
p
.002 w
.02381 .04317 m
.03006 .04317 L
s
P
[(-2)] .01131 .04317 1 0 Mshowa
p
.002 w
.02381 .17658 m
.03006 .17658 L
s
P
[(-1)] .01131 .17658 1 0 Mshowa
p
.002 w
.02381 .44341 m
.03006 .44341 L
s
P
[(1)] .01131 .44341 1 0 Mshowa
p
.002 w
.02381 .57683 m
.03006 .57683 L
s
P
[(2)] .01131 .57683 1 0 Mshowa
p
.001 w
.02381 .06985 m
.02756 .06985 L
s
P
p
.001 w
.02381 .09653 m
.02756 .09653 L
s
P
p
.001 w
.02381 .12321 m
.02756 .12321 L
s
P
p
.001 w
.02381 .1499 m
.02756 .1499 L
s
P
p
.001 w
.02381 .20326 m
.02756 .20326 L
s
P
p
.001 w
.02381 .22995 m
.02756 .22995 L
s
P
p
.001 w
.02381 .25663 m
.02756 .25663 L
s
P
p
.001 w
.02381 .28331 m
.02756 .28331 L
s
P
p
.001 w
.02381 .33668 m
.02756 .33668 L
s
P
p
.001 w
.02381 .36336 m
.02756 .36336 L
s
P
p
.001 w
.02381 .39005 m
.02756 .39005 L
s
P
p
.001 w
.02381 .41673 m
.02756 .41673 L
s
P
p
.001 w
.02381 .47009 m
.02756 .47009 L
s
P
p
.001 w
.02381 .49678 m
.02756 .49678 L
s
P
p
.001 w
.02381 .52346 m
.02756 .52346 L
s
P
p
.001 w
.02381 .55014 m
.02756 .55014 L
s
P
p
.001 w
.02381 .01648 m
.02756 .01648 L
s
P
p
.001 w
.02381 .60351 m
.02756 .60351 L
s
P
p
.002 w
.02381 0 m
.02381 .61803 L
s
P
P
0 0 m
1 0 L
1 .61803 L
0 .61803 L
closepath
clip
newpath
p
p
.5 g
p
.004 w
.02381 .17658 m
.02505 .17658 L
.02629 .17658 L
.02753 .17657 L
.02877 .17657 L
.03001 .17656 L
.03125 .17655 L
.03373 .17652 L
.03621 .17649 L
.03869 .17645 L
.04365 .17635 L
.04861 .17622 L
.05357 .17606 L
.06349 .17565 L
.07341 .17513 L
.08333 .1745 L
.10317 .17287 L
.12302 .17079 L
.14286 .16824 L
.18254 .16176 L
.22222 .15342 L
.2619 .14323 L
.30159 .13118 L
.34127 .11729 L
.38095 .10153 L
.42063 .08393 L
.44048 .07443 L
.46032 .06447 L
.47024 .05932 L
.48016 .05405 L
.48512 .05137 L
.49008 .04867 L
.49256 .0473 L
.49504 .04593 L
.49628 .04524 L
.49752 .04455 L
.49876 .04386 L
.5 .57683 L
.50248 .57544 L
.50496 .57406 L
.50992 .57133 L
.51984 .56594 L
.53968 .55552 L
.57937 .53606 L
.61905 .51846 L
.65873 .50271 L
.69841 .48881 L
.7381 .47677 L
.77778 .46657 L
.81746 .45824 L
Mistroke
.85714 .45175 L
.87698 .4492 L
.89683 .44712 L
.91667 .4455 L
.92659 .44486 L
.93651 .44434 L
.94643 .44393 L
.95139 .44377 L
.95635 .44364 L
.96131 .44354 L
.96379 .4435 L
.96627 .44347 L
.96875 .44344 L
.96999 .44343 L
.97123 .44343 L
.97247 .44342 L
.97371 .44342 L
.97495 .44341 L
.97619 .44341 L
Mfstroke
P
P
p
p
p
.004 w
.02381 .22402 m
.02505 .2239 L
.02629 .22354 L
.02753 .22295 L
.02877 .22212 L
.03001 .22106 L
.03125 .21979 L
.03373 .21663 L
.03869 .20821 L
.04365 .19782 L
.05357 .17593 L
.05853 .1668 L
.06101 .16312 L
.06349 .16015 L
.06597 .15794 L
.06721 .15714 L
.06845 .15653 L
.06969 .15612 L
.07093 .15591 L
.07217 .1559 L
.07341 .15607 L
.07465 .15642 L
.07589 .15695 L
.07837 .15849 L
.08085 .16059 L
.08333 .16314 L
.09325 .17545 L
.09821 .18106 L
.10069 .18332 L
.10193 .18428 L
.10317 .18511 L
.10441 .1858 L
.10565 .18635 L
.10689 .18675 L
.10813 .187 L
.10937 .1871 L
.11062 .18705 L
.11186 .18684 L
.1131 .18649 L
.11558 .18535 L
.11682 .18458 L
.11806 .18368 L
.12302 .17902 L
.13294 .16706 L
.1379 .16146 L
.14038 .1591 L
.14286 .15714 L
.1441 .15633 L
.14534 .15563 L
.14658 .15507 L
Mistroke
.14782 .15462 L
.14906 .15431 L
.1503 .15413 L
.15154 .15408 L
.15278 .15415 L
.15402 .15435 L
.15526 .15466 L
.1565 .15509 L
.15774 .15563 L
.1627 .15867 L
.17262 .16679 L
.17758 .17032 L
.17882 .17103 L
.18006 .17164 L
.1813 .17216 L
.18254 .17257 L
.18378 .17286 L
.18502 .17305 L
.18626 .1731 L
.1875 .17304 L
.18874 .17285 L
.18998 .17254 L
.19246 .17154 L
.1937 .17086 L
.19494 .17007 L
.19742 .16816 L
.20238 .1633 L
.2123 .15165 L
.21726 .14638 L
.21974 .14418 L
.22222 .14237 L
.22346 .14162 L
.2247 .14099 L
.22594 .14048 L
.22718 .14008 L
.22842 .13981 L
.22966 .13966 L
.2309 .13962 L
.23214 .1397 L
.23338 .1399 L
.23462 .1402 L
.23586 .14061 L
.2371 .14111 L
.24206 .14389 L
.24702 .14742 L
.25198 .15094 L
.25446 .15246 L
.25694 .15369 L
.25818 .15418 L
.25942 .15456 L
Mistroke
.26066 .15484 L
.2619 .15501 L
.26314 .15506 L
.26438 .15498 L
.26563 .15478 L
.26687 .15445 L
.26811 .15399 L
.26935 .15341 L
.27183 .15185 L
.27431 .14982 L
.27679 .14736 L
.28175 .14143 L
.29167 .12808 L
.29663 .12229 L
.29911 .11994 L
.30159 .11805 L
.30283 .1173 L
.30407 .11668 L
.30531 .11619 L
.30655 .11584 L
.30779 .11563 L
.30903 .11555 L
.31027 .11561 L
.31151 .1158 L
.32143 .12114 L
.32639 .12524 L
.33135 .12912 L
.33383 .13068 L
.33507 .13133 L
.33631 .13186 L
.33755 .13227 L
.33879 .13255 L
.34003 .13269 L
.34127 .13269 L
.34251 .13253 L
.34375 .13221 L
.34499 .13173 L
.34623 .13109 L
.34747 .13028 L
.34871 .12931 L
.35119 .12691 L
.35615 .12038 L
.36111 .11214 L
.36607 .10311 L
.37103 .09438 L
.37599 .08707 L
.37847 .08426 L
.37971 .0831 L
.38095 .08213 L
.38219 .08135 L
Mistroke
.38343 .08077 L
.38467 .08038 L
.38591 .0802 L
.38715 .08022 L
.38839 .08044 L
.38963 .08086 L
.39087 .08147 L
.40079 .09191 L
.40575 .09908 L
.41071 .10569 L
.41319 .10831 L
.41443 .10936 L
.41567 .11022 L
.41691 .11087 L
.41815 .11127 L
.41939 .11143 L
.42063 .11132 L
.44048 .07145 L
.44544 .05383 L
.4504 .03687 L
.45288 .02945 L
.45536 .02319 L
.4566 .02061 L
.45784 .01844 L
.45908 .01673 L
.46032 .01552 L
.46156 .01483 L
.4628 .01472 L
.46404 .0152 L
.46528 .0163 L
.46652 .01807 L
.46776 .02051 L
.47024 .02749 L
.47272 .03739 L
.4752 .05024 L
.48016 .08478 L
.48512 .13029 L
.49008 .185 L
.5 .31097 L
.50992 .43632 L
.51488 .49036 L
.51984 .53508 L
.52232 .5534 L
.5248 .56884 L
.52728 .58137 L
.52976 .59098 L
.531 .59471 L
.53224 .59774 L
.53348 .6001 L
.53472 .6018 L
Mistroke
.53596 .60286 L
.5372 .60332 L
.53844 .6032 L
.53968 .60253 L
.54092 .60135 L
.54216 .5997 L
.5434 .59761 L
.54464 .59512 L
.5496 .582 L
.55952 .54896 L
.56448 .53374 L
.56696 .52726 L
.56944 .52175 L
.57192 .51729 L
.57316 .51548 L
.5744 .51395 L
.57564 .5127 L
.57688 .51172 L
.57813 .51103 L
.57937 .5106 L
.58061 .51042 L
.58185 .5105 L
.58309 .5108 L
.58433 .51132 L
.58557 .51204 L
.58681 .51294 L
.58929 .51521 L
.59921 .52737 L
.60169 .53033 L
.60417 .53293 L
.60665 .53506 L
.60789 .53592 L
.60913 .53662 L
.61037 .53715 L
.61161 .53752 L
.61285 .53771 L
.61409 .53772 L
.61533 .53755 L
.61657 .5372 L
.61781 .53667 L
.61905 .53596 L
.62153 .53405 L
.62401 .53152 L
.62897 .52495 L
.63889 .50888 L
.64385 .50131 L
.64633 .49803 L
.64881 .49519 L
.65129 .49285 L
.65253 .49188 L
Mistroke
.65377 .49105 L
.65501 .49037 L
.65625 .48982 L
.65749 .48941 L
.65873 .48914 L
.65997 .48901 L
.66121 .489 L
.66245 .48911 L
.66369 .48934 L
.66493 .48968 L
.66617 .49012 L
.66865 .49125 L
.67857 .49746 L
.68105 .49896 L
.68353 .50024 L
.68601 .50124 L
.68725 .50161 L
.68849 .50189 L
.68973 .50206 L
.69097 .50213 L
.69221 .50209 L
.69345 .50194 L
.69469 .50167 L
.69593 .50129 L
.69841 .5002 L
.70089 .49867 L
.70337 .49674 L
.70833 .49191 L
.71825 .48038 L
.72321 .47499 L
.72569 .47266 L
.72817 .47066 L
.73065 .46902 L
.73189 .46835 L
.73313 .46779 L
.73437 .46732 L
.73562 .46696 L
.73686 .46671 L
.7381 .46656 L
.73934 .46651 L
.74058 .46656 L
.74182 .46669 L
.74306 .46692 L
.7443 .46723 L
.74554 .46762 L
.74802 .46858 L
.75794 .47378 L
.76042 .47504 L
.7629 .47613 L
.76538 .47699 L
Mistroke
.76662 .47732 L
.76786 .47756 L
.7691 .47773 L
.77034 .47781 L
.77158 .4778 L
.77282 .4777 L
.77406 .4775 L
.7753 .4772 L
.77654 .47681 L
.77778 .47633 L
.78026 .47509 L
.78274 .4735 L
.7877 .46947 L
.79762 .45966 L
.80258 .45504 L
.80506 .45305 L
.80754 .45135 L
.81002 .44998 L
.81126 .44944 L
.8125 .44899 L
.81374 .44865 L
.81498 .4484 L
.81622 .44826 L
.81746 .44821 L
.8187 .44826 L
.81994 .44841 L
.82118 .44866 L
.82242 .44899 L
.82366 .44941 L
.8249 .44991 L
.82738 .45111 L
.8373 .45754 L
.84226 .46067 L
.84474 .46194 L
.84598 .46247 L
.84722 .46292 L
.84846 .46329 L
.8497 .46357 L
.85094 .46375 L
.85218 .46382 L
.85342 .4638 L
.85466 .46367 L
.8559 .46342 L
.85714 .46307 L
.85962 .46205 L
.8621 .4606 L
.86706 .45659 L
.87698 .44582 L
.88194 .4404 L
.88442 .43801 L
Mistroke
.8869 .43594 L
.88938 .43429 L
.89062 .43363 L
.89187 .43311 L
.89311 .43272 L
.89435 .43247 L
.89559 .43236 L
.89683 .4324 L
.89807 .43259 L
.89931 .43292 L
.90179 .43405 L
.90303 .43482 L
.90427 .43574 L
.90675 .43798 L
.91171 .4438 L
.91667 .4508 L
.92163 .45801 L
.92411 .46134 L
.92659 .46429 L
.92907 .46671 L
.93031 .46767 L
.93155 .46844 L
.93279 .469 L
.93403 .46934 L
.93527 .46944 L
.93651 .46928 L
.93775 .46886 L
.93899 .46815 L
.94023 .46715 L
.94147 .46584 L
.94395 .46228 L
.94643 .4574 L
.95139 .44361 L
.95635 .42452 L
.96627 .37271 L
.97619 .31 L
Mfstroke
P
P
P
P
% End of Graphics
MathPictureEnd
:[font = output; output; inactive; preserveAspect; endGroup]
Graphics["<<>>"]
;[o]
-Graphics-
:[font = text; inactive; preserveAspect; plain; bold; italic; endGroup]
We have included the last 2 graphs so that you don't have to exicute this command to see
this approximation. You may re-exicute it yourself if you want.
:[font = section; inactive; preserveAspect; plain; bold; italic; startGroup]
Your Own Example.
:[font = text; inactive; preserveAspect; cellOutline; fontColorRed = 65535; fontColorGreen = 65535; fontColorBlue = 65535; backColorRed = 21845; backColorGreen = 21845; backColorBlue = 21845]
Finaly, we give a sequence of commands that will generate a new example using a function that you must input.
;[s]
2:0,0;110,1;111,-1;
2:1,0,0 ,times,0,14,65535,65535,65535;1,0,0 ,times,1,12,65535,65535,65535;
:[font = text; inactive; preserveAspect]
First, clear out the old definitions of g[x] and R.
;[s]
4:0,0;41,1;45,2;49,3;53,-1;
4:1,0,0 ,times,0,12,0,0,0;1,0,0 ,times,1,12,0,0,0;1,0,0 ,times,0,12,0,0,0;1,0,0 ,times,1,12,0,0,0;
:[font = input; preserveAspect]
Clear[g,R]
:[font = text; inactive; preserveAspect]
You may start over at any time by returning to this command.
;[s]
2:0,0;52,1;60,-1;
2:1,0,0 ,times,0,12,0,0,0;1,0,0 ,Charter,0,12,0,0,0;
:[font = text; inactive; preserveAspect]
Edit the next 2 lines to replace the ? marks and define your own example.
;[s]
3:0,0;38,1;40,2;75,-1;
3:1,0,0 ,times,0,12,0,0,0;1,0,0 ,times,1,12,0,0,0;1,0,0 ,times,0,12,0,0,0;
:[font = input; preserveAspect]
g[x_]:=?
R:=?
:[font = text; inactive; preserveAspect]
Now execute the follwoing sequence of commands to generate your example. The new variable Num is the number of terms to be used in the partial sum.
;[s]
3:0,0;90,1;93,2;147,-1;
3:1,0,0 ,times,0,12,0,0,0;1,0,0 ,times,1,12,0,0,0;1,0,0 ,times,0,12,0,0,0;
:[font = input; preserveAspect]
Num:=10
:[font = text; inactive; preserveAspect]
Plot the function g[x]
;[s]
2:0,0;18,1;23,-1;
2:1,0,0 ,times,0,12,0,0,0;1,0,0 ,times,1,12,0,0,0;
:[font = input; preserveAspect]
cb=Plot[g[x],{x,0,R},PlotStyle->GrayLevel[.5]]
:[font = text; inactive; preserveAspect]
Look at the coefficients c[m] for m= 0, 1, 2 ,..., Num-1
;[s]
4:0,0;25,1;32,2;35,3;63,-1;
4:1,0,0 ,times,0,12,0,0,0;1,0,0 ,times,1,12,0,0,0;1,0,0 ,times,0,12,0,0,0;1,0,0 ,times,1,12,0,0,0;
:[font = input; preserveAspect]
Table[c[m],{m,0,Num-1}]
:[font = text; inactive; preserveAspect]
Look at the formula for the partial sum
:[font = input; preserveAspect]
s[Num-1,x]
:[font = text; inactive; preserveAspect]
To see a plot of the first term execute the following.
:[font = input; preserveAspect]
da=pl44[0,0,0,R]
:[font = text; inactive; preserveAspect]
And compare to g[x]
;[s]
2:0,0;15,1;19,-1;
2:1,0,0 ,times,0,12,0,0,0;1,0,0 ,times,1,12,0,0,0;
:[font = input; preserveAspect]
Show[cb,da]
:[font = text; inactive; preserveAspect]
Just to see how things are going, plot the 3-rd, 4-th, and 5-th partial sums
:[font = input; preserveAspect]
db=pl44[3,5,0,R]
:[font = text; inactive; preserveAspect]
Now compare with g[x]
;[s]
2:0,0;17,1;21,-1;
2:1,0,0 ,times,0,12,0,0,0;1,0,0 ,times,1,12,0,0,0;
:[font = input; preserveAspect]
Show[cb,db]
:[font = text; inactive; preserveAspect]
Look at the Num- th partial sum
;[s]
3:0,0;12,1;15,2;31,-1;
3:1,0,0 ,times,0,12,0,0,0;1,0,0 ,times,1,12,0,0,0;1,0,0 ,times,0,12,0,0,0;
:[font = input; preserveAspect]
dc=pl44[Num,Num,0,R]
:[font = text; inactive; preserveAspect]
Now compare it to g[x]
;[s]
2:0,0;18,1;22,-1;
2:1,0,0 ,times,0,12,0,0,0;1,0,0 ,times,1,12,0,0,0;
:[font = input; preserveAspect]
Show[cb,dc]
:[font = text; inactive; preserveAspect]
Now look at twice as many terms in the partial sums
:[font = input; preserveAspect]
dd=pl44[2*Num,2*Num,0,R]
:[font = text; inactive; preserveAspect]
and compare it to g[x]
;[s]
2:0,0;18,1;22,-1;
2:1,0,0 ,times,0,12,0,0,0;1,0,0 ,times,1,12,0,0,0;
:[font = input; preserveAspect]
Show[cb,dd]
:[font = text; inactive; preserveAspect; endGroup]
You may start over at any time by executing the Clear[g,R] command.
;[s]
3:0,0;49,1;60,2;68,-1;
3:1,0,0 ,times,0,12,0,0,0;1,0,0 ,courier,1,12,0,0,0;1,0,0 ,Charter,0,12,0,0,0;
:[font = section; inactive; preserveAspect; startGroup]
Here are some examples of some functions you may want to try.
:[font = input; preserveAspect]
g[x_]:=If[x<.5,0,If[x<1,-1,If[x<1.5,1,0]]]
R:=2
:[font = input; preserveAspect; endGroup; endGroup]
g[x_]:=If[x<1,x^3,(x-2)^3]
R:=2
^*)