# file: mf_moments_lt.awk Y. Ashkenazy 8 Feb 2004 # Last Revised: I. Henry 13 Oct 2004 #--------------------------------------------------------------------------- # mf_moments_lt.awk: calculate the tau(q) spectrum and the multifractal # spectrum, D(h), given the partition functions. # Copyright (C) Yossi Ashkenazy # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #--------------------------------------------------------------------------- # # # Usage: # # \$ awk -f mf_moments_lt.awk -v a=1 -v b=3 file_name.zq > file_name.tq # # where: # - a is the minimum log10 scale (1 in the above example) # - b is the maximum log10 scale (3 in the above example is 3) # - file_name.zq is the input filename that contains the partition function # - the output, file_name.tq, is the tau(q) spectrum and the D(h) spectrum. # BEGIN{ s0=0.0; s1=s2=0.0; dq=0.2; } { if (NR==1) { # read the data q_min=\$2; for (i=1;i=a)&&(\$1<=b)) { x=\$1; s0++; s1+=x; s2+=x*x; for (i=2;i<=NF;i++) { t0[i-1]+=(\$i); t1[i-1]+=x*(\$i); } } } } END{ for (i=1;i