1 c===========================================================================
3 c This file is part of TISEAN
5 c Copyright (c) 1998-2007 Rainer Hegger, Holger Kantz, Thomas Schreiber
7 c TISEAN is free software; you can redistribute it and/or modify
8 c it under the terms of the GNU General Public License as published by
9 c the Free Software Foundation; either version 2 of the License, or
10 c (at your option) any later version.
12 c TISEAN is distributed in the hope that it will be useful,
13 c but WITHOUT ANY WARRANTY; without even the implied warranty of
14 c MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 c GNU General Public License for more details.
17 c You should have received a copy of the GNU General Public License
18 c along with TISEAN; if not, write to the Free Software
19 c Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
21 c===========================================================================
23 c Takens' estimator from c2
24 c author T. Schreiber (1998)
25 c===========================================================================
28 dimension e(meps), c(meps), lw(meps)
30 character*72 file, fout, aline
33 call whatido("Takens' estimator from correlation sum data",iverb)
34 isout=igetout(fout,iverb)
35 if(nstrings().eq.0) call usage()
36 call nthstring(1,file)
37 call infile(file,iunit,iverb)
38 if(isout.eq.1) call addsuff(fout,file,"_t")
39 call outfile(fout,iunit2,iverb)
40 1 read(iunit,'(a)',end=999) aline
41 4 if(aline(1:1).ne."#") goto 1
43 . read(aline(index(aline,"m=")+2:72),'(i20)',err=1) m
45 2 read(iunit,'(a)') aline
46 if(aline(1:72).eq." ") goto 3
47 read(aline,*,err=999,end=999) ee, cc
53 3 write(iunit2,'(4h#m= ,i5)') m
55 call index2sort(me,e,lw)
56 call index2sort(me,c,lw)
59 b=(e(i)*c(i-1)-e(i-1)*c(i))/(e(i)-e(i-1))
60 a=(c(i)-c(i-1))/(e(i)-e(i-1))
62 cint=cint+(exp(b)/a)*(exp(a*e(i))-exp(a*e(i-1)))
64 cint=cint+exp(b)*(e(i)-e(i-1))
66 10 write(iunit2,*) exp(e(i)), exp(c(i))/cint
77 . "[-o outfile -V# -h] file")