Changeset 197:a6bbc4b54fb8
- Timestamp:
- Feb 2, 2011, 8:04:15 PM (14 years ago)
- Branch:
- default
- Phase:
- public
- Location:
- source
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
source/class/pf/Application.js
r184 r197 103 103 { 104 104 var e = ev.getTarget(); 105 var M_i = parseInt(e.getValue());105 var M_i = e.getNumValue(); 106 106 107 107 if (isFinite(M_i)) { … … 114 114 { 115 115 var e = ev.getTarget(); 116 var M_r = parseInt(e.getValue());116 var M_r = e.getNumValue(); 117 117 118 118 if (isFinite(M_r)) { … … 423 423 this.gui_T_i.setNumValue(this.plasma.i.getT()); 424 424 this.gui_Z_i.setValue(this.plasma.i.getQ()); 425 this.gui_M_i.set Value(this.plasma.i.getM());425 this.gui_M_i.setNumValue(this.plasma.i.getM()); 426 426 427 427 this.gui_P_r.setValue(100*this.plasma.P_r); … … 431 431 this.gui_Z_r.setValue(this.plasma.r.getQ()); 432 432 this.gui_Zcore.setValue((this.plasma.r.getQ() + 1) + ''); 433 this.gui_M_r.set Value(this.plasma.r.getM());433 this.gui_M_r.setNumValue(this.plasma.r.getM()); 434 434 435 435 this.gui_B.setNumValue(this.plasma.B); … … 818 818 fr.add(gl); 819 819 820 var l, e; 820 var l, e, au_fn, au_fT; 821 822 au_fn = pf.base.Bohr.n0; 823 au_fT = pf.base.Bohr.E0; 821 824 822 825 // N_e … … 824 827 l.setRich(true); 825 828 gl.add(l, {row: 0, column: 0}); 826 e = new pf.ui.TextField(this.plasma.e.getN() );829 e = new pf.ui.TextField(this.plasma.e.getN(), au_fn); 827 830 gl.add(e, {row: 0, column: 1}); 828 831 e.addListener("changeValue", changeN_e, this); … … 833 836 l.setRich(true); 834 837 gl.add(l, {row: 1, column: 0}); 835 e = new pf.ui.TextField(this.plasma.e.getT() );838 e = new pf.ui.TextField(this.plasma.e.getT(), au_fT); 836 839 gl.add(e, {row: 1, column: 1}); 837 840 e.addListener("changeValue", changeT_e, this); … … 864 867 l.setRich(true); 865 868 gl.add(l, {row: 1, column: 0}); 866 e = new qx.ui.form.Spinner(1, this.plasma.i.getM(), 200);869 e = new pf.ui.TextField(this.plasma.i.getM(), 1/pf.base.Bohr.m_p); 867 870 gl.add(e, {row: 1, column: 1}); 868 871 e.addListener("changeValue", changeM_i, this); … … 873 876 l.setRich(true); 874 877 gl.add(l, {row: 2, column: 0}); 875 e = new pf.ui.TextField(this.plasma.i.getT() );878 e = new pf.ui.TextField(this.plasma.i.getT(), au_fT); 876 879 gl.add(e, {row: 2, column: 1}); 877 880 e.addListener("changeValue", changeT_i, this); … … 882 885 l.setRich(true); 883 886 gl.add(l, {row: 3, column: 0}); 884 e = new pf.ui.TextField(this.plasma.i.getN() );887 e = new pf.ui.TextField(this.plasma.i.getN(), au_fn); 885 888 gl.add(e, {row: 3, column: 1}); 886 889 e.setReadOnly(true); … … 913 916 l.setRich(true); 914 917 gl.add(l, {row: 1, column: 0}); 915 e = new qx.ui.form.Spinner(1, this.plasma.r.getM(), 200);918 e = new pf.ui.TextField(this.plasma.r.getM(), 1/pf.base.Bohr.m_p); 916 919 gl.add(e, {row: 1, column: 1}); 917 920 e.addListener("changeValue", changeM_r, this); … … 922 925 l.setRich(true); 923 926 gl.add(l, {row: 2, column: 0}); 924 e = new pf.ui.TextField(this.plasma.r.getT() );927 e = new pf.ui.TextField(this.plasma.r.getT(), au_fT); 925 928 gl.add(e, {row: 2, column: 1}); 926 929 e.addListener("changeValue", changeT_r, this); … … 940 943 l.setRich(true); 941 944 gl.add(l, {row: 4, column: 0}); 942 e = new pf.ui.TextField(this.plasma.r.getN() );945 e = new pf.ui.TextField(this.plasma.r.getN(), au_fn); 943 946 e.setReadOnly(true); 944 947 gl.add(e, {row: 4, column: 1}); … … 963 966 l.setRich(true); 964 967 gl.add(l, {row: 0, column: 0}); 965 e = new pf.ui.TextField(this.plasma.B );968 e = new pf.ui.TextField(this.plasma.B, pf.base.Bohr.B0); 966 969 gl.add(e, {row: 0, column: 1}); 967 970 e.addListener("changeValue", changeB, this); … … 1264 1267 var scale = this.gui_compare_units.getSelectedValue(); 1265 1268 1266 var par0 ;1269 var par0, au_f; 1267 1270 var label; 1268 1271 switch (pname) { 1269 1272 case "N_e": 1270 1273 par0 = this.plasma.e.getN(); 1274 au_f = pf.base.Bohr.n0; 1271 1275 label = "N<sub>e</sub> (cm<sup>-3</sup>)" 1272 1276 break; 1273 1277 case "T": 1274 1278 par0 = this.plasma.e.getT(); 1279 au_f = pf.base.Bohr.E0; 1275 1280 label = "T (eV)" 1276 1281 break; 1277 1282 case "T_e": 1278 1283 par0 = this.plasma.e.getT(); 1284 au_f = pf.base.Bohr.E0; 1279 1285 label = "T<sub>e</sub> (eV)" 1280 1286 break; 1281 1287 case "T_i": 1282 1288 par0 = this.plasma.i.getT(); 1289 au_f = pf.base.Bohr.E0; 1283 1290 label = "T<sub>i</sub> (eV)" 1284 1291 break; 1285 1292 case "T_r": 1286 1293 par0 = this.plasma.r.getT(); 1294 au_f = pf.base.Bohr.E0; 1287 1295 label = "T<sub>r</sub> (eV)" 1288 1296 break; 1289 1297 case "T_i,r": 1290 1298 par0 = this.plasma.i.getT(); 1299 au_f = pf.base.Bohr.E0; 1291 1300 label = "T<sub>i,r</sub> (eV)" 1292 1301 break; 1293 1302 case "B": 1294 1303 par0 = this.plasma.B; 1304 au_f = pf.base.Bohr.B0; 1295 1305 label = "B (T)" 1296 1306 break; … … 1299 1309 } 1300 1310 1311 var x_au = new Array; 1301 1312 var xdata = new Array; 1302 1313 for (var j = 0; j < npoints; j++) { 1303 1314 var x = par0*(vmin + (vmax - vmin)*j/(npoints - 1)); 1304 xdata.push(x); 1315 x_au.push(x); 1316 xdata.push(au_f*x); 1305 1317 } 1306 1318 … … 1324 1336 var vname = this.getEntityFullName(entity, species); 1325 1337 1326 var set = new Array;1338 var set = new Object; 1327 1339 var ydata = new Array; 1328 1340 for (var j = 0; j < npoints; j++) { 1329 var par = x data[j];1341 var par = x_au[j]; 1330 1342 1331 1343 switch (pname) { … … 1438 1450 // Mark initial value of the varied parameter 1439 1451 canvas.setColor("#c0c0c0"); 1440 canvas.drawPolyLineW(new Array(par0 , par0),1452 canvas.drawPolyLineW(new Array(par0*au_f, par0*au_f), 1441 1453 new Array(wymin, wymax)); 1442 1454 -
source/class/pf/Plasma.js
r190 r197 13 13 B : 0, 14 14 15 get Wavenumber: function()15 getTransitionEnergy: function() 16 16 { 17 17 var n_u = this.n_u; … … 52 52 53 53 return Math.pow(Z_core, 4)* 54 (pf.base.Bohr.LymanA(n_u) + pf.base.Bohr.LymanA(n_l))/3e10/(2*Math.PI);54 (pf.base.Bohr.LymanA(n_u) + pf.base.Bohr.LymanA(n_l)); 55 55 }, 56 56 … … 58 58 { 59 59 var v = this.r.getThermalVelocity(); 60 var nu = this.get Wavenumber();61 62 return Math.sqrt(2*Math.log(2))*nu*v/ 3e10;60 var nu = this.getTransitionEnergy(); 61 62 return Math.sqrt(2*Math.log(2))*nu*v/pf.base.Bohr.c; 63 63 }, 64 64 … … 131 131 132 132 // 1.4385 is S_1 HWHM 133 var hwhm = 1.4385* 4.271417e-5*3/2*(n_u*n_u - n_l*n_l)/Z_core*ef*ppi*rpi;133 var hwhm = 1.4385*3/2*(n_u*n_u - n_l*n_l)/Z_core*ef*ppi*rpi; 134 134 135 135 // rude correction for alpha lines … … 148 148 var rpi = this.getRpiFactor(s); 149 149 150 var fwhm = this.getMicrofieldFrequency(s) /3e10/(2*Math.PI)*ppi*rpi;150 var fwhm = this.getMicrofieldFrequency(s)*ppi*rpi; 151 151 152 152 return fwhm/2; … … 191 191 getZeemanSplitting: function() 192 192 { 193 return 0.466860*this.B;193 return pf.base.Bohr.mu_B*this.B; 194 194 }, 195 195 … … 201 201 return 2*Math.sqrt(s_hwhm*s_hwhm + z_hwhm*z_hwhm + d_hwhm*d_hwhm); 202 202 }, 203 203 204 204 getBremsstrahlungLosses: function() 205 205 { 206 206 var z_i = this.i.getQ(); 207 207 var z_r = this.r.getQ(); 208 return 1.69e-32*this.e.getN()*Math.sqrt(this.e.getT())* 208 var v_e = this.e.getThermalVelocity(); 209 210 return 8*Math.PI/(3*Math.pow(pf.base.Bohr.c, 3))*v_e*this.e.getN()* 209 211 (this.i.getN()*z_i*z_i + this.r.getN()*z_r*z_r); 210 212 }, … … 212 214 getBremsstrahlungSpectralDensity: function() 213 215 { 214 var photon_e V = this.getWavenumber()/8065.5;215 return this.getBremsstrahlungLosses()/ (8065.5*this.e.getT())*216 Math.exp(-photon_e V/this.e.getT());216 var photon_en = this.getTransitionEnergy(); 217 return this.getBremsstrahlungLosses()/this.e.getT()* 218 Math.exp(-photon_en/this.e.getT()); 217 219 }, 218 220 … … 221 223 var z_i = this.i.getQ(); 222 224 var z_r = this.r.getQ(); 223 return -1.69e-32/8065.5*this.e.getN()/Math.sqrt(this.e.getT())* 225 var v_e = this.e.getThermalVelocity(); 226 227 return -8*Math.PI/(3*Math.pow(pf.base.Bohr.c, 3))*v_e*this.e.getN()* 224 228 (this.i.getN()*z_i*z_i*pf.base.Bohr.bindingEnergy(z_i, 1) + 225 this.r.getN()*z_r*z_r*pf.base.Bohr.bindingEnergy(z_r, 1)); 229 this.r.getN()*z_r*z_r*pf.base.Bohr.bindingEnergy(z_r, 1))/ 230 this.e.getT(); 226 231 }, 227 232 228 233 getFreeBoundSpectralDensity: function() 229 234 { 230 var photon_e V = this.getWavenumber()/8065.5;231 return this.getFreeBoundLosses()/ (8065.5*this.e.getT())*232 Math.exp(-photon_e V/this.e.getT());235 var photon_en = this.getTransitionEnergy(); 236 return this.getFreeBoundLosses()/this.e.getT()* 237 Math.exp(-photon_en/this.e.getT()); 233 238 }, 234 239 … … 236 241 { 237 242 var Z_core = this.r.getQ() + 1; 238 var photon_e V=239 pf.base.Bohr.transitionEnergy(Z_core, 2, 1) /8065.5;243 var photon_en = 244 pf.base.Bohr.transitionEnergy(Z_core, 2, 1); 240 245 241 246 // FIXME!! 242 var level_pop = Math.exp(-photon_e V/this.e.getT());247 var level_pop = Math.exp(-photon_en/this.e.getT()); 243 248 244 249 return level_pop*Math.pow(Z_core, 4)*pf.base.Bohr.LymanA(2)* 245 1.6022e-19*photon_eV*this.r.getN();250 photon_en*this.r.getN(); 246 251 }, 247 252 … … 255 260 getMagneticFieldPressure: function() 256 261 { 257 return 3.98e6*this.B*this.B;262 return this.B*this.B/(8*Math.PI); 258 263 }, 259 264 … … 322 327 construct: function() 323 328 { 324 // Defaults 325 this.r = new pf.base.Species("r", 1.0, 0, 0, 1.0, null); 326 this.e = new pf.base.Species("e", (1.0/1836.2), -1, 1e16, 1.0, this.r); 327 this.i = new pf.base.Species("i", 1.0, +1, 1e16, 1.0, this.r); 329 var m_p = pf.base.Bohr.m_p; 330 var V0 = pf.base.Bohr.V0; 331 var E0 = pf.base.Bohr.E0; 332 333 // Defaults: 1e16 1/cc, 1 eV 334 this.r = new pf.base.Species("r", m_p, 0, 0, 1.0/E0, null); 335 this.e = new pf.base.Species("e", 1.0, -1, 1e16*V0, 1.0/E0, this.r); 336 this.i = new pf.base.Species("i", m_p, +1, 1e16*V0, 1.0/E0, this.r); 328 337 329 338 this.P_r = 0; -
source/class/pf/UnitSelector.js
r146 r197 21 21 22 22 var selected; 23 var au_f; 23 24 24 25 switch (dimension) { 25 26 case "frequency": 26 this.addNumItem("Rad/s", 2*Math.PI); 27 selected = this.addNumItem("Hz", 1.0); 27 au_f = pf.base.Bohr.f0; 28 this.addNumItem("a.u.", 1.0); 29 this.addNumItem("Rad/s", 2*Math.PI*au_f); 30 selected = this.addNumItem("Hz", 1.0*au_f); 28 31 break; 29 32 case "length": 30 this.addNumItem("A", 1.0e8); 31 this.addNumItem("nm", 1.0e7); 32 selected = this.addNumItem("cm", 1.0); 33 this.addNumItem("m", 1.0e-2); 33 au_f = pf.base.Bohr.a0; 34 this.addNumItem("a.u.", 1.0); 35 this.addNumItem("A", 1.0e8*au_f); 36 this.addNumItem("nm", 1.0e7*au_f); 37 selected = this.addNumItem("cm", 1.0*au_f); 38 this.addNumItem("m", 1.0e-2*au_f); 34 39 break; 35 40 case "area": 36 this.addNumItem("Barn", 1.0e24); 37 selected = this.addNumItem("cm^2", 1.0); 38 this.addNumItem("m^2", 1.0e-4); 41 au_f = Math.pow(pf.base.Bohr.a0, 2); 42 this.addNumItem("a.u.", 1.0); 43 this.addNumItem("Barn", 1.0e24*au_f); 44 selected = this.addNumItem("cm^2", 1.0*au_f); 45 this.addNumItem("m^2", 1.0e-4*au_f); 39 46 break; 40 47 case "velocity": 41 selected = this.addNumItem("cm/s", 1.0); 42 this.addNumItem("m/s", 1.0e-2); 43 this.addNumItem("v/c", 1.0/3e10); 48 au_f = pf.base.Bohr.v0; 49 this.addNumItem("a.u.", 1.0); 50 selected = this.addNumItem("cm/s", 1.0*au_f); 51 this.addNumItem("m/s", 1.0e-2*au_f); 52 this.addNumItem("v/c", 1.0/3e10*au_f); 44 53 break; 45 54 case "energy": 46 selected = this.addNumItem("cm^-1", 1.0); 47 this.addNumItem("eV", 1.0/8065.5); 48 this.addNumItem("erg", 1.9864e-16); 55 au_f = pf.base.Bohr.E0; 56 this.addNumItem("a.u.", 1.0); 57 selected = this.addNumItem("cm^-1", 8065.5*au_f); 58 this.addNumItem("eV", 1.0*au_f); 59 this.addNumItem("erg", 1.6022e-12*au_f); 49 60 break; 50 61 case "pressure": 51 selected = this.addNumItem("Dyn/cm^2", 1.0); 52 this.addNumItem("Pa", 0.1); 53 this.addNumItem("Torr", 7.5006e-4); 54 this.addNumItem("bar", 1.0e-6); 55 this.addNumItem("atm", 9.8692e-7); 62 au_f = pf.base.Bohr.P0; 63 this.addNumItem("a.u.", 1.0); 64 selected = this.addNumItem("Dyn/cm^2", 1.0*au_f); 65 this.addNumItem("Pa", 0.1*au_f); 66 this.addNumItem("Torr", 7.5006e-4*au_f); 67 this.addNumItem("bar", 1.0e-6*au_f); 68 this.addNumItem("atm", 9.8692e-7*au_f); 56 69 break; 57 70 case "power_density": 58 this.addNumItem("erg/cm^3/s", 1.0e7); 59 this.addNumItem("W/m^3", 1.0e6); 60 selected = this.addNumItem("W/cm^3", 1.0); 71 au_f = pf.base.Bohr.E0/pf.base.Bohr.V0/pf.base.Bohr.t0; 72 this.addNumItem("a.u.", 1.0); 73 this.addNumItem("erg/cm^3/s", 1.6022e-12*au_f); 74 this.addNumItem("W/m^3", 1.6022e-13*au_f); 75 selected = this.addNumItem("W/cm^3", 1.6022e-19*au_f); 61 76 break; 62 77 case "spectral_power_density": 63 this.addNumItem("erg/s/cm^3/eV", 1.0e7*8065.5); 64 this.addNumItem("erg/s/cm^3/cm^-1", 1.0e7); 65 this.addNumItem("W/cm^3/eV", 8065.5); 66 selected = this.addNumItem("W/cm^3/cm^-1", 1.0); 78 au_f = 1.0/pf.base.Bohr.V0/pf.base.Bohr.t0; 79 this.addNumItem("a.u.", 1.0); 80 this.addNumItem("erg/s/cm^3/eV", 1.6022e-12*au_f); 81 this.addNumItem("W/m^3/eV", 1.6022e-13*au_f); 82 selected = this.addNumItem("W/cm^3/eV", 1.6022e-19*au_f); 83 this.addNumItem("1/s/cm^3", 1.0*au_f); 67 84 break; 68 85 case "efield": 69 this.addNumItem("V/m", 1.0e2); 70 selected = this.addNumItem("V/cm", 1.0); 71 this.addNumItem("StatV/cm", 1.0/300); 72 this.addNumItem("MV/cm", 1.0e-6); 86 au_f = pf.base.Bohr.F0; 87 this.addNumItem("a.u.", 1.0); 88 this.addNumItem("V/m", 1.0e2*au_f); 89 selected = this.addNumItem("V/cm", 1.0*au_f); 90 this.addNumItem("StatV/cm", 1.0/300*au_f); 91 this.addNumItem("MV/cm", 1.0e-6*au_f); 73 92 break; 74 93 case "none": -
source/class/pf/base/Bohr.js
r190 r197 3 3 statics : 4 4 { 5 alpha : 7.2974e-3, 5 // Fine-structure constant 6 alpha : 7.297352570e-3, 6 7 7 /* in cm^-1 */ 8 Rydberg : 1.0974e5, 8 // alpha^2 9 alpha2 : 5.325135e-05, 10 11 // Speed of light (1/alpha) 12 c : 137.036, 13 14 // Bohr magneton (alpha/2), must be in sync with B0! 15 mu_B : 3.64867635e-3, 16 17 // Proton mass 18 m_p : 1836.2, 19 20 // Hartree (eV) 21 E0 : 27.2113845, 22 // Bohr radius (cm) 23 a0 : 5.291772108e-9, 24 // Atomic unit time (s) 25 t0 : 2.418884327e-17, 26 // Atomic unit velocity (cm/s) 27 v0 : 2.1876912633e8, 28 // Electric field unit (V/cm) 29 F0 : 5.14220632e9, 30 // Magnetic field unit (T), must be in sync with mu_B! 31 B0 : 1.7152553e3, 32 // Volume unit (a0^3) 33 V0 : 1.481847e-25, 34 // Particle density unit (1/V0) 35 n0 : 6.748334e+24, 36 // Frequency unit (Hz) 37 f0 : 4.1341373e16, 38 // Pressure unit (dyne/cm^2) 39 P0 : 2.9421912e14, 9 40 10 41 bindingEnergy : function(Z_core, n) 11 42 { 12 return - this.Rydberg*Z_core*Z_core/(n*n);43 return -Z_core*Z_core/(n*n)/2; 13 44 }, 14 45 … … 21 52 fineStructureCorrection : function(Z_core, n, j) 22 53 { 23 return - this.Rydberg*Math.pow(Z_core, 4)*(this.alpha*this.alpha)/24 (n*n*n)*(1.0/(j + 0.5) - 3.0/(4*n)) ;54 return -Math.pow(Z_core, 4)*(this.alpha*this.alpha)/ 55 (n*n*n)*(1.0/(j + 0.5) - 3.0/(4*n))/2; 25 56 }, 26 57 … … 37 68 }, 38 69 39 /* Einstein A coefficient of Lyman series (1/sec)*/70 /* Einstein A coefficient of Lyman series of H */ 40 71 LymanA : function(n) 41 72 { … … 43 74 return 0; 44 75 } else { 45 return 8e9*256/9*n*Math.pow((n - 1)/(n + 1), 2*n)/((n*n - 1)*(n*n - 1)); 76 return Math.pow(this.alpha, 3)* 77 128/9*n*Math.pow((n - 1)/(n + 1), 2*n)/((n*n - 1)*(n*n - 1)); 46 78 } 47 79 } -
source/class/pf/base/Species.js
r133 r197 86 86 getDebyeLength: function() 87 87 { 88 return 7.43e2/Math.abs(this._q)*Math.sqrt(this._t/this._n); 89 }, 90 88 return Math.sqrt(this._t/(4*Math.PI*this._n))/Math.abs(this._q); 89 }, 90 91 getPlasmaFrequencyW: function() 92 { 93 return Math.abs(this._q)*Math.sqrt(4*Math.PI*this._n/this._m); 94 }, 91 95 getPlasmaFrequency: function() 92 96 { 93 return 2.10e2*Math.abs(this._q)*Math.sqrt(this._n/this._m);97 return this.getPlasmaFrequencyW()/(2*Math.PI); 94 98 }, 95 99 96 100 getInertialLength: function() 97 101 { 98 return 3e10/this.getPlasmaFrequency();102 return pf.base.Bohr.c/this.getPlasmaFrequencyW(); 99 103 }, 100 104 101 105 getThermalVelocity: function() 102 106 { 103 return 9.79e5*Math.sqrt(this._t/this._m);107 return Math.sqrt(this._t/this._m); 104 108 }, 105 109 106 110 getDeBroglieLength: function() 107 111 { 108 return 6.44e-10/Math.sqrt(this._m*this._t); 112 return pf.base.Thermo.thermalDeBroglieLength(this._m, this._t)/ 113 Math.sqrt(2*Math.PI); 109 114 }, 110 115 111 116 getMinApproachDistance: function() 112 117 { 113 return 1.44e-7*this._q*this._q/this._t;118 return this._q*this._q/this._t; 114 119 }, 115 120 … … 119 124 }, 120 125 126 getGyroFrequencyW: function(B) 127 { 128 return Math.abs(this._q)*B/this._m/pf.base.Bohr.c; 129 }, 121 130 getGyroFrequency: function(B) 122 131 { 123 return 1.52e7*Math.abs(this._q)/this._m*B;132 return this.getGyroFrequencyW(B)/(2*Math.PI); 124 133 }, 125 134 … … 129 138 return 0; 130 139 } else { 131 return 2.18e15*B/Math.sqrt(this._m*this._n);140 return B/Math.sqrt(4*Math.PI*this._m*this._n); 132 141 } 133 142 }, … … 135 144 getGyroRadius: function(B) 136 145 { 137 return this.getThermalVelocity()/ 138 (2*Math.PI*this.getGyroFrequency(B)); 146 return this.getThermalVelocity()/this.getGyroFrequencyW(B); 139 147 }, 140 148 … … 151 159 getHoltsmarkField: function() 152 160 { 153 return 3.751e-7*Math.abs(this._q)*Math.pow(this._n, 2/3);161 return 2*Math.PI*Math.abs(this._q)*Math.pow(this._n*4/15, 2.0/3.0); 154 162 }, 155 163 156 164 getClassicalRadius: function() 157 165 { 158 return 1.535e-16*this._q*this._q/this._m;166 return pf.base.Bohr.alpha2*this._q*this._q/this._m; 159 167 }, 160 168 … … 172 180 getCyclotronLosses: function(B) 173 181 { 174 var v_T = this.getThermalVelocity(); 175 // 1e-7 is erg -> joule 176 return 1e-7*4/3*this.getThomsonXsDiff()*B*B*v_T*v_T/3e10*this._n; 182 var w_c = this.getGyroFrequencyW(B); 183 184 return 4/3*this._q*this._q*w_c*w_c* 185 this._t/(this._m*Math.pow(pf.base.Bohr.c, 3))*this._n; 177 186 }, 178 187 179 188 getPressure: function() 180 189 { 181 return 1.602164e-12*this._n*this._t;190 return this._n*this._t; 182 191 }, 183 192 … … 185 194 { 186 195 var lambda; 196 197 var au_fT = pf.base.Bohr.E0; 198 var au_fn = pf.base.Bohr.n0; 199 var au_fm = pf.base.Bohr.m_p; 200 187 201 if (this.id == "e" && s2.id == "e") { 188 lambda = 24 - Math.log(Math.sqrt(this._n )/this._t)202 lambda = 24 - Math.log(Math.sqrt(this._n*au_fn)/(this._t*au_fT)) 189 203 } else 190 204 if (this.id != "e" && s2.id != "e") { 191 lambda = 23 - Math.log( 205 lambda = 23 - Math.log(Math.sqrt(au_fn/au_fT)/au_fT* 192 206 this._q*s2._q*(this._m + s2._m)/(this._m*s2._t + s2._m*this._t)* 193 207 Math.sqrt(this._n*this._q*this._q/this._t + s2._n*s2._q*s2._q/s2._t)); … … 205 219 206 220 if (se._t < si._q*tmm) { 207 lambda = 30 - Math.log(Math.sqrt(si._n)/Math.pow(si._t, 3/2)* 208 si._q*si._q/si._m); 221 lambda = 30 - 222 Math.log(Math.sqrt(si._n*au_fn)/Math.pow(si._t*au_fT, 3/2)* 223 si._q*si._q/(si._m/au_fm)); 209 224 } else 210 if (tmm < 10*si._q*si._q && se._t > 10*si._q*si._q) { 211 lambda = 24 - Math.log(Math.sqrt(se._n)/se._t); 225 if (tmm < 10*si._q*si._q/au_fT && se._t > 10*si._q*si._q/au_fT) { 226 lambda = 24 - 227 Math.log(Math.sqrt(se._n*au_fn)/(se._t*au_fT)); 212 228 } else 213 if (tmm < se._t && se._t < 10*si._q*si._q ) {229 if (tmm < se._t && se._t < 10*si._q*si._q/au_fT) { 214 230 lambda = 23 - 215 Math.log(Math.sqrt(se._n )*si._q/Math.pow(se._t, 3/2));231 Math.log(Math.sqrt(se._n*au_fn)*si._q/Math.pow(se._t*au_fT, 3/2)); 216 232 } else { 217 233 // no way??? -
source/class/pf/base/Thermo.js
r132 r197 5 5 thermalDeBroglieLength: function(m, T) 6 6 { 7 return 1.61e-9/Math.sqrt(m*T);7 return Math.sqrt(2*Math.PI/(m*T)); 8 8 }, 9 9 … … 15 15 } else { 16 16 var Lambda = this.thermalDeBroglieLength(m, T); 17 return 8065.5*T*Math.log(n*Math.pow(Lambda, 3));17 return T*Math.log(n*Math.pow(Lambda, 3)); 18 18 } 19 19 }, … … 22 22 fermiEnergy : function(n_e) 23 23 { 24 return 2.94128e-11*Math.pow(n_e, 2/3);24 return 0.5*Math.pow(3*Math.PI*Math.PI*n_e, 2.0/3.0); 25 25 }, 26 26 … … 63 63 64 64 if (E_F > 0.0) { 65 return E_F*this.reducedMuFD( 8065.5*T/E_F);65 return E_F*this.reducedMuFD(T/E_F); 66 66 } else { 67 67 return 0.0; -
source/entities.js
r192 r197 125 125 nspecies : 0, 126 126 section : "spectroscopy", 127 formula : "this.plasma.get Wavenumber()"127 formula : "this.plasma.getTransitionEnergy()" 128 128 }, 129 129 { … … 195 195 nspecies : 1, 196 196 section : "spectroscopy", 197 formula : "this.plasma.getMicrofieldFrequency(%s1) /3e10/(2*Math.PI)"197 formula : "this.plasma.getMicrofieldFrequency(%s1)" 198 198 }, 199 199 … … 258 258 nspecies : 0, 259 259 section : "spectroscopy", 260 formula : " 1/this.plasma.getWavenumber()"260 formula : "pf.base.Bohr.c/this.plasma.getTransitionEnergy()*(2*Math.PI)" 261 261 }, 262 262 … … 267 267 nspecies : 0, 268 268 section : "spectroscopy", 269 formula : " 3e10*this.plasma.getWavenumber()"269 formula : "this.plasma.getTransitionEnergy()/(2*Math.PI)" 270 270 }, 271 271
Note: See TracChangeset
for help on using the changeset viewer.