diff --git a/bachelorarbeit/flamegraph.svg b/bachelorarbeit/flamegraph.svg index 5a996ad..05ae0be 100644 --- a/bachelorarbeit/flamegraph.svg +++ b/bachelorarbeit/flamegraph.svg @@ -1,4 +1,4 @@ - \ No newline at end of file diff --git a/bachelorarbeit/perf.data b/bachelorarbeit/perf.data index f41c7bf..0f95457 100644 Binary files a/bachelorarbeit/perf.data and b/bachelorarbeit/perf.data differ diff --git a/bachelorarbeit/perf.data.old b/bachelorarbeit/perf.data.old deleted file mode 100644 index 2d12b9a..0000000 Binary files a/bachelorarbeit/perf.data.old and /dev/null differ diff --git a/bachelorarbeit/simpleplot.py b/bachelorarbeit/simpleplot.py index 026ec21..2d0866e 100644 --- a/bachelorarbeit/simpleplot.py +++ b/bachelorarbeit/simpleplot.py @@ -1,255 +1,133 @@ import matplotlib.pyplot as plt import numpy as np - data = [ [ - 0.2459764731981373, - 0.3959689257620598, - 0.3959732217974079, - 0.39584259817898193, - 0.39579974532044626, - 0.395794076384441, - 0.3958077264081723, - 0.39579875646712037, - 0.3958011556927499, - 0.3958033962001042, + 0.00046921958193724134, + 7.358616407326934e-5, + 8.723023031975696e-5, + 8.153727384807574e-5, + 9.090152038249144e-5, + 8.414070625384351e-5, + 8.612395652507487e-5, + 8.776483357408882e-5, + 8.703793625031153e-5, + 8.595498892316478e-5, ], [ - -0.27365268296889433, - -0.00046921958193724134, - 2.2715471051926173e-5, - -7.358616407326934e-5, - -8.723023031975696e-5, - -8.153727384807574e-5, - -9.090152038249144e-5, - -8.414070625384351e-5, - -8.612395652507487e-5, - -8.776483357408882e-5, - ], - [ - -0.2735443105544536, - -0.00028474270293821213, - 8.010969853944339e-5, - 1.778613185088318e-5, - 4.7477053195521535e-5, - 6.325645641669375e-5, - 3.616223928570861e-5, - 5.6782533604415875e-5, - 5.090395966433903e-5, - 4.564750978897081e-5, - ], - [ - -0.2735985403453548, - -0.00030936685630689187, - 0.0001020650955725344, + 0.00030936685630689187, 7.978835482247426e-5, - -3.943681093321327e-5, - -3.438668332045314e-5, - -2.0189312051055452e-5, - -2.874604966751626e-5, - -2.7004076400216626e-5, - -2.4825341293444048e-5, + 3.943681093321327e-5, + 3.438668332045314e-5, + 2.0189312051055452e-5, + 2.874604966751626e-5, + 2.700407617384215e-5, + 2.4825341293444048e-5, + 2.5628809087074877e-5, + 2.678726585980673e-5, ], [ - -0.2735978414571252, - -0.0003035764863147383, - 0.00010924132501810568, + 0.0003035764863147383, 0.00015586851063420504, - -2.4490574906943507e-5, - -1.7902688270066136e-5, + 2.4490574906943507e-5, + 1.7902688270066136e-5, 1.6650197575129866e-5, - -7.59094323854459e-6, - -3.342059771260786e-6, + 7.59094323854459e-6, + 3.342059771260786e-6, 2.8747982954158147e-6, + 5.142103307598234e-7, + 2.69394593033212e-6, ], [ - -0.2735903179661431, - -0.00031160663209994777, - 9.381673405162161e-5, + 0.00031160663209994777, 5.37083752694123e-5, - -1.5304054572173875e-5, - -9.256441461102938e-7, - -6.723313460188507e-6, + 1.5304054572173875e-5, + 9.256441461102938e-7, + 6.723313460188507e-6, 8.254317026779034e-6, - 1.4014954192731466e-6, - -2.3551311784109075e-6, + 1.4014951930096942e-6, + 2.3551311784109075e-6, + 5.980254742521396e-7, + 3.597584800507647e-6, ], [ - -0.2735913164499213, - -0.0003096809009284218, - 9.614021286852292e-5, + 0.0003096809009284218, 7.174695932898878e-5, - -1.8277500006158576e-5, - -4.939460848452093e-6, - -3.07613414929353e-6, + 1.8277500006158576e-5, + 4.939461074715545e-6, + 3.07613414929353e-6, 6.533050137313978e-6, 4.1030853825674285e-8, - -2.2538858418519325e-6, + 2.2538858418519325e-6, + 9.132272886791526e-7, + 5.169395710824531e-6, ], [ - -0.2735934576092922, - -0.0003078627597422612, - 0.00010028017311203286, + 0.0003078627597422612, 0.000106444698403374, - -2.0882908283836876e-5, - -1.088501621504534e-5, + 2.0882908283836876e-5, + 1.0885016441308792e-5, 2.1767025349062052e-5, - -3.2850608882029064e-6, - -2.3900967810464024e-6, + 3.2850613408408336e-6, + 2.3900967810464024e-6, 5.198947351736649e-6, + 2.426213355777307e-6, + 8.623114753358863e-7, ], [ - -0.27359291909954975, - -0.00030836014251955923, - 9.919773853384051e-5, + 0.00030836014251955923, 9.61302294200106e-5, - -2.0296397885921635e-5, - -9.659277290574586e-6, + 2.0296397885921635e-5, + 9.659277290574586e-6, 9.207541751266035e-6, - -2.0492995951304493e-6, - -2.5594252984761923e-6, + 2.0492995951304493e-6, + 2.5594252984761923e-6, 7.261965937477299e-7, + 3.73917648510691e-7, + 1.2425543701732877e-6, ], [ - -0.2735923872283933, - -0.0003088364016595735, - 9.815642481170173e-5, + 0.0003088364016595735, 8.721442142234359e-5, - -1.962601701765987e-5, - -8.169525936518873e-6, + 1.962601701765987e-5, + 8.169525936518873e-6, 3.1747640369950147e-6, - 5.728083307676712e-7, - -1.945445256779088e-6, - -1.066192182985759e-6, + 5.728087832945761e-7, + 1.945445256779088e-6, + 1.0661919567223066e-6, + 1.1508338138010998e-6, + 6.123502085397803e-7, + ], + [ + 0.0003086558304487008, + 9.080158735530475e-5, + 1.9872981781188237e-5, + 8.736252950058976e-6, + 6.22104723513317e-6, + 3.8569119342746205e-7, + 2.1402028302919263e-6, + 9.468634343257065e-8, + 6.590138900142151e-7, + 2.6713974365932813e-9, + ], + [ + 0.0003083751385098976, + 9.654880744447425e-5, + 2.0235402455659468e-5, + 9.544949382433998e-6, + 1.7823923909920936e-5, + 1.6227578926164554e-6, + 2.2769853512683014e-6, + 4.159153095706358e-6, + 1.8888938431160796e-6, + 5.116018929607336e-7, ], ] - -n = [ - [ - 0.2459764731981373, - 0.3959689257620598, - 0.3959732217974079, - 0.39584259817898193, - 0.39579974532044626, - 0.395794076384441, - 0.3958077264081723, - 0.39579875646712037, - 0.3958011556927499, - 0.3958033962001042, - ], - [ - -0.27365268296889433, - -0.00046921958193724134, - 2.2715471051926173e-5, - -7.358616407326934e-5, - -8.723023031975696e-5, - -8.153727384807574e-5, - -9.090152038249144e-5, - -8.414070625384351e-5, - -8.612395652507487e-5, - -8.776483357408882e-5, - ], - [ - -0.2735443105544536, - -0.00028474270293821213, - 8.010969853944339e-5, - 1.778613185088318e-5, - 4.7477053195521535e-5, - 6.325645641669375e-5, - 3.616223928570861e-5, - 5.6782533604415875e-5, - 5.090395966433903e-5, - 4.564750978897081e-5, - ], - [ - -0.2735985403453548, - -0.00030936685630689187, - 0.0001020650955725344, - 7.978835482247426e-5, - -3.943681093321327e-5, - -3.438668332045314e-5, - -2.0189312051055452e-5, - -2.874604966751626e-5, - -2.7004076400216626e-5, - -2.4825341293444048e-5, - ], - [ - -0.2735978414571252, - -0.0003035764863147383, - 0.00010924132501810568, - 0.00015586851063420504, - -2.4490574906943507e-5, - -1.7902688270066136e-5, - 1.6650197575129866e-5, - -7.59094323854459e-6, - -3.342059771260786e-6, - 2.8747982954158147e-6, - ], - [ - -0.2735903179661431, - -0.00031160663209994777, - 9.381673405162161e-5, - 5.37083752694123e-5, - -1.5304054572173875e-5, - -9.256441461102938e-7, - -6.723313460188507e-6, - 8.254317026779034e-6, - 1.4014954192731466e-6, - -2.3551311784109075e-6, - ], - [ - -0.2735913164499213, - -0.0003096809009284218, - 9.614021286852292e-5, - 7.174695932898878e-5, - -1.8277500006158576e-5, - -4.939460848452093e-6, - -3.07613414929353e-6, - 6.533050137313978e-6, - 4.1030853825674285e-8, - -2.2538858418519325e-6, - ], - [ - -0.2735934576092922, - -0.0003078627597422612, - 0.00010028017311203286, - 0.000106444698403374, - -2.0882908283836876e-5, - -1.088501621504534e-5, - 2.1767025349062052e-5, - -3.2850608882029064e-6, - -2.3900967810464024e-6, - 5.198947351736649e-6, - ], - [ - -0.27359291909954975, - -0.00030836014251955923, - 9.919773853384051e-5, - 9.61302294200106e-5, - -2.0296397885921635e-5, - -9.659277290574586e-6, - 9.207541751266035e-6, - -2.0492995951304493e-6, - -2.5594252984761923e-6, - 7.261965937477299e-7, - ], - [ - -0.2735923872283933, - -0.0003088364016595735, - 9.815642481170173e-5, - 8.721442142234359e-5, - -1.962601701765987e-5, - -8.169525936518873e-6, - 3.1747640369950147e-6, - 5.728083307676712e-7, - -1.945445256779088e-6, - -1.066192182985759e-6, - ], -] -n = [10,100,200, 500,1000,2000,5000,7500,10000,15000]; +n = [100,500,1000,2000,5000,7500,10000,15000,25000,50000]; for n_o in range(len(data)): - # plt.scatter([n_o] * len(data[n_o]), data[n_o]) - plt.plot(n, data[n_o]) + # plt.scatter([n_o] * len(data[n_o]), data[n_o], label=str(n[n_o])) + plt.plot(n, data[n_o], label=str(n[n_o])) + plt.plot +plt.legend() plt.show() diff --git a/bachelorarbeit/src/main.rs b/bachelorarbeit/src/main.rs index 3a1e918..1f04f0d 100644 --- a/bachelorarbeit/src/main.rs +++ b/bachelorarbeit/src/main.rs @@ -598,21 +598,20 @@ fn main() { // .collect(); - let accuracies = [100,500,1000,2000,5000,7500,10000,15000,25000,50000]; - let mut results = [[0.0;10];10]; - for (o,n_o) in accuracies.iter().enumerate() { - println!("{:?}", n_o); - for (p,n_p) in accuracies.iter().enumerate() { - let phi0 = calc::phi0(&mut app.calc_cache, 10000.0, *n_o, *n_p , true, true, true, true, true, false, 0.0, 0.0); - results[o][p] = phi0 / calc::delta(10000.0) - 1.0; - } - } + // let accuracies = [100,500,1000,2000,5000,7500,10000,15000,25000,50000]; + // let mut results = [[0.0;10];10]; + // for (o,n_o) in accuracies.iter().enumerate() { + // println!("{:?}", n_o); + // for (p,n_p) in accuracies.iter().enumerate() { + // let phi0 = calc::phi0(&mut app.calc_cache, 10000.0, *n_o, *n_p , true, true, true, true, true, false, 0.0, 0.0); + // results[o][p] = phi0 / calc::delta(10000.0) - 1.0; + // } + // } - println!("{:#?}", results); + // println!("{:#?}", results); - // let phi0 = calc::phi0(&mut app.calc_cache, 10000.0, 10000, 10000, true, true, true, true, true, false, 0.0, 0.0); - // let phi0 = calc::phi0(&mut app.calc_cache, 10000.0, 100000, 100000, true, true, true, true, true, false, 0.0, 0.0); - // println!("relative difference: {:e}", phi0 / calc::delta(10000.0) - 1.0); + let phi0 = calc::phi0(&mut app.calc_cache, 10000.0, 1000, 1000, true, true, true, true, true, false, 0.0, 0.0); + println!("relative difference: {:e}", phi0 / calc::delta(10000.0) - 1.0); // eframe::run_native( // "Omnes Calculator", diff --git a/ersterTest.py b/ersterTest.py index 269cc1a..8ef0021 100644 --- a/ersterTest.py +++ b/ersterTest.py @@ -23,8 +23,8 @@ lambda_0 = 0 # this is fixed by the low energy parametrization: lambda_0 = delta delta1_mid_high = 0 # again, this is fixed by the value of delta1_mid at 1.42 GeV (see later in the code) # Numerical constants -gl_n_omnes = 100 # number of points used in the Gauss Legendre Integration -gl_n_phi0 = 100 +gl_n_omnes = 10000 # number of points used in the Gauss Legendre Integration +gl_n_phi0 = 10000 gl_lookup = {} omnes_lookup = {} @@ -195,7 +195,7 @@ def phi0(s, a=0, inf = 100000, optimized = True, n = gl_n_phi0): c = np.pi / (s * np.sqrt(s_0)) * np.log(cmath.polar(omnes(s))[0]**2) if optimized == True: - integral = integral_gl_tan_reparam(phi0_integrand, s, a, inf, n, False) + integral = integral_gl_tan_reparam(phi0_integrand, s, a, inf, n, True) else: integral = integral_gl(phi0_integrand, s, a, inf, n) return -s * np.sqrt(s-s_0) / (2*np.pi) * (integral - c) @@ -269,7 +269,7 @@ ax.plot(x, y_delta, label = r"$\delta$") # print(time() - t0) t0 = time() -print(phi0(10000, n=100)) +print(phi0(10000) / delta(10000)) print(time() - t0) # ax.legend() @@ -277,4 +277,4 @@ print(time() - t0) # ax.grid(which='major', color='#A4A4A4', linewidth=1) # ax.grid(which='minor', color='#B5B5B5', linestyle=':', linewidth=0.5) # ax.minorticks_on() -# plt.show() \ No newline at end of file +# plt.show()