Beispiel #1
0
 private void RatesButton_Click(object sender, EventArgs e)
 {
     if (openFileDialog2.ShowDialog() == DialogResult.OK)
     {
         int numFiles = openFileDialog2.FileNames.Length;
         for (int i = 0; i < numFiles; i++)
         {
             //string msg = "";
             //string latex = "";
             textBox1.Text += "Loading file " + openFileDialog2.FileNames[i] + "\r\n";
             JOS.Multiplet EmiMult = new JOS.Multiplet();
             EmiMult.GetOmegas(exp);
             EmiMult.LoadEmiFromFile(openFileDialog2.FileNames[i]);
             EmiMult.CalculateRates();
             EmiMult.DumpEmidata(out string msg);
             textBox1.Text += msg;
             EmiMult.ReportRates(out msg, out string latex);
             textBox1.Text += msg + "\r\n";
             textBox2.Text += latex + "\r\n";
             Console.WriteLine(msg);
         }
         string uniq = DateTime.Now.ToString("yyyyMMddHHmmss");
         System.IO.File.WriteAllText("emi" + uniq + exp.absofilename + ".log", textBox1.Text);
     }
 }
Beispiel #2
0
        static void Main(string[] args)
        {
            Console.WriteLine(Globals.qe.ToString("g4", System.Globalization.CultureInfo.InvariantCulture));
            JOS.Solver testowy = new JOS.Solver();
            testowy.dumpVersion();
            Console.WriteLine(testowy.f(0.1, 0.1, 0.1, 450e-7, 1.85, 9, 1e-20, 1e-20, 1e-20).ToString("g4", System.Globalization.CultureInfo.InvariantCulture));
            JOS.Multiplet exp = new JOS.Multiplet();
            //
            exp.o2 = 1.0e-20;
            exp.o4 = 1.1e-20;
            exp.o6 = 1.2e-20;
            exp.LoadFromFile(@"r:\testszarp.txt");
            //Console.WriteLine( testowy.chi2(exp));
            //MathNet.Numerics.LinearAlgebra.Matrix<double> Hess ;
            //MathNet.Numerics.LinearAlgebra.Matrix<double> Grad;
            //testowy.CalculateHessian(exp, out Hess,out Grad);
            //Console.Write(Hess.ToString());
            string msg, lat;

            msg = "";
            testowy.FitLM(exp, out msg, out lat);
            //Console.WriteLine(msg);
            exp.CalculateRates();
            exp.ReportRates(out msg);
            //Console.WriteLine(exp.o2);
            Console.WriteLine("Report");
            Console.WriteLine(msg);
        }
Beispiel #3
0
        public void Fit_Works()
        {
            string s1, s2;

            JOS.Solver    tests = new JOS.Solver();
            JOS.Multiplet testm = new JOS.Multiplet();
            testm.u2          = new System.Collections.Generic.List <double>();
            testm.u4          = new System.Collections.Generic.List <double>();
            testm.u6          = new System.Collections.Generic.List <double>();
            testm.fexp        = new System.Collections.Generic.List <double>();
            testm.lambda0     = new System.Collections.Generic.List <double>();
            testm.n           = 1.95;
            testm.TwoJPlusOne = 13;
            testm.u2.Add(0.001); testm.u2.Add(0.002); testm.u2.Add(0.004); testm.u2.Add(0.301);
            testm.u4.Add(0.001); testm.u4.Add(0.343); testm.u4.Add(0.054); testm.u4.Add(0.101);
            testm.u6.Add(0.001); testm.u6.Add(0.212); testm.u6.Add(0.404); testm.u6.Add(0.501);
            testm.fexp.Add(1e-6); testm.fexp.Add(3.56e-6); testm.fexp.Add(2.34e-6); testm.fexp.Add(0.34e-6);
            testm.lambda0.Add(345e-7); testm.lambda0.Add(645e-7); testm.lambda0.Add(349e-7); testm.lambda0.Add(475e-7);
            tests.FitLM(testm, out s1, out s2);
            double testchi2 = tests.Chi2(testm);

            Assert.IsTrue((testchi2 < 1e-7), "Słaba zbieżność");
        }
Beispiel #4
0
 public Form1()
 {
     InitializeComponent();
     exp    = new JOS.Multiplet();
     solver = new JOS.Solver();
 }