/*
* File: QuarkMixingRevised.java / by Guowu Meng, April 11, 2013
* --------------------
* This program computes |Vcb| and |Vtd| via formula (3) in the paper titled "5th force and quark mixing".
*/
import java.math.BigDecimal;
import acm.program.*;
import acm.util.RandomGenerator;
public class QuarkMixingRevised extends ConsoleProgram {
// input data from http://pdg.lbl.gov/2012/reviews/rpp2012-rev-ckm-matrix.pdf
private static final double //average
v11 = 0.97425, //Vud
v12 = 0.2252, //Vus
s13 = 0.00415, //the magnitude for Vub
d13 = 1.20, //the delta angle
v21 = -0.230, //Vcd
v22 = 1.006, //Vcs
v32 = -0.0429, //Vts
v33 = 0.89;//Vtd
private static final double //standard deviation
b11 =0.00022, //Vud
b12 = 0.0009, //Vus
bs13 = 0.00049, //Vub
bd13 = 0.08, //the delta angle
b21 = 0.011, //Vcd
b22 = 0.023,//Vcs
b32 = 0.0026,//Vts
b33 = 0.07; //Vtd
//private instance variables
private RandomGenerator rgen = RandomGenerator.getInstance();//random generator
private double V11, V12, V22, V21, V32, V33;
private double normAve31, normStd31, normAve23, normStd23;
private Complex V13 = new Complex();
// run the tests and display the results
public void run() {
while(true){
int testN = readInt("Please enter the sample size: ");
println("The test based on 5th force is done for a random gaussian sample of size " + testN+".");
println();
computeAVE(testN); // compute the average of |Vtb|, |Vcb| and |Vtd|
computeSTD(testN); // compute the standard deviation of |Vtb|, |Vcb| and |Vtd|
output(); // display the results
println("End of the tests.");
println();
}
}
// compute the average
private void computeAVE(int testN){
double normSum31 = 0, normSum23 =0;
long j = 0;
while(j < testN){
RandomData();//taking a sample
normSum23 += Math.abs(VV23());
normSum31 += VV31().getNorm();
j++;
}
normAve23 = normSum23/testN; // the average of |Vcb|
normAve31 = normSum31/testN; // the average of |Vtd|
}
//compute the standard deviation
private void computeSTD(int testN){
double normSq31 = 0, normSq23 = 0;
long j = 0;
while(j < testN){
RandomData(); //taking a sample
normSq23 += Math.pow(Math.abs(VV23()) - normAve23, 2);
normSq31 += Math.pow(VV31().getNorm() - normAve31, 2);
j++;
}
normStd23 = Math.sqrt(normSq23/testN); // the std Dev of |Vcb|
normStd31 = Math.sqrt(normSq31/testN); // the std Dev of |Vtd|
}
//Gaussian data sample
private void RandomData(){
double re = GaussianRandom(s13, bs13)*Math.cos(GaussianRandom(d13, bd13));
double im = - GaussianRandom(s13, bs13)*Math.sin(GaussianRandom(d13, bd13));
V11 = GaussianRandom(v11, b11); V12 = GaussianRandom(v12, b12); V13 = new Complex(re, im);
V21 = GaussianRandom(v21, b21); V22 = GaussianRandom(v22, b22);
V32 = GaussianRandom(v32, b32); V33 = GaussianRandom(v33, b33);
}
//formulae for Vcb
private double VV23(){
V32 = V33*V32;//V32 is rescaled because we should not take Vtb =1
return V32*(V22*V12 - V21*V11)/(V12 *(V22+V33));
}
//formulae for Vtd
private Complex VV31(){
V32 = V33*V32; //V32 is rescaled because we should not take Vtb =1
Complex v = new Complex(V22*V12*V32/(V11*(V22+V33) - V12*VV23()*V33)/(V11*V11), 0);
Complex c = new Complex(V33/V11, 0);
c = c.mul(V13);
c=c.getConjugate();
c=c.add(v);
return c;
}
//print out the results
private void output(){
println("The norm of Vcb is " + String.format("%8s", Round(normAve23)) + " \u00B1 " + String.format("%8s", Round(normStd23)));
println("The norm of Vtd is " + String.format("%8s", Round(normAve31)) + " \u00B1 " + String.format("%8s", Round(normStd31)));
println();
}
//round up a double to 7 decimal place
private double Round(double r){
int decimalPlace = 7;
BigDecimal bd = new BigDecimal(r);
bd = bd.setScale(decimalPlace,BigDecimal.ROUND_UP);
return bd.doubleValue();
}
//taking a Gaussian random number in a normal distribution with average ave and standard deviation std
private double GaussianRandom(double ave, double std){
return rgen.nextGaussian() * std + ave;
}
}