program fdr(histog,fdrp,outfile,output); (* computes f_D(r) *) const (* begin module version *) version = 1.04; (* of fdr.p 1995 Jan 14 *) (* Revision history: v. 1.00 started = 10 Jan 1995 Written at National Cancer Institute, Frederick, Maryland *) (* end module version *) (* begin module describe.fdr *) (* name fdr: computes best values of sigma/D for f_D(r) fit of real data. synopsis fdr(histog: in, fdrp:in, outfile: out, output: out) files histog: output file from genhis. fdrp: parameter file for fdr. sigma,sigmastep (reals): initial value and incremental increase in sigma. dim,dimstep (reals): initial value and incremental increase in D. temperature (real): Kelvin temperature of system. outfile: writes best value of sigma/D and error in f_D(r) fit. output: sends messages to the user. description D-1 2 2 r exp(-r /2sigma ) f (r) = ----------------------- D D D/2-1 Gamma(D/2) sigma 2 We compute the values of D, sigma that minimze the least-squares error between f_D(r) and the actual data read in from histog. examples See fdr.eg (not yet written ) documentation See Appendix 3 to TDS's CCMM paper. see also genhis.p author V. Jejjala (vishnu@ncifcrf.gov) bugs Unknown but existent (existential bugs, as it were... :-) ). If you find a bug, please forward your discovery to the author. disclaimer The author of this code is in no way responsible for any havoc that this program may cause to your computer system, your files, or your reputation. Use this program and the data it generates at your own risk. technical notes Use large data sets in histog when possible. *) (* end module describe.fdr *) (* begin module globals *) (* more constants *) k=1.380662e-23; (* Boltzmann's constant *) maxval=50; (* maximum number of points to consider on f_D(r) *) maxpass=100; (* maximum number of passes of program *) maxpassp=101; (* maxpass + 1 *) big=1000000.0; (* very big real number *) machep=-500.0; (* exp(machep) ~ machine epsilon *) type singlept=record start,histval:real end; recdata=record allpts:array[1..maxval] of singlept; sig,D,err:real end; rdata=array[0..maxpassp] of real; var histog, (* output of genhis from which data are read *) fdrp, (* parameter file *) outfile:text; (* file to which data are written *) (* end module globals *) (* begin module expo *) function expo(a,b:real):real; (* yields a^b *) begin if a=0.0 then expo:=0 else if b*ln(a)1)) or (pass>maxpass) then begin writefile(outfile,databest,sigmastep,dimstep,pass); result:=true end; pass:=pass+1 until result=true end; (* end module themain *) (* begin module mainroutine *) begin themain(histog,fdrp,outfile) end. (* end module mainroutine *)