diff --git a/TrimSP.html b/TrimSP.html index 75af87f..a39210c 100644 --- a/TrimSP.html +++ b/TrimSP.html @@ -62,9 +62,9 @@ Projectile diff --git a/TrimSPlib.js b/TrimSPlib.js index d98d44a..33f351f 100644 --- a/TrimSPlib.js +++ b/TrimSPlib.js @@ -48,9 +48,9 @@ function Zof(Element) { var ElementsZ = { "muon":1, - "lithium-8":3, - "boron-12":5, - "magnesium-31":12, + "Li-8":3, + "B-12":5, + "Mg-31":12, "H":1, "He":2, "Li":3, @@ -152,9 +152,9 @@ function Massof(Element) { var ElementsA = { "muon":0.1134289259, - "lithium-8":8.02248624, - "boron-12":12.0143526, - "magnesium-31":30.996648, + "Li-8":8.02248624, + "B-12":12.0143526, + "Mg-31":30.996648, "H":1.00800, "He":4.00300, "Li":6.93900, @@ -351,8 +351,10 @@ function Elastof(Element) { return Elast[Element]; } -function StoppingCoefficients(Element) +function StoppingCoefficients(Element,flag) { + // flag = 1 prefer ICRU + // otherwise prefer IAEA var StoppingCoefficientsICRU = { "H":"1.25400,1.44000,242.60001,12000.00000,0.11590", "He":"1.22900,1.39700,484.50000,5873.00000,0.05225", @@ -514,9 +516,15 @@ function StoppingCoefficients(Element) "Bi": "10.25823796,12.26670424,7765.05387481,7.37274504,0.02310050" }; - // prefer using stopping coefficients derived from data in the IAEA database; - // however, if they are unavailable, return those from ICRU Report 49 - return (Element in StoppingCoefficientsIAEA) ? StoppingCoefficientsIAEA[Element] : StoppingCoefficientsICRU[Element]; + if (flag) { + console.log("ICRU"); + return StoppingCoefficientsICRU[Element]; + } else { + console.log("IAEA"); + // prefer using stopping coefficients derived from data in the IAEA database; + // however, if they are unavailable, return those from ICRU Report 49 + return (Element in StoppingCoefficientsIAEA) ? StoppingCoefficientsIAEA[Element] : StoppingCoefficientsICRU[Element]; + } } @@ -669,6 +677,7 @@ function rho_fun() } document.getElementById(rhoLi).value = density_estimate; + alert("Warning: Density for this layer is only an estimate!") } }