Esempio n. 1
0
        private void CreatePointChargeAndNucleusFieldComponentsPlotFile()
        {
            string[] titleList =
            {
                "B^1_{/Symbol f}", "E^1_z", "E^1_{/Symbol r}",
                "B^Z_{/Symbol f}", "E^Z_z", "E^Z_{/Symbol r}"
            };

            StringBuilder plotFile = new StringBuilder();

            plotFile.AppendLine("reset");
            plotFile.AppendLine("set terminal windows enhanced size 750,500 0");
            plotFile.AppendLine();
            plotFile.AppendLine("set title 'Field components of a point charge and nucleus"
                                + " with rapidity y = " + ParticleRapidity.ToString("G6")
                                + " at radial distance {/Symbol r} = " + RadialDistance_fm.ToString("G6") + " fm'");
            plotFile.AppendLine("set key maxrows 3");
            plotFile.AppendLine("set xlabel 't - z/v (fm/c)'");
            plotFile.AppendLine("set ylabel 'eE/m_{/Symbol p}^2, eB/m_{/Symbol p}^2'");
            plotFile.AppendLine();
            plotFile.AppendLine("set logscale xy 10");
            plotFile.AppendLine("set format xy '%g'");
            plotFile.AppendLine();
            ReduceNumberOfColors(plotFile, titleList.Length);
            plotFile.AppendLine();

            AppendPlotCommands(
                plotFile,
                index: 0,
                style: "lines",
                titles: titleList);

            for (int i = 0; i < titleList.Length; i++)
            {
                plotFile.AppendFormat(
                    "'' index 0 using 1:(-${0}) with lines dashtype '-' notitle,\\", i + 2);
                plotFile.AppendLine();
            }

            plotFile.AppendLine();
            plotFile.AppendLine();
            plotFile.AppendLine("set terminal windows enhanced size 750,500 1");
            plotFile.AppendLine();
            plotFile.AppendLine("set title 'Field components of a point charge and nucleus"
                                + " with rapidity y = " + ParticleRapidity.ToString("G6")
                                + " at effective time (t - z/v) = " + FixedTime.ToString("G6") + " fm/c'");
            plotFile.AppendLine("set xlabel '{/Symbol r} (fm)'");
            plotFile.AppendLine();
            plotFile.AppendLine("set xrange [:30]");
            plotFile.AppendLine();

            AppendPlotCommands(
                plotFile,
                index: 1,
                style: "lines",
                titles: titleList);

            for (int i = 0; i < titleList.Length; i++)
            {
                plotFile.AppendFormat(
                    "'' index 1 using 1:(-${0}) with lines dashtype '-' notitle,\\", i + 2);
                plotFile.AppendLine();
            }

            WritePlotFile(plotFile);
        }
Esempio n. 2
0
        private void CreatePointChargeFieldPlotFile(
            string fieldName,
            string fieldSymbol
            )
        {
            StringBuilder plotFile = new StringBuilder();

            plotFile.AppendLine("reset");
            plotFile.AppendLine("set terminal windows enhanced size 750,500 0");
            plotFile.AppendLine();
            plotFile.AppendLine("set title '" + fieldName + " of a point charge"
                                + " with rapidity y = " + ParticleRapidity.ToString("G6")
                                + " at radial distance {/Symbol r} = " + RadialDistance_fm.ToString("G6") + " fm'");
            plotFile.AppendLine("set xlabel 't - z/v (fm/c)'");
            plotFile.AppendLine("set ylabel 'e" + fieldSymbol + "/m_{/Symbol p}^2'");
            plotFile.AppendLine();
            plotFile.AppendLine("set logscale xy 10");
            plotFile.AppendLine("set format xy '%g'");
            plotFile.AppendLine();
            ReduceNumberOfColors(plotFile, EMFCalculationMethodTitleList.Length);
            plotFile.AppendLine();

            AppendPlotCommands(
                plotFile,
                index: 0,
                style: "lines",
                titles: EMFCalculationMethodTitleList);

            for (int i = 0; i < EMFCalculationMethodTitleList.Length; i++)
            {
                plotFile.AppendFormat(
                    "'' index 0 using 1:(-${0}) with lines dashtype '-' notitle,\\", i + 2);
                plotFile.AppendLine();
            }

            plotFile.AppendLine();
            plotFile.AppendLine();
            plotFile.AppendLine("set terminal windows enhanced size 750,500 1");
            plotFile.AppendLine();
            plotFile.AppendLine("set title '" + fieldName + " of a point charge"
                                + " with rapidity y = " + ParticleRapidity.ToString("G6")
                                + " at effective time (t - z/v) = " + FixedTime.ToString("G6") + " fm/c'");
            plotFile.AppendLine("set xlabel '{/Symbol r} (fm)'");
            plotFile.AppendLine();
            plotFile.AppendLine("set xrange [:30]");
            plotFile.AppendLine();

            AppendPlotCommands(
                plotFile,
                index: 1,
                style: "lines",
                titles: EMFCalculationMethodTitleList);

            for (int i = 0; i < EMFCalculationMethodTitleList.Length; i++)
            {
                plotFile.AppendFormat(
                    "'' index 1 using 1:(-${0}) with lines dashtype '-' notitle,\\", i + 2);
                plotFile.AppendLine();
            }

            WritePlotFile(plotFile);
        }