TDCRPy 2.19.2__tar.gz → 2.19.3__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (91) hide show
  1. {tdcrpy-2.19.2/TDCRPy.egg-info → tdcrpy-2.19.3}/PKG-INFO +1 -1
  2. {tdcrpy-2.19.2 → tdcrpy-2.19.3/TDCRPy.egg-info}/PKG-INFO +1 -1
  3. {tdcrpy-2.19.2 → tdcrpy-2.19.3}/setup.py +1 -1
  4. {tdcrpy-2.19.2 → tdcrpy-2.19.3}/tdcrpy/TDCRPy.py +15 -15
  5. {tdcrpy-2.19.2 → tdcrpy-2.19.3}/tdcrpy/TDCR_model_lib.py +30 -17
  6. {tdcrpy-2.19.2 → tdcrpy-2.19.3}/tdcrpy/config.toml +2 -0
  7. {tdcrpy-2.19.2 → tdcrpy-2.19.3}/tdcrpy/configDefault.toml +2 -0
  8. {tdcrpy-2.19.2 → tdcrpy-2.19.3}/LICENCE.md +0 -0
  9. {tdcrpy-2.19.2 → tdcrpy-2.19.3}/MANIFEST.in +0 -0
  10. {tdcrpy-2.19.2 → tdcrpy-2.19.3}/README.md +0 -0
  11. {tdcrpy-2.19.2 → tdcrpy-2.19.3}/TDCRPy.egg-info/SOURCES.txt +0 -0
  12. {tdcrpy-2.19.2 → tdcrpy-2.19.3}/TDCRPy.egg-info/dependency_links.txt +0 -0
  13. {tdcrpy-2.19.2 → tdcrpy-2.19.3}/TDCRPy.egg-info/requires.txt +0 -0
  14. {tdcrpy-2.19.2 → tdcrpy-2.19.3}/TDCRPy.egg-info/top_level.txt +0 -0
  15. {tdcrpy-2.19.2 → tdcrpy-2.19.3}/setup.cfg +0 -0
  16. {tdcrpy-2.19.2 → tdcrpy-2.19.3}/tdcrpy/MCNP-MATRIX/Spectra_for_analytical_model/dep_spectrum_C-14.txt +0 -0
  17. {tdcrpy-2.19.2 → tdcrpy-2.19.3}/tdcrpy/MCNP-MATRIX/Spectra_for_analytical_model/dep_spectrum_Ca-45.txt +0 -0
  18. {tdcrpy-2.19.2 → tdcrpy-2.19.3}/tdcrpy/MCNP-MATRIX/Spectra_for_analytical_model/dep_spectrum_Co-60.txt +0 -0
  19. {tdcrpy-2.19.2 → tdcrpy-2.19.3}/tdcrpy/MCNP-MATRIX/Spectra_for_analytical_model/dep_spectrum_H-3.txt +0 -0
  20. {tdcrpy-2.19.2 → tdcrpy-2.19.3}/tdcrpy/MCNP-MATRIX/Spectra_for_analytical_model/dep_spectrum_Ni-63.txt +0 -0
  21. {tdcrpy-2.19.2 → tdcrpy-2.19.3}/tdcrpy/MCNP-MATRIX/Spectra_for_analytical_model/dep_spectrum_P-32.txt +0 -0
  22. {tdcrpy-2.19.2 → tdcrpy-2.19.3}/tdcrpy/MCNP-MATRIX/Spectra_for_analytical_model/dep_spectrum_Pm-147.txt +0 -0
  23. {tdcrpy-2.19.2 → tdcrpy-2.19.3}/tdcrpy/MCNP-MATRIX/Spectra_for_analytical_model/dep_spectrum_Pu-241.txt +0 -0
  24. {tdcrpy-2.19.2 → tdcrpy-2.19.3}/tdcrpy/MCNP-MATRIX/Spectra_for_analytical_model/dep_spectrum_S-35.txt +0 -0
  25. {tdcrpy-2.19.2 → tdcrpy-2.19.3}/tdcrpy/MCNP-MATRIX/Spectra_for_analytical_model/dep_spectrum_Sr-89.txt +0 -0
  26. {tdcrpy-2.19.2 → tdcrpy-2.19.3}/tdcrpy/MCNP-MATRIX/Spectra_for_analytical_model/dep_spectrum_Sr-90.txt +0 -0
  27. {tdcrpy-2.19.2 → tdcrpy-2.19.3}/tdcrpy/MCNP-MATRIX/Spectra_for_analytical_model/dep_spectrum_Tc-99.txt +0 -0
  28. {tdcrpy-2.19.2 → tdcrpy-2.19.3}/tdcrpy/MCNP-MATRIX/Spectra_for_analytical_model/dep_spectrum_Zr-93.txt +0 -0
  29. {tdcrpy-2.19.2 → tdcrpy-2.19.3}/tdcrpy/MCNP-MATRIX/matrice/fichier/E_depose.txt +0 -0
  30. {tdcrpy-2.19.2 → tdcrpy-2.19.3}/tdcrpy/MCNP-MATRIX/matrice/fichier/matrice_10ml-beta-_1_200k.txt +0 -0
  31. {tdcrpy-2.19.2 → tdcrpy-2.19.3}/tdcrpy/MCNP-MATRIX/matrice/fichier/matrice_10ml-beta-_2000_10000k.txt +0 -0
  32. {tdcrpy-2.19.2 → tdcrpy-2.19.3}/tdcrpy/MCNP-MATRIX/matrice/fichier/matrice_10ml-beta-_200_2000k.txt +0 -0
  33. {tdcrpy-2.19.2 → tdcrpy-2.19.3}/tdcrpy/MCNP-MATRIX/matrice/fichier/matrice_10ml-photon_1_200k.txt +0 -0
  34. {tdcrpy-2.19.2 → tdcrpy-2.19.3}/tdcrpy/MCNP-MATRIX/matrice/fichier/matrice_10ml-photon_2000_10000k.txt +0 -0
  35. {tdcrpy-2.19.2 → tdcrpy-2.19.3}/tdcrpy/MCNP-MATRIX/matrice/fichier/matrice_10ml-photon_200_2000k.txt +0 -0
  36. {tdcrpy-2.19.2 → tdcrpy-2.19.3}/tdcrpy/MCNP-MATRIX/matrice/fichier/matrice_13ml-beta-_1_200k.txt +0 -0
  37. {tdcrpy-2.19.2 → tdcrpy-2.19.3}/tdcrpy/MCNP-MATRIX/matrice/fichier/matrice_13ml-beta-_2000_10000k.txt +0 -0
  38. {tdcrpy-2.19.2 → tdcrpy-2.19.3}/tdcrpy/MCNP-MATRIX/matrice/fichier/matrice_13ml-beta-_200_2000k.txt +0 -0
  39. {tdcrpy-2.19.2 → tdcrpy-2.19.3}/tdcrpy/MCNP-MATRIX/matrice/fichier/matrice_13ml-photon_1_200k.txt +0 -0
  40. {tdcrpy-2.19.2 → tdcrpy-2.19.3}/tdcrpy/MCNP-MATRIX/matrice/fichier/matrice_13ml-photon_2000_10000k.txt +0 -0
  41. {tdcrpy-2.19.2 → tdcrpy-2.19.3}/tdcrpy/MCNP-MATRIX/matrice/fichier/matrice_13ml-photon_200_2000k.txt +0 -0
  42. {tdcrpy-2.19.2 → tdcrpy-2.19.3}/tdcrpy/MCNP-MATRIX/matrice/fichier/matrice_16ml-beta-_1_200k.txt +0 -0
  43. {tdcrpy-2.19.2 → tdcrpy-2.19.3}/tdcrpy/MCNP-MATRIX/matrice/fichier/matrice_16ml-beta-_2000_10000k.txt +0 -0
  44. {tdcrpy-2.19.2 → tdcrpy-2.19.3}/tdcrpy/MCNP-MATRIX/matrice/fichier/matrice_16ml-beta-_200_2000k.txt +0 -0
  45. {tdcrpy-2.19.2 → tdcrpy-2.19.3}/tdcrpy/MCNP-MATRIX/matrice/fichier/matrice_16ml-photon_1_200k.txt +0 -0
  46. {tdcrpy-2.19.2 → tdcrpy-2.19.3}/tdcrpy/MCNP-MATRIX/matrice/fichier/matrice_16ml-photon_2000_10000k.txt +0 -0
  47. {tdcrpy-2.19.2 → tdcrpy-2.19.3}/tdcrpy/MCNP-MATRIX/matrice/fichier/matrice_16ml-photon_200_2000k.txt +0 -0
  48. {tdcrpy-2.19.2 → tdcrpy-2.19.3}/tdcrpy/Micelle/2nmfaq01.csv +0 -0
  49. {tdcrpy-2.19.2 → tdcrpy-2.19.3}/tdcrpy/Micelle/faq01.csv +0 -0
  50. {tdcrpy-2.19.2 → tdcrpy-2.19.3}/tdcrpy/Quenching/QuenchEnergyAlpha_0.015.txt +0 -0
  51. {tdcrpy-2.19.2 → tdcrpy-2.19.3}/tdcrpy/Quenching/QuenchEnergyAlpha_1.1e-05.txt +0 -0
  52. {tdcrpy-2.19.2 → tdcrpy-2.19.3}/tdcrpy/Quenching/QuenchEnergyAlpha_1.2e-05.txt +0 -0
  53. {tdcrpy-2.19.2 → tdcrpy-2.19.3}/tdcrpy/Quenching/QuenchEnergyAlpha_1.3e-05.txt +0 -0
  54. {tdcrpy-2.19.2 → tdcrpy-2.19.3}/tdcrpy/Quenching/QuenchEnergyAlpha_1.4e-05.txt +0 -0
  55. {tdcrpy-2.19.2 → tdcrpy-2.19.3}/tdcrpy/Quenching/QuenchEnergyAlpha_1.5e-05.txt +0 -0
  56. {tdcrpy-2.19.2 → tdcrpy-2.19.3}/tdcrpy/Quenching/QuenchEnergyAlpha_1e-05.txt +0 -0
  57. {tdcrpy-2.19.2 → tdcrpy-2.19.3}/tdcrpy/Quenching/QuenchEnergyAlpha_6e-06.txt +0 -0
  58. {tdcrpy-2.19.2 → tdcrpy-2.19.3}/tdcrpy/Quenching/QuenchEnergyAlpha_7e-06.txt +0 -0
  59. {tdcrpy-2.19.2 → tdcrpy-2.19.3}/tdcrpy/Quenching/QuenchEnergyAlpha_8e-06.txt +0 -0
  60. {tdcrpy-2.19.2 → tdcrpy-2.19.3}/tdcrpy/Quenching/QuenchEnergyAlpha_9e-06.txt +0 -0
  61. {tdcrpy-2.19.2 → tdcrpy-2.19.3}/tdcrpy/Quenching/QuenchEnergyElectron_0.006.txt +0 -0
  62. {tdcrpy-2.19.2 → tdcrpy-2.19.3}/tdcrpy/Quenching/QuenchEnergyElectron_0.007.txt +0 -0
  63. {tdcrpy-2.19.2 → tdcrpy-2.19.3}/tdcrpy/Quenching/QuenchEnergyElectron_0.008.txt +0 -0
  64. {tdcrpy-2.19.2 → tdcrpy-2.19.3}/tdcrpy/Quenching/QuenchEnergyElectron_0.009.txt +0 -0
  65. {tdcrpy-2.19.2 → tdcrpy-2.19.3}/tdcrpy/Quenching/QuenchEnergyElectron_0.01.txt +0 -0
  66. {tdcrpy-2.19.2 → tdcrpy-2.19.3}/tdcrpy/Quenching/QuenchEnergyElectron_0.011.txt +0 -0
  67. {tdcrpy-2.19.2 → tdcrpy-2.19.3}/tdcrpy/Quenching/QuenchEnergyElectron_0.012.txt +0 -0
  68. {tdcrpy-2.19.2 → tdcrpy-2.19.3}/tdcrpy/Quenching/QuenchEnergyElectron_0.013.txt +0 -0
  69. {tdcrpy-2.19.2 → tdcrpy-2.19.3}/tdcrpy/Quenching/QuenchEnergyElectron_0.014.txt +0 -0
  70. {tdcrpy-2.19.2 → tdcrpy-2.19.3}/tdcrpy/Quenching/QuenchEnergyElectron_0.015.txt +0 -0
  71. {tdcrpy-2.19.2 → tdcrpy-2.19.3}/tdcrpy/Quenching/TandataUG.txt +0 -0
  72. {tdcrpy-2.19.2 → tdcrpy-2.19.3}/tdcrpy/Quenching/alpha_toulene.txt +0 -0
  73. {tdcrpy-2.19.2 → tdcrpy-2.19.3}/tdcrpy/Quenching/inputVecteurAlpha.txt +0 -0
  74. {tdcrpy-2.19.2 → tdcrpy-2.19.3}/tdcrpy/Quenching/inputVecteurElectron.txt +0 -0
  75. {tdcrpy-2.19.2 → tdcrpy-2.19.3}/tdcrpy/TDCRPy1.py +0 -0
  76. {tdcrpy-2.19.2 → tdcrpy-2.19.3}/tdcrpy/TDCRoptimize.py +0 -0
  77. {tdcrpy-2.19.2 → tdcrpy-2.19.3}/tdcrpy/__init__.py +0 -0
  78. {tdcrpy-2.19.2 → tdcrpy-2.19.3}/tdcrpy/decayData/All-nuclides_BetaShape.zip +0 -0
  79. {tdcrpy-2.19.2 → tdcrpy-2.19.3}/tdcrpy/decayData/All-nuclides_Ensdf.zip +0 -0
  80. {tdcrpy-2.19.2 → tdcrpy-2.19.3}/tdcrpy/decayData/All-nuclides_PenNuc.zip +0 -0
  81. {tdcrpy-2.19.2 → tdcrpy-2.19.3}/tdcrpy/decayData/atom-ENDF-VII0.zip +0 -0
  82. {tdcrpy-2.19.2 → tdcrpy-2.19.3}/tdcrpy/decayData/photo-ENDF.zip +0 -0
  83. {tdcrpy-2.19.2 → tdcrpy-2.19.3}/tdcrpy/docs/_build/html/genindex.html +0 -0
  84. {tdcrpy-2.19.2 → tdcrpy-2.19.3}/tdcrpy/docs/_build/html/index.html +0 -0
  85. {tdcrpy-2.19.2 → tdcrpy-2.19.3}/tdcrpy/docs/_build/html/search.html +0 -0
  86. {tdcrpy-2.19.2 → tdcrpy-2.19.3}/tdcrpy/docs/_build/html/source/modules.html +0 -0
  87. {tdcrpy-2.19.2 → tdcrpy-2.19.3}/tdcrpy/docs/_build/html/source/tdcrpy.html +0 -0
  88. {tdcrpy-2.19.2 → tdcrpy-2.19.3}/tdcrpy/test/__init__.py +0 -0
  89. {tdcrpy-2.19.2 → tdcrpy-2.19.3}/tdcrpy/test/test_tdcrpy.py +0 -0
  90. {tdcrpy-2.19.2 → tdcrpy-2.19.3}/tdcrpy/test2.py +0 -0
  91. {tdcrpy-2.19.2 → tdcrpy-2.19.3}/tdcrpy/test_randomGen.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: TDCRPy
3
- Version: 2.19.2
3
+ Version: 2.19.3
4
4
  Summary: TDCR model
5
5
  Home-page: https://pypi.org/project/TDCRPy/
6
6
  Author: RomainCoulon (Romain Coulon)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: TDCRPy
3
- Version: 2.19.2
3
+ Version: 2.19.3
4
4
  Summary: TDCR model
5
5
  Home-page: https://pypi.org/project/TDCRPy/
6
6
  Author: RomainCoulon (Romain Coulon)
@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
2
2
  import codecs
3
3
  import os
4
4
 
5
- VERSION = "2.19.2"
5
+ VERSION = "2.19.3"
6
6
 
7
7
  DESCRIPTION = "TDCR model"
8
8
 
@@ -1115,12 +1115,12 @@ def eff(TD, Rad, pmf_1, kB, V, N=10000, L=1, maxiter=20, xatol=1e-7, disp=False,
1115
1115
  else: r=opt.minimize_scalar(objectFct, args=(TD[0], Rad, pmf_1, N, kB, V), method='bounded', bounds = (Lbounds[0], Lbounds[1]), options={'disp': disp, 'maxiter':maxiter})
1116
1116
  L0=r.x
1117
1117
  L=(L0, L0, L0)
1118
- print(f"global free parameter = {L0} keV-1")
1118
+ # print(f"global free parameter = {L0} keV-1")
1119
1119
 
1120
1120
  if not symm:
1121
1121
  r=opt.minimize(objectFct, L, args=(TD, Rad, pmf_1, N, kB, V), method='nelder-mead',options={'xatol': xatol, 'disp': disp, 'maxiter':maxiter})
1122
1122
  L=r.x
1123
- print(f"free parameters = {L} keV-1")
1123
+ # print(f"free parameters = {L} keV-1")
1124
1124
 
1125
1125
  if symm: out=TDCRPy(L0, Rad, pmf_1, N, kB, V, readRecHist = True)
1126
1126
  else: out=TDCRPy(L, Rad, pmf_1, N, kB, V, readRecHist = True)
@@ -1197,14 +1197,14 @@ def effA(TD, Rad, pmf_1, kB, V, L=1, maxiter=20, xatol=1e-7, disp=False, Lbounds
1197
1197
  else: r=opt.minimize_scalar(tl.modelAnalytical, args=(TD[0], TD[1], TD[2], TD[3], Rad, kB, V, "res", 1e3), method='bounded', bounds = (Lbounds[0], Lbounds[1]), options={'disp': disp, 'maxiter':maxiter})
1198
1198
  L0=r.x
1199
1199
  L=(L0, L0, L0)
1200
- print(f"global free parameter = {L0} keV-1")
1200
+ # print(f"global free parameter = {L0} keV-1")
1201
1201
  if not symm:
1202
1202
  if cerenkov:
1203
1203
  r=opt.minimize(tl.modelCerenkov, L, args=(TD[0], TD[1], TD[2], TD[3], Rad, "res"), method='nelder-mead',options={'xatol': xatol, 'disp': disp, 'maxiter':maxiter})
1204
1204
  else:
1205
1205
  r=opt.minimize(tl.modelAnalytical, L, args=(TD[0], TD[1], TD[2], TD[3], Rad, kB, V, "res", 1e3), method='nelder-mead',options={'xatol': xatol, 'disp': disp, 'maxiter':maxiter})
1206
1206
  L=r.x
1207
- print(f"free parameters = {L} keV-1")
1207
+ # print(f"free parameters = {L} keV-1")
1208
1208
 
1209
1209
  if cerenkov:
1210
1210
  if symm: out=tl.modelCerenkov(L, TD, TD, TD, TD, Rad, "eff")
@@ -1290,25 +1290,25 @@ def effA(TD, Rad, pmf_1, kB, V, L=1, maxiter=20, xatol=1e-7, disp=False, Lbounds
1290
1290
 
1291
1291
  # L = 0.1
1292
1292
  # # L = (1.1, 1.05, 1.15)
1293
- # # TD = 0.977667386529166
1294
- # # TD = (0.9767359812638453, 0.9925429293804757, 0.991829757077315, 0.9919970813639295) # source 1
1295
- # # TD = (0.9768862920127371, 0.9928478299182348, 0.9912531441227223, 0.9924249578285456) # source 2
1296
- # # TD = (0.9769014488454436, 0.9918130431206161, 0.9920156754198314, 0.9927119011073454) # source 3
1297
- # TD = (0.9764032345164899, 0.9928417189012709, 0.9911455450383777, 0.9920402844839974) # source 4
1293
+ # TD = 0.977667386529166
1294
+ # # # TD = (0.9767359812638453, 0.9925429293804757, 0.991829757077315, 0.9919970813639295) # source 1
1295
+ # # # TD = (0.9768862920127371, 0.9928478299182348, 0.9912531441227223, 0.9924249578285456) # source 2
1296
+ # # # TD = (0.9769014488454436, 0.9918130431206161, 0.9920156754198314, 0.9927119011073454) # source 3
1297
+ # # TD = (0.9764032345164899, 0.9928417189012709, 0.9911455450383777, 0.9920402844839974) # source 4
1298
1298
  # Rad="Tc-99"
1299
1299
  # pmf_1="1"
1300
1300
  # N = 10000
1301
1301
  # kB =1.4e-5
1302
1302
  # V = 16
1303
1303
  # mode = "eff"
1304
- # tl.modifyMicCorr(True)
1304
+ # # tl.modifyMicCorr(True)
1305
1305
 
1306
- # out = TDCRPy(L, Rad, "1", N, kB, V, "eff", barp=True)
1306
+ # # out = TDCRPy(L, Rad, "1", N, kB, V, "eff", barp=False)
1307
1307
 
1308
- # # # out = TDCRPy(L, Rad, pmf_1, N, kB, V, Display = False, record = True, readRecHist = False)
1309
- # # # print("result", out)
1310
- # # # out = TDCRPy(L, Rad, pmf_1, N, kB, V, Display = False, record = False, readRecHist = True)
1311
- # # # print("result", out)
1308
+ # # # # out = TDCRPy(L, Rad, pmf_1, N, kB, V, Display = False, record = True, readRecHist = False)
1309
+ # # # # print("result", out)
1310
+ # # # # out = TDCRPy(L, Rad, pmf_1, N, kB, V, Display = False, record = False, readRecHist = True)
1311
+ # # # # print("result", out)
1312
1312
 
1313
1313
  # outS = eff(TD, Rad, pmf_1, kB, V, N=10000, L=1, maxiter=20, xatol=1e-7)
1314
1314
  # outA = effA(TD, Rad, pmf_1, kB, V, L=1, maxiter=20, xatol=1e-7)
@@ -396,6 +396,8 @@ def readParameters(disp=False):
396
396
  solvantType = inputs.get("solvantType", fallback="Water")
397
397
  solvantConc = inputs.getfloat("solvantConc_mol_L", fallback=0.0)
398
398
 
399
+ sigma_micelle = inputs.getfloat("sigma_micelle", fallback=0.0)
400
+
399
401
  effQuantic0 = inputs.get("effQuantum")
400
402
  effQuantic = []
401
403
  if effQuantic0:
@@ -427,7 +429,7 @@ def readParameters(disp=False):
427
429
  print(f"\t P={pP:.4f}, S={pS:.4f}, Na={pNa:.4f}, Cl={pCl:.4f}")
428
430
  if micCorr:
429
431
  print("\tMicelle correction activated")
430
- print(f"\tDensity = {diam_micelle} nm")
432
+ print(f"\tMicelle diameter = {diam_micelle} nm (Sigma = {sigma_micelle} nm)")
431
433
  else:
432
434
  print("\tMicelle correction not activated")
433
435
 
@@ -445,10 +447,10 @@ def readParameters(disp=False):
445
447
  return (nE_electron, nE_alpha, RHO, Z, A, depthSpline, Einterp_a, Einterp_e,
446
448
  diam_micelle, fAq, tau, extDT, measTime, micCorr, effQuantic,
447
449
  optionModel, diffP, PMTspace, pH, pC, pN, pO, pP, pS, pNa, pCl,
448
- solvantType, solvantConc, sp_model, chou_param)
450
+ solvantType, solvantConc, sp_model, chou_param, sigma_micelle)
449
451
 
450
452
  # --- MODIFY FUNCTIONS ---
451
-
453
+ def modifySigma_micelle(x): update_config_value("sigma_micelle", x)
452
454
  def modifynE_electron(x): update_config_value("nE_electron", x)
453
455
  def modifynE_alpha(x): update_config_value("nE_alpha", x)
454
456
  def modifysp_model(x): update_config_value("sp_model", x)
@@ -544,7 +546,8 @@ def resetConfFile():
544
546
  # Read current parameters
545
547
  (nE_electron, nE_alpha, RHO, Z, A, depthSpline, Einterp_a, Einterp_e,
546
548
  diam_micelle, fAq, tau, extDT, measTime, micCorr, effQuantic,
547
- optionModel, diffP, PMTspace, pH, pC, pN, pO, pP, pS, pNa, pCl, solvantType, solvantConc, sp_model, chou_param) = readParameters()
549
+ optionModel, diffP, PMTspace, pH, pC, pN, pO, pP, pS, pNa, pCl,
550
+ solvantType, solvantConc, sp_model, chou_param, sigma_micelle) = readParameters()
548
551
 
549
552
  # Calculate normalized atomic array (if needed for legacy code)
550
553
  p_atom = np.array([pH, pC, pN, pO, pP, pS, pNa, pCl])
@@ -1786,7 +1789,7 @@ def micelleLoss(E,*, fAq=fAq, diam_micelle=diam_micelle, e_vec=micelle_E, data=m
1786
1789
 
1787
1790
  # New Micelle Treatment
1788
1791
 
1789
- # 1. JIT-compiled helper functions (fastmath=True allows C-level float optimizations)
1792
+ # 1. JIT-compiled helper functions
1790
1793
  @njit(fastmath=True)
1791
1794
  def calc_range_numba(E_keV):
1792
1795
  if E_keV <= 0.0: return 0.0
@@ -1797,14 +1800,25 @@ def calc_energy_numba(R_nm):
1797
1800
  if R_nm <= 0.0: return 0.0
1798
1801
  return (R_nm / 40.0) ** (1.0 / 1.75)
1799
1802
 
1803
+ @njit(fastmath=True)
1804
+ def get_micelle_radius(r_mean, r_sigma):
1805
+ """ Échantillonnage avec rejet (loi normale tronquée) """
1806
+ if r_sigma <= 0.0:
1807
+ return r_mean
1808
+ r = -1.0
1809
+ while r <= 0.0:
1810
+ r = np.random.normal(r_mean, r_sigma)
1811
+ return r
1812
+
1800
1813
  # 2. The Core Monte Carlo Kernel compiled to machine code
1801
- # Using parallel=True and prange allows multi-threading across your CPU cores
1802
1814
  @njit(fastmath=True, parallel=True)
1803
- def _mc_kernel(E0_keV, r_d_nm, f_w, is_hydrophilic, num_samples):
1815
+ def _mc_kernel(E0_keV, r_d_nm, sigma_micelle, f_w, is_hydrophilic, num_samples):
1804
1816
  E_deposited_act = np.zeros(num_samples)
1817
+
1818
+ # Le libre parcours moyen inter-micellaire repose sur le diamètre de Sauter,
1819
+ # approximé ici par le rayon arithmétique moyen pour le modèle macroscopique.
1805
1820
  lambda_act = (4.0 / 3.0) * r_d_nm * (1.0 - f_w) / f_w
1806
1821
 
1807
- # prange distributes the particle histories across available CPU threads
1808
1822
  for i in prange(num_samples):
1809
1823
  R = calc_range_numba(E0_keV)
1810
1824
  if R <= 0.0:
@@ -1816,13 +1830,13 @@ def _mc_kernel(E0_keV, r_d_nm, f_w, is_hydrophilic, num_samples):
1816
1830
  # ETAPE 1 : Positionnement initial
1817
1831
  # ---------------------------------------------------------
1818
1832
  if is_hydrophilic:
1819
- # Native random generation inside Numba is extremely fast
1833
+ current_r = get_micelle_radius(r_d_nm, sigma_micelle)
1820
1834
  u1 = np.random.rand()
1821
- r_pos = r_d_nm * (u1 ** (1.0 / 3.0))
1835
+ r_pos = current_r * (u1 ** (1.0 / 3.0))
1822
1836
  cos_theta = np.random.uniform(-1.0, 1.0)
1823
1837
 
1824
1838
  b = 2.0 * r_pos * cos_theta
1825
- c = (r_pos ** 2) - (r_d_nm ** 2)
1839
+ c = (r_pos ** 2) - (current_r ** 2)
1826
1840
  delta = max((b ** 2) - (4.0 * c), 0.0)
1827
1841
  d_esc = (-b + np.sqrt(delta)) / 2.0
1828
1842
 
@@ -1840,7 +1854,9 @@ def _mc_kernel(E0_keV, r_d_nm, f_w, is_hydrophilic, num_samples):
1840
1854
  if phase_is_active:
1841
1855
  d_step = -lambda_act * np.log(u_rand)
1842
1856
  else:
1843
- d_step = 2.0 * r_d_nm * np.sqrt(u_rand)
1857
+ # Tirage d'une nouvelle taille de micelle à chaque rencontre
1858
+ current_r = get_micelle_radius(r_d_nm, sigma_micelle)
1859
+ d_step = 2.0 * current_r * np.sqrt(u_rand)
1844
1860
 
1845
1861
  actual_dist = min(d_step, R)
1846
1862
 
@@ -1857,7 +1873,7 @@ def _mc_kernel(E0_keV, r_d_nm, f_w, is_hydrophilic, num_samples):
1857
1873
  return E_deposited_act
1858
1874
 
1859
1875
  # 3. The Python Wrapper for TDCRPy
1860
- def pure_mc_efficient_energy_numba(E, *, r_d_nm=diam_micelle, f_w=fAq, tracer_type="hydrophilic", num_samples=1):
1876
+ def pure_mc_efficient_energy_numba(E, *, r_d_nm=diam_micelle, sigma_r=sigma_micelle, f_w=fAq, tracer_type="hydrophilic", num_samples=1):
1861
1877
  """
1862
1878
  E in keV
1863
1879
  """
@@ -1885,10 +1901,7 @@ def pure_mc_efficient_energy_numba(E, *, r_d_nm=diam_micelle, f_w=fAq, tracer_ty
1885
1901
 
1886
1902
  is_hydro = (tracer_type == "hydrophilic")
1887
1903
 
1888
- # Call the JIT compiled kernel
1889
- # Note: The first execution will take ~1 second as it compiles to C.
1890
- # All subsequent calls will be nearly instantaneous.
1891
- E_deposited_act = _mc_kernel(float(E), float(r_d_nm), float(f_w), is_hydro, int(num_samples))
1904
+ E_deposited_act = _mc_kernel(float(E), float(r_d_nm), float(sigma_r), float(f_w), is_hydro, int(num_samples))
1892
1905
 
1893
1906
  if num_samples==1:
1894
1907
  return E_deposited_act[0]
@@ -61,6 +61,8 @@ pCl = 0.000071
61
61
  micCorr = False
62
62
  # diameter of the micelles in nm (possible values: 0.5, 1.0, 2.0, 3.0, 4.0)
63
63
  diam_micelle = 2
64
+ # standard deviation of the micelles diameters
65
+ sigma_micelle = 1
64
66
  # acqueous fraction of the scintillator
65
67
  fAq = 0.1
66
68
 
@@ -61,6 +61,8 @@ pCl = 0.000071
61
61
  micCorr = False
62
62
  # diameter of the micelles in nm (possible values: 0.5, 1.0, 2.0, 3.0, 4.0)
63
63
  diam_micelle = 2
64
+ # standard deviation of the micelles diameters
65
+ sigma_micelle = 1
64
66
  # acqueous fraction of the scintillator
65
67
  fAq = 0.1
66
68
 
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes