001package cli;
002
003import kernels.EnergyDensityKernel;
004
005import models.*;
006
007
008/**
009 * (For Fig 2) Computes the lowest eigenvalue of the smeared energy density, 
010 * for the sinh-Gordon and the generalised Ising model, 
011 * with coupling \(B\) varying from \(0\) to \(2\).
012 * 
013 * Takes three command line arguments: the number \(N\) of discretization steps,
014 * the rapidity cutoff \(R\), and the number of steps in the coupling constant.
015 * 
016 */
017public class SinhCouplingAnalyzer extends CLIAnalyzer {   
018
019    public static void main(String[] args) {
020        int N = Integer.parseInt(args[0]);
021        double R = Double.parseDouble(args[1]);
022        int couplingN = Integer.parseInt(args[2]);
023        
024        String header = "Sinh-Gordon and sinh-Ising lowest eigenvalues, N="+N+", R="+R + " coupling steps: " + couplingN;
025        System.out.println(header);
026        
027        double[][] res = new double[couplingN][3];
028        
029        for (int i = 0; i < couplingN; i++) {
030            double b = 2.0 / (couplingN - 1) * i;
031            IntegrableModel m;
032            EnergyDensityKernel k;
033
034            res[i][0] = b;
035
036            m = new SinhGordonModel(b);
037            k = new EnergyDensityKernel(m, 1.0, 0.0, 0, 0.1);
038            res[i][1] = k.findLowestEigenvalue(N, R);
039
040            m = new SinhIsingModel(b);
041            k = new EnergyDensityKernel(m, 1.0, 0.0, 1, 0.1);
042            res[i][2] = k.findLowestEigenvalue(N, R);
043        }
044
045        writeDatafile("SinhCoupling", header, res);
046    }
047}