//--------------------------------------------------------------------------------------- // Global constatns var h2_mn = 41.80158761,// hbar^2/amu [MeV fm**2] hbar = 6.5821188926,// 10^(-22) MeV sec lightspeed = 299792458, // 10^(15) fm/sec mp = 938.27199838,// proton mass (MeV) mn = 939.56533038,// neutron mass (MeV) mN = 938.9186644, // (mp+mn)/2 (MeV) amu = 931.494028, // atomic mass unit (MeV) h_mn = 7.010318511, // h/mN/c^2 (10^(-23) sec) e2 = 1.4399764, // MeV*fm hc = 197.3269602, // MeV*fm small_add = 1.e-6, zerro = 1.e-13, radTodeg = 57.2957795130823208767982, degTorad = 0.01745329251994329576924, M_E = 2.71828182845904523536029, M_PI = 3.14159265358979323846264, M_1_PI = 0.31830988618379067153777, M_2_PI = 0.63661977236758134307554, M_SQRT_PI = 1.77245385090551602729817, M_1_SQRT_PI = 0.56418958354775628694808, M_SQRT_2 = 1.41421356237309504880169; //--------------------------------------------------------------------------------------- function delManySpaces(s) { s=s.trim(); s=s.replace(new RegExp(" ",'g')," "); s=s.replace(new RegExp(" ",'g')," "); s=s.replace(new RegExp(" ",'g')," "); s=s.replace(new RegExp(" ",'g')," "); return(s); } //--------------------------------------------------------------------------------------- function sleep(milliseconds) { var start = new Date().getTime(); for (var i = 0; i < 1e7; i++) { if ((new Date().getTime() - start) > milliseconds){ break; } } } //--------------------------------------------------------------------------------------- function get_levels(z,a,func) { $.get("../common/get_levels.php",{ z: z,a: a}) .done(function(data){ eval(func+"('"+data.replace(new RegExp("\n","g"),"\\n")+"')");}); } //--------------------------------------------------------------------------------------- // Massives with nuclear names and decay modes function NUCLEI() { this.Items=181; this.Name=new Array('n','H','He','Li','Be','B','C','N','O','F','Ne','Na','Mg','Al','Si','P','S','Cl','Ar','K','Ca','Sc','Ti','V','Cr','Mn','Fe','Co','Ni','Cu','Zn','Ga','Ge','As','Se','Br','Kr','Rb','Sr','Y','Zr','Nb','Mo','Tc','Ru','Rh','Pd','Ag','Cd','In','Sn','Sb','Te','I','Xe','Cs','Ba','La','Ce','Pr','Nd','Pm','Sm','Eu','Gd','Tb','Dy','Ho','Er','Tm','Yb','Lu','Hf','Ta','W','Re','Os','Ir','Pt','Au','Hg','Tl','Pb','Bi','Po','At','Rn','Fr','Ra','Ac','Th','Pa','U','Np','Pu','Am','Cm','Bk','Cf','Es','Fm','Md','No','Lr','Rf','Db','Sg','Bh','Hs','Mt','Ds','Rg','Cn','Nh','Fl','Mc','Lv','Ts','Og','119','120','121','122','123','124','125','126','127','128','129','130','131','132','133','134','135','136','137','138','139','140','141','142','143','144','145','146','147','148','149','150','151','152','153','154','155','156','157','158','159','160','161','162','163','164','165','166','167','168','169','170','171','172','173','174','175','176','177','178','179','180'); this.Title=new Array('Neutron','Hydrogen','Helium','Lithium','Beryllium','Borom','Carbon','Nitrogen','Oxygen','Fluorine','Neon','Sodium','Magnesium','Aluminium','Silicon','Phosphorus','Sulfur','Chlorine','Argon','Potassium','Calcium','Scandium','Titanium','Vanadium','Chromium','Manganese','Iron','Cobalt','Nickel','Copper','Zinc','Gallium','Germanium','Arsenic','Selenium','Bromine','Krypton','Rubidium','Strontium','Yttrium','Zirkonium','Niobium','Molybdenum','Technetium','Ruthenium','Rhodium','Palladium','Silver','Cadmium','Indium','Tin','Antimony','Tellurium','Iodine','Xenon','Cesium','Barium','Lanthanum','Cerium','Praseodymium','Neodymium','Promethium','Samarium','Europium','Gadolinium','Terbium','Dysposium','Holmium','Erbium','Thulium','Ytterbium','Lutetium','Hafnium','Tantalum','Tungsten','Rhenium','Osmium','Iridium','Platinum','Gold','Mercury','Thallium','Lead','Bismuth','Polonium','Astatine','Radon','Francium','Radium','Actinium','Thorium','Protactinium','Uranium','Neptunium','Plutonium','Americium','Curium','Berkelium','Californium','Einsteinium','Fermium','Mendelevium','Nobelium','Lawrencium','Rutherfordium','Dubnium','Seaborgium','Bohrium','Hassium','Meitnerium','Darmstadium','Roentgenium','Copernicium','Nihonium','Flerovium','Moscovium','Livermorium','Tennessine','Oganesson','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','',''); this.DecModeStart=new Array('1','1','3','4','5','7','8','10','12','14','16','18','20','21','22','24','26','28','30','32','34','36','38','40','42','44','45','48','50','52','54','56','58','60','65','67','69','71','73','77','79','81','83','85','87','89','91','94','96','98','100','103','106','108','110','112','114','117','119','121','126','128','130','132','136','138','140','142','144','146','148','150','154','156','158','160','162','165','168','171','175','177','181','185','190','193','196','200','203','207','210','213','218','225','228','231','233','235','237','240','242','245','249','251','253','255','258','260','263','265','267','272','272','272','272','272','272','272','272','272','272','272','272','272','272','272','272','272','272','272','0','272','272','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0'); this.DecModes=new Array('0','00277_','0072727a','66002272_','_9310222_2','636002222_2_2','9333002222222_2','_6330022222222_','9333000222222__','_663302222222___','93330002222______','_633302222222222__','333300022222______','_333330222222______','333333000222222______','____33302222222________','___333000202222_________','____33303022222_________','___33303020222222_______','____333030222222222_____','___3330300020202222_____','____3333302222222_______','___3333300000222________','____3_3333302222________','___33_33030002222_______','______3333302222222_____','____3__330300022222______','_____33333302222222______','______330300020222_2_________','______3333303022222_2________','______3333030002022222222_2__','______33333330202222222222___','______333333030002022222222__','_______333333330222222222222__','____333330300020202222222___','____3333333303022222222222__','___333333030300020222222222__','____3333333333022222222222222___','____33333330300022222222222_____','__3333333333022222222222______','__33333333300020202222222_____','___3_33333330222222222_2______','_____333303000002022222222_____','_____333333332222222222222_____','_____33330300000202222222222____','_____33333333303222222222222_____','____333333303000202022222222_____','__3333333333303022222222222222____','__3_33333303030002020222222222_____','____3333333333303222222222222222222__','____3_33333303000000020202222222222___','______333333333333020222222222222____','_1131333333333030300020202222222_____','__111__333333333332032222222222222___','__13_3333333330303000002020222222222__','__1_33333333333333333032222222222222____','_____3_3_33333330303000002222222222_____','_________33333333333330222222222_______','_________33333333030302022222222_______','___________33333333303222222222__2_____','________3333333300100202022_22______','____3_3_3333333331322222222_________','____3_3333333303111002020222________','____3__3333333333330302222222_______','____33333333131313000002022_______','__33__3333333333333330222222______','__3_333_3313331303030000022222____','______333313333333333330222222____','____33331133333333030300020222____','__333_31111_3333333333303222222___','____3_111333333333330300000202222_','____31111___3333333333333022222222_','___111111___3333333313000002222__','____111_3_333333333333330022222__','__1_11111_3_333333333303000202222','__1_1_____333_3333333333303222222','_____11111333333333333031000020222_','____1_1111111333333333333303022222_','____111111133333333333130300020222_','______11111333333333333333022222_2_','__1111111333333333333030000020222_','__1____113333333333333333302022222','____13333333_333333333313000222222','____11111333_333333333330211222_','__111111111333333311111111111','___111111113131313111111111____','___11111111111111111111111122222_','__11111111111111111111222222222__','___1111111111111111111212222_2__','__111111111111111112222222____','___111111111111111111212222__','___11____11111133212222222__','________111113111112122__','__441333333212222___','____131313111212122_','_4_4__33331212222__','_____33131111111242_','________333313222___','__1111111131111124__','___1311133331111__','_1411111131111414_','___11113_31111__','__111111141___','__11111111___','__1_14141___','__1__1111__','_________','________','_______','_______','_______','_','_','_','_','_','_','_','_','_','_','_','_','_','_','_','_','_','_','_','','_','_','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','',''); this.GetInfo=function(n) { alert(this.Name[n]+" "+this.Title[n]); } this.MakeSelect=function(z1,z2) { res=""; for (i=z1;i<=z2;i++) res=res+""; return(res); } this.AfromZ=function(z) { if (z<=92) a=Math.round(2*z+6.38e-3*z*z); else a=Math.round(126.15+0.3630*z+9.270e-3*z*z); if (a==0) a=1; return(a); } this.getElemByZ=function(z) { return(this.Name[z]); } this.getZbyElem=function(elem) { for (i=0;i=this.Items)) return("unknown"); if (1*a1*this.DecModeStart[z]+s.length) return("unknown"); switch (this.DecModes[z].charAt(a-this.DecModeStart[z])) { case "0" : res="stable"; break; case "1" : res="alpha"; break; case "2" : res="b_minus"; break; case "3" : res="b_plus"; break; case "4" : res="div"; break; case "5" : res="izo"; break; case "6" : res="p"; break; case "7" : res="n"; break; case "8" : res="t"; break; case "9" : res="2p"; break; case "a" : res="2n"; break; case "_" : res="unknown"; break; } return(res); } } var Nuclei=new NUCLEI(); //--------------------------------------------------------------------------------------- // Обработка для списка (2014-12-17) //--------------------------------------------------------------------------------------- function List2() { this.Name=""; this.SLength=0; this.makeElement=function(name,title,units,lengths,align,sizes,onchange,tooltip,popup_menu) { // Генерация строки элемента var s; this.Name=name; LENGTHS=lengths.split(','); SIZES=sizes.split(','); ALIGN=align.split(','); if (tooltip!='') tooltip="title='"+tooltip+"'"; if (popup_menu!='') popup_menu=" class='"+popup_menu+"'"; s="" +""+title+"" +" " +" " +""+units+"" +""; document.getElementById(name).outerHTML=s; this.SLength=SIZES[1]; } this.updateList=function(data) { // Начальные значения $("#ID_"+this.Name).empty(); var arr=data.split('\n'); for (i=0;i'+arr[i].substring(0,this.SLength)+'')); } } this.updateList2=function(values,data) { // Начальные значения $("#ID_"+this.Name).empty(); var arr1=values.split('\n'); var arr2=data.split('\n'); for (i=0;i'+arr2[i].substring(0,this.SLength)+'')); } } this.setValue=function(value) { $("#ID_"+this.Name+" [value='"+value+"']").prop("selected", "selected"); // Устанавливаем выделение } this.getValue=function() { return($("#ID_"+this.Name+" option:selected").val()); } this.getIndex=function() { return($("#ID_"+this.Name)[0].selectedIndex); } this.setIndex=function(value) { $("#ID_"+this.Name)[0].selectedIndex=value; } this.Spin=function() { this.updateList("0\n1/2\n1\n3/2\n2\n5/2\n3\n7/2\n4\n9/2\n5\n11/2\n6\n13/2\n7\n15/2\n8\n17/2\n9\n19/2"); } this.Parity=function() { this.updateList("+1\n-1"); } this.disable=function() { $("#ID_"+this.Name).attr("disabled","disabled"); $("#ID_"+this.Name).className="state_disabled"; } this.enable=function() { $("#ID_"+this.Name).removeAttr("disabled"); $("#ID_"+this.Name).className="state_enable"; } } //--------------------------------------------------------------------------------------- // Обработка для радио переключателя (2014-12-17) //--------------------------------------------------------------------------------------- function Radio2() { this.Name=""; this.Items=0; this.makeElement=function(name,title,strings,values,lengths,type,onchange,tooltip,popup_menu) { // Генерация строки элемента var s; this.Name=name; STRINGS=strings.split(','); VALUES=values.split(','); LENGTHS=lengths.split(','); this.Items=VALUES.length; if (tooltip!='') tooltip="title='"+tooltip+"'"; if (popup_menu!='') popup_menu=" class='"+popup_menu+"'"; if (type=="HORIZONTAL") { s=""+title+""; for (i=1;i<=this.Items;i++) { s=s+"" +" "+STRINGS[i-1]+" "; } s=s+""; } else { s="
"+title+"
"; for (i=1;i<=this.Items;i++) { s=s+" "+STRINGS[i-1]+"
"; } } document.getElementById(name).outerHTML=s; } this.setValue=function(value) { for (i=1;i<=this.Items;i++) { if ($("#ID_"+this.Name+(i)).val()==value) //$("#ID_"+this.Name+(i)).attr('checked', 'checked'); $("#ID_"+this.Name+(i)).prop('checked', 'checked'); } } this.setText=function(num,value) { $("#ID_"+this.Name+"_TEXT_"+(num)).html(value); } this.getValue=function() { for (i=1;i<=this.Items;i++) { if ($("#ID_"+this.Name+(i)).prop("checked")) return($("#ID_"+this.Name+(i)).val()); } } this.disable=function() { for (i=1;i<=this.Items;i++) $("#ID_"+this.Name+i).attr("disabled","disabled"); } this.enable=function() { for (i=1;i<=this.Items;i++) $("#ID_"+this.Name+i).removeAttr("disabled"); } } //--------------------------------------------------------------------------------------- // Обработка для текстового поля (2014-12-18) //--------------------------------------------------------------------------------------- function Number2() { this.Name=""; this.makeElement=function(name,title,units,lengths,aligns,sizes,onchange,tooltip,popup_menu) { // Генерация строки элемента var s; this.Name=name; ALIGNS=aligns.split(','); SIZES=sizes.split(','); LENGTHS=lengths.split(','); if (tooltip!='') tooltip="title='"+tooltip+"'"; if (popup_menu!='') popup_menu=" class='"+popup_menu+"'"; s=""+title+"" +"" +" " +""+units+""; document.getElementById(name).outerHTML=s; } this.setValue=function(value) { $("#ID_"+this.Name).val(value); } this.setTitle=function(value) { $("#ID_"+this.Name+"_TITLE").html(value); } this.getValue=function() { return($("#ID_"+this.Name).val()); } this.disable=function() { $("#ID_"+this.Name).attr("disabled","true"); } this.enable=function() { $("#ID_"+this.Name).removeAttr("disabled"); } } //--------------------------------------------------------------------------------------- // Обработка для флажка (2014-12-18) //--------------------------------------------------------------------------------------- function CheckBox2() { this.Name=""; this.makeElement=function(name,title,length,onchange,tooltip,popup_menu) { // Генерация строки элемента var s; this.Name=name; if (tooltip!='') tooltip="title='"+tooltip+"'"; if (popup_menu!='') popup_menu=" class='"+popup_menu+"'"; s=" "+title+""; document.getElementById(name).outerHTML=s; } this.setValue=function(value) { if ((value==true)||(value=="true")) value=true; else value=false; $("#ID_"+this.Name).prop("checked",value); } this.getValue=function() { return($("#ID_"+this.Name).prop("checked")); } this.disable=function() { $("#ID_"+this.Name).attr("disabled","disabled"); } this.enable=function() { $("#ID_"+this.Name).removeAttr( "disabled" ); } } //--------------------------------------------------------------------------------------- // Обработка для ядра (2014-12-19) //--------------------------------------------------------------------------------------- function Nucleus2() { this.Z_min=0; this.Z_max=118; this.A_min=1; this.A_max=300; this.Name=""; this.Mode=""; this.setLimits=function(z_min,z_max,a_min,a_max) { // Границы изменения значений this.Z_min=z_min; this.Z_max=z_max; this.A_min=a_min; this.A_max=a_max; } this.changeZ=function() { // Изменилось Z var z,a; z=document.getElementById("ID_"+this.Name+"_Z"); a=document.getElementById("ID_"+this.Name+"_A"); if (1*z.valuethis.Z_max) z.selectedIndex=z.selectedIndex+1*this.Z_max-z.value; a.value=Nuclei.AfromZ(z.value); this.drawMode(); if (this.Mode!="nuc") this.checkR(); } this.changeA=function() { // Изменилось A var z,a; z=document.getElementById("ID_"+this.Name+"_Z"); a=document.getElementById("ID_"+this.Name+"_A"); if (isNaN(a.value)) a.value=Nuclei.AfromZ(z.value); if (1*a.value>this.A_max) a.value=this.A_max; if (1*a.valuethis.A_max) obj.value=this.A_max; this.drawMode(); if (this.Mode!="nuc") this.checkR(); } this.decA=function() { // Изменилось A var z,a; z=document.getElementById("ID_"+this.Name+"_Z"); a=document.getElementById("ID_"+this.Name+"_A"); a.value=a.value-1; if (1*a.value20) r.value=20; if (this.Mode.indexOf("R")!=-1) R.value=Math.round(1000*r.value*Math.pow(a.value,1./3.))/1000; } this.checkRR=function() { var a,r,R; if (this.Mode.indexOf("R")==-1) return; a=document.getElementById("ID_"+this.Name+"_A"); r=document.getElementById("ID_"+this.Name+"_R"); R=document.getElementById("ID_"+this.Name+"_RR"); if (isNaN(R.value)) R.value=2; else if (r.value=="") R.value2; if (1*R.value<0.1) R.value=0.1; if (1*R.value>20) R.value=20; if (this.Mode.indexOf("r")!=-1) r.value=Math.round(1000*R.value/Math.pow(a.value,1./3.))/1000; } this.checkE=function() { var E; if (this.Mode.indexOf("E")==-1) return; E=document.getElementById("ID_"+this.Name+"_E"); if (isNaN(E.value)) E.value=0; else if (E.value=="") E.value=0; if (1*E.value<0.1) E.value=0; if (1*E.value>100) E.value=100; } this.makeElement=function(name,mode,title,lengths,values,onchange,tooltip,popup_menu) { // Генерация строки элемента var s,l,c,i,i1; this.Name=name; this.Mode=mode; l=this.Mode.length; VALUES=values.split(','); this.Z_min=VALUES[0]; this.Z_max=VALUES[1]; this.A_min=VALUES[2]; this.A_max=VALUES[3]; LENGTHS=lengths.split(','); ONCHANGE=onchange.split('\n'); TOOLTIP=tooltip.split('\n'); if (popup_menu!='') popup_menu=" class='"+popup_menu+"'"; s=""; // Цикл по элементам for (i=0;i"+title+"" +" \n" +"" +"" +""; } if (c=="S") { s=s+"Spin " +" "; } if (c=="P") { s=s+"π " +" "; } if (c=="r") { s=s+"r0 " +" fm "; } if (c=="R") { s=s+"R " +" fm "; } if (c=="E") { s=s+"E* " +" MeV "; } } s=s+""; s=s+""; document.getElementById(name).outerHTML=s; } this.getNucleusInfo=function() { window.open("../map/nucleus.php?q="+Nuclei.getElemByZ(document.getElementById("ID_"+this.Name+"_Z").value)+document.getElementById("ID_"+this.Name+"_A").value,"_blank"); } this.drawMode=function() { // Рисуем моду распада var z,a,mode; z=document.getElementById("ID_"+this.Name+"_Z"); a=document.getElementById("ID_"+this.Name+"_A"); mode=Nuclei.DecayMode(z.value,a.value); var canvas=document.getElementById("ID_"+this.Name+"_DMODE"); var context=canvas.getContext('2d'); switch (mode) { case "unknown": context.fillStyle="rgb(134,134,134)"; break; case "stable": context.fillStyle="rgb(0,0,0)"; break; case "alpha": context.fillStyle="rgb(255,255,51)"; break; case "b_minus": context.fillStyle="rgb(0,102,204)"; break; case "b_plus": context.fillStyle="rgb(255,51,0)"; break; case "div": context.fillStyle="rgb(0,153,0)"; break; case "izo": context.fillStyle="rgb(255,255,255)"; break; case "p": context.fillStyle="rgb(255,204,51)"; break; case "n": context.fillStyle="rgb(255,102,255)"; break; case "t": context.fillStyle="rgb(102,204,102)"; break; case "2p": context.fillStyle="rgb(153,102,0)"; break; case "2n": context.fillStyle="rgb(153,0,153)"; break; } context.fillRect(0,0,12,12); if (this.Mode.indexOf("S")!=-1) this.checkSpin(); // Заодно проверка спина } this.checkSpin=function() { var a,s1,s2,k; a=this.getA(); if (a%2==0) s1=0; else s1=1; k=this.getSpinIndex(); if (k%2==0) s2=0; else s2=1; if (s1==s2) {} // Всё соответствует else if (s1==0) this.setSpinIndex(k-1); // Спин нечётный, а должен быть чётным else { if (document.getElementById("ID_"+this.Name+"_S").options.length%2==0) this.setSpinIndex(k+1); else this.setSpinIndex(k-1); } // Спин чётный, а должен быть нечётным } this.set=function(z,a) { if (this.Mode.indexOf("N")!=-1) { setIndexByVal("ID_"+this.Name+"_Z",z); document.getElementById("ID_"+this.Name+"_A").value=a; } this.drawMode(); } this.defaultValues=function() { if (this.Mode.indexOf("N")!=-1) { setIndexByVal("ID_"+this.Name+"_Z",8); document.getElementById("ID_"+this.Name+"_A").value=16; this.drawMode(); } if (this.Mode.indexOf("r")!=-1) { this.checkR(); } if (this.Mode.indexOf("R")!=-1) { this.checkRR(); } if (this.Mode.indexOf("E")!=-1) { this.checkE(); } } this.setZ=function(value) { $("#ID_"+this.Name+"_Z [value='"+value+"']").prop("selected", "selected"); this.drawMode(); } this.getZ=function() { return($("#ID_"+this.Name+"_Z option:selected").val()); } this.getElem=function() { return($("#ID_"+this.Name+"_Z option:selected").text()); } this.setA=function(value) { $("#ID_"+this.Name+"_A").val(value); this.drawMode(); } this.getA=function() { return($("#ID_"+this.Name+"_A").val()); } this.setSpin=function(value) { $("#ID_"+this.Name+"_S [value='"+value+"']").prop("selected", "selected"); // Устанавливаем выделение } this.getSpin=function() { return($("#ID_"+this.Name+"_S option:selected").val()); } this.setSpinIndex=function(value) { document.getElementById("ID_"+this.Name+"_S").selectedIndex=value; } this.getSpinIndex=function() { return(document.getElementById("ID_"+this.Name+"_S").selectedIndex); } this.setParity=function(value) { $("#ID_"+this.Name+"_P [value='"+value+"']").prop("selected", "selected"); // Устанавливаем выделение } this.getParity=function() { return($("#ID_"+this.Name+"_P option:selected").val()); } this.setE=function(value) { $("#ID_"+this.Name+"_E").val(value); } this.getE=function() { return($("#ID_"+this.Name+"_E").val()); } this.setR=function(value) { $("#ID_"+this.Name+"_R").val(value); } this.getR=function() { return($("#ID_"+this.Name+"_R").val()); } this.setRR=function(value) { $("#ID_"+this.Name+"_RR").val(value); } this.getRR=function() { return($("#ID_"+this.Name+"_RR").val()); } this.disable=function() { var i,c; // Цикл по элементам for (i=0;ithis.E_max) E.value=this.E_max; } this.makeElement=function(name,title,lengths,limits,onchange,tooltip,popup_menu) { // Генерация строки элемента var s; this.Name=name; LENGTHS=lengths.split(','); ONCHANGE=onchange.split('\n'); if (popup_menu!='') popup_menu=" class='"+popup_menu+"'"; TOOLTIP=tooltip.split('\n'); for (i=0;i"+title+"" +" E MeV " +" System " +""; document.getElementById(name).outerHTML=s; } this.defaultValues=function() { // Начальные значения this.setE(5); this.setSystem("cm"); } this.getE=function() { return($("#ID_"+this.Name+"_E").val()); } this.setE=function(value) { $("#ID_"+this.Name+"_E").val(value); } this.getSystem=function() { return($("#ID_"+this.Name+"_SYS").val()); } this.setSystem=function(value) { $("#ID_"+this.Name+"_SYS [value='"+value+"']").prop("selected", "selected"); // Устанавливаем выделение } this.disable=function() { $("#ID_"+this.Name+"_E").attr("disabled","disabled"); $("#ID_"+this.Name+"_SYS").attr("disabled","disabled"); } this.enable=function() { $("#ID_"+this.Name+"_E").removeAttr("disabled"); $("#ID_"+this.Name+"_SYS").removeAttr("disabled"); } } //--------------------------------------------------------------------------------------- // Обработка для диапазона энергий (2014-12-14) //--------------------------------------------------------------------------------------- function Energy_Range2() { this.E_min=0.01; this.E_max=1000; this.N_min=2; this.N_max=300; this.Name=""; this.setLimits=function(e_min,e_max,n_min,n_max) { // Границы изменения значений this.E_min=e_min; this.E_max=e_max; this.N_min=n_min; this.N_max=n_max; } this.changeEmin=function() { // Изменилось Emin var Emin,Emax; Emin=document.getElementById("ID_"+this.Name+"_E_MIN"); Emax=document.getElementById("ID_"+this.Name+"_E_MAX"); if (isNaN(Emin.value)) Emin.value=this.E_min; else if (Emin.value=="") Emin.value=this.E_min; if (1*Emin.valuethis.E_max) Emin.value=this.E_max; if (1*Emax.valuethis.E_max) Emax.value=this.E_max; if (1*Emax.valuethis.N_max) N.value=this.N_max; } this.makeElement=function(name,title,lengths,limits,onchange,tooltip,popup_menu) { // Генерация строки элемента var s; this.Name=name; LENGTHS=lengths.split(','); ONCHANGE=onchange.split('\n'); if (popup_menu!='') popup_menu=" class='"+popup_menu+"'"; TOOLTIP=tooltip.split('\n'); for (i=0;i"+title+"" +" Min MeV " +" Max MeV " +" Points " +" System " +""; document.getElementById(name).outerHTML=s; } this.defaultValues=function() { // Начальные значения this.setEmin("0.05"); this.setEmax("30."); this.setN(50); this.setSystem("lab"); } this.getEmin=function() { return($("#ID_"+this.Name+"_E_MIN").val()); } this.setEmin=function(value) { $("#ID_"+this.Name+"_E_MIN").val(value); } this.getEmax=function() { return($("#ID_"+this.Name+"_E_MAX").val()); } this.setEmax=function(value) { $("#ID_"+this.Name+"_E_MAX").val(value); } this.getN=function() { return($("#ID_"+this.Name+"_E_N").val()); } this.setN=function(value) { $("#ID_"+this.Name+"_N").val(value); } this.getSystem=function() { return($("#ID_"+this.Name+"_SYS").val()); } this.setSystem=function(value) { $("#ID_"+this.Name+"_SYS [value='"+value+"']").prop("selected", "selected"); // Устанавливаем выделение } this.disable=function() { $("#ID_"+this.Name+"_E_MIN").attr("disabled","disabled"); $("#ID_"+this.Name+"_E_MAX").attr("disabled","disabled"); $("#ID_"+this.Name+"_N").attr("disabled","disabled"); $("#ID_"+this.Name+"_SYS").attr("disabled","disabled"); } this.enable=function() { $("#ID_"+this.Name+"_E_MIN").removeAttr("disabled"); $("#ID_"+this.Name+"_E_MAX").removeAttr("disabled"); $("#ID_"+this.Name+"_N").removeAttr("disabled"); $("#ID_"+this.Name+"_SYS").removeAttr("disabled"); } } //--------------------------------------------------------------------------------------- // Потенциал (2014-12-24) //--------------------------------------------------------------------------------------- function Potential2() { this.Name=""; this.Mode=""; this.change_Vol_V=function() { var V; V=document.getElementById("ID_"+this.Name+"_VOL_V"); if (isNaN(V.value)) V.value=-1; else if (V.value=="") V.value=-1; if (1*V.value<-800) V.value=-800; if (1*V.value>800) V.value=800; } this.change_Vol_R=function() { var V; V=document.getElementById("ID_"+this.Name+"_VOL_R"); if (isNaN(V.value)) V.value=1; else if (V.value=="") V.value=1; if (1*V.value<0.01) V.value=0.01; if (1*V.value>3) V.value=3; } this.change_Vol_A=function() { var V; V=document.getElementById("ID_"+this.Name+"_VOL_A"); if (isNaN(V.value)) V.value=0.5; else if (V.value=="") V.value=0.5; if (1*V.value<0.01) V.value=0.01; if (1*V.value>2) V.value=2; } this.change_Surf_V=function() { var V; V=document.getElementById("ID_"+this.Name+"_SURF_V"); if (isNaN(V.value)) V.value=-1; else if (V.value=="") V.value=-1; if (1*V.value<-800) V.value=-800; if (1*V.value>800) V.value=800; } this.change_Surf_R=function() { var V; V=document.getElementById("ID_"+this.Name+"_SURF_R"); if (isNaN(V.value)) V.value=1; else if (V.value=="") V.value=1; if (1*V.value<0.01) V.value=0.01; if (1*V.value>3) V.value=3; } this.change_Surf_A=function() { var V; V=document.getElementById("ID_"+this.Name+"_SURF_A"); if (isNaN(V.value)) V.value=0.5; else if (V.value=="") V.value=0.5; if (1*V.value<0.01) V.value=0.01; if (1*V.value>2) V.value=2; } this.change_Sup_Vol_V=function() { var V; V=document.getElementById("ID_"+this.Name+"_SUP_VOL_V"); if (isNaN(V.value)) V.value=-1; else if (V.value=="") V.value=-1; if (1*V.value<-800) V.value=-800; if (1*V.value>800) V.value=800; } this.change_Sup_Vol_R=function() { var V; V=document.getElementById("ID_"+this.Name+"_SUP_VOL_R"); if (isNaN(V.value)) V.value=1; else if (V.value=="") V.value=1; if (1*V.value<0.01) V.value=0.01; if (1*V.value>3) V.value=3; } this.change_Sup_Vol_A=function() { var V; V=document.getElementById("ID_"+this.Name+"_SUP_VOL_A"); if (isNaN(V.value)) V.value=0.5; else if (V.value=="") V.value=0.5; if (1*V.value<0.01) V.value=0.01; if (1*V.value>2) V.value=2; } this.change_Sup_Surf_V=function() { var V; V=document.getElementById("ID_"+this.Name+"_SUP_SURF_V"); if (isNaN(V.value)) V.value=-1; else if (V.value=="") V.value=-1; if (1*V.value<-800) V.value=-800; if (1*V.value>800) V.value=800; } this.change_Sup_Surf_R=function() { var V; V=document.getElementById("ID_"+this.Name+"_SUP_SURF_R"); if (isNaN(V.value)) V.value=1; else if (V.value=="") V.value=1; if (1*V.value<0.01) V.value=0.01; if (1*V.value>3) V.value=3; } this.change_Sup_Surf_A=function() { var V; V=document.getElementById("ID_"+this.Name+"_SUP_SURF_A"); if (isNaN(V.value)) V.value=0.5; else if (V.value=="") V.value=0.5; if (1*V.value<0.01) V.value=0.01; if (1*V.value>2) V.value=2; } this.change_Fold_N_Re=function() { var V; V=document.getElementById("ID_"+this.Name+"_FOLD_N_RE"); if (isNaN(V.value)) V.value=1; else if (V.value=="") V.value=1; if (1*V.value<0.01) V.value=0.01; if (1*V.value>10) V.value=10; } this.change_Fold_N_Im=function() { var V; V=document.getElementById("ID_"+this.Name+"_FOLD_N_IM"); if (isNaN(V.value)) V.value=1; else if (V.value=="") V.value=1; if (1*V.value<0.01) V.value=0.01; if (1*V.value>10) V.value=10; } this.change_Prox_B=function() { var V; V=document.getElementById("ID_"+this.Name+"_PROX_B"); if (isNaN(V.value)) V.value=1; else if (V.value=="") V.value=1; if (1*V.value<0.1) V.value=0.1; if (1*V.value>3) V.value=3; } this.change_Gaus_V=function() { var V; V=document.getElementById("ID_"+this.Name+"_GAUS_V"); if (isNaN(V.value)) V.value=1; else if (V.value=="") V.value=1; if (1*V.value<0.1) V.value=0.1; if (1*V.value>3) V.value=3; } this.change_Gaus_R=function() { var V; V=document.getElementById("ID_"+this.Name+"_GAUS_R"); if (isNaN(V.value)) V.value=1; else if (V.value=="") V.value=1; if (1*V.value<0.1) V.value=0.1; if (1*V.value>3) V.value=3; } this.change_SO_V=function() { var V; V=document.getElementById("ID_"+this.Name+"_SO_V"); if (isNaN(V.value)) V.value=1; else if (V.value=="") V.value=1; if (1*V.value<-100) V.value=-100; if (1*V.value>100) V.value=100; } this.change_SO_W=function() { var V; V=document.getElementById("ID_"+this.Name+"_SO_W"); if (isNaN(V.value)) V.value=1; else if (V.value=="") V.value=1; if (1*V.value<-100) V.value=-100; if (1*V.value>100) V.value=100; } this.change_SO_R=function() { var V; V=document.getElementById("ID_"+this.Name+"_SO_R"); if (isNaN(V.value)) V.value=1; else if (V.value=="") V.value=1; if (1*V.value<0.01) V.value=0.01; if (1*V.value>5) V.value=5; } this.change_SO_A=function() { var V; V=document.getElementById("ID_"+this.Name+"_SO_A"); if (isNaN(V.value)) V.value=0.5; else if (V.value=="") V.value=0.5; if (1*V.value<0.01) V.value=0.01; if (1*V.value>2) V.value=2; } this.makeElement=function(name,mode,onchange,popup_menu) { // Генерация строки элемента var s; this.Name=name; this.Mode=mode; s="
\n\n"; if (popup_menu!='') popup_menu=" class='"+popup_menu+"'"; if (this.Mode.indexOf("V")!=-1) s=s+"
\n" +"" +"" +"" +"" +"
V0 MeVr0 fma fm
" +"
\n"; if (this.Mode.indexOf("S")!=-1) s=s+"
\n" +"" +"" +"" +"" +"
VD MeVrD fmaD fm
" +"
\n"; if (this.Mode.indexOf("U")!=-1) s=s+"
\n" +"" +"" +"" +"" +"" +"" +"" +"" +"
V0 MeVr0 fma fm
VD MeVrD fmaD fm
" +"
\n"; if (this.Mode.indexOf("F")!=-1) s=s+"
\n" +"" +"" +"" +"" +"
NReNIm 
" +"
\n"; if (this.Mode.indexOf("P")!=-1) s=s+"
\n" +"" +"" +"" +"" +"
 b fm 
" +"
\n"; if (this.Mode.indexOf("G")!=-1) s=s+"
\n" +"" +"" +"" +"" +"
V0 MeVr fm 
" +"
\n"; if (this.Mode.indexOf("O")!=-1) s=s+"
\n" +"" +"" +"" +"" +"" +"" +"" +"" +"
Vso MeVrso fmaso fm
Wso MeV  
" +"
\n"; s=s+"
\n"; document.getElementById(name).outerHTML=s; $("#ID_TAB_"+name).tabs(); } this.defaultValues=function() { // Начальные значения } this.getPotType=function() { var active=$("#ID_TAB_"+this.Name).tabs("option","active"); var s; if (this.Mode.substr(active,1)=="V") s="volume"; if (this.Mode.substr(active,1)=="S") s="surface"; if (this.Mode.substr(active,1)=="U") s="superposition"; if (this.Mode.substr(active,1)=="F") s="folding"; if (this.Mode.substr(active,1)=="P") s="proximity"; if (this.Mode.substr(active,1)=="G") s="gaussian"; if (this.Mode.substr(active,1)=="O") s="spin-orbit"; //alert(s); return(s); } this.setPotType=function(potname) { var n; if (potname=="volume") n=this.Mode.indexOf("V"); if (potname=="surface") n=this.Mode.indexOf("S"); if (potname=="superposition") n=this.Mode.indexOf("U"); if (potname=="folding") n=this.Mode.indexOf("F"); if (potname=="proximity") n=this.Mode.indexOf("P"); if (potname=="gaussian") n=this.Mode.indexOf("G"); if (potname=="spin-orbit") n=this.Mode.indexOf("O"); $("#ID_TAB_"+this.Name).tabs("option","active",n); } this.getValue=function(param) { return($("#ID_"+this.Name+param).val()); } this.setValue=function(param,value) { $("#ID_"+this.Name+param).val(value); } } //--------------------------------------------------------------------------------------- // Fresco Потенциал (2015-10-04) //--------------------------------------------------------------------------------------- function F_Potential2() { this.Name=""; this.Mode=""; this.Potentials=0; this.Type=new Array(); this.Shape=new Array(); this.V0=new Array(); this.r0=new Array(); this.a=new Array(); this.change_Type=function(n) { this.Type[n]=document.getElementById("ID_"+this.Name+"_L"+n+"_TYPE").selectedIndex; } this.change_Shape=function(n) { this.Shape[n]=document.getElementById("ID_"+this.Name+"_L"+n+"_SHAPE").selectedIndex; } this.change_V0=function(n) { x=document.getElementById("ID_"+this.Name+"_L"+n+"_V0").value; if (isNaN(x)) x=-100; else if (x=="") x=-100; if (1*x<-1000) x=-1000; if (1*x>1000) x=1000; this.V0[n]=x; document.getElementById("ID_"+this.Name+"_L"+n+"_V0").value=x; } this.change_r0=function(n) { x=document.getElementById("ID_"+this.Name+"_L"+n+"_R0").value; if (isNaN(x)) x=1.2; else if (x=="") x=1.2; if (1*x<0.01) x=0.01; if (1*x>5) x=5; this.r0[n]=x; document.getElementById("ID_"+this.Name+"_L"+n+"_R0").value=x; } this.change_a=function(n) { x=document.getElementById("ID_"+this.Name+"_L"+n+"_A").value; if (isNaN(x)) x=0.5; else if (x=="") x=0.5; if (1*x<0.01) x=0.01; if (1*x>3) x=3; this.a[n]=x; document.getElementById("ID_"+this.Name+"_L"+n+"_A").value=x; } this.makeElement=function(name,mode,onchange,popup_menu) { // Генерация строки элемента var s; this.Name=name; this.Mode=mode; this.defaultValues(); this.Potentials=1; s='\n' +' \n' +' \n' +' \n' +' \n' +' \n' +' \n' +' \n' +' \n'; for (i=0;i<10;i++) { s=s +' \n' +' \n' +' \n' +' \n' +' \n' +' \n' +' \n' +' \n'; } s=s+''; +'
 TypeShapeV0, Mevr0, fma, fm
\n' +' \n' +'
\n'; document.getElementById(name).outerHTML=s; this.Show(); } this.defaultValues=function() { // Начальные значения for (i=0;i<10;i++) { this.Type[i]=0; this.Shape[i]=0; this.V0[i]=-100; this.r0[i]=1.2; this.a[i]=0.5; } } this.getPotentials=function() { return(this.Potentials); } this.setPotentials=function(pots) { this.Potentials=pots; this.Show(); } this.getValue=function(index,param) { if ((param=="TYPE")||(param=="SHAPE")) return($("#ID_"+this.Name+"_L"+index+"_"+param)[0].selectedIndex); else return($("#ID_"+this.Name+"_L"+index+"_"+param).val()); } this.setValue=function(index,param,value) { if ((param=="TYPE")||(param=="SHAPE")) $("#ID_"+this.Name+"_L"+index+"_"+param)[0].selectedIndex=value; else $("#ID_"+this.Name+"_L"+index+"_"+param).val(value); //--------------- switch (param) { case "TYPE": this.Type[index]=value; break; case "SHAPE": this.Shape[index]=value; break; case "V0": this.V0[index]=value; break; case "R0": this.r0[index]=value; break; case "A": this.a[index]=value; break; } } this.Show=function() { for (i=0;i<10;i++) { if (i1) { for (i=n;i<10-1;i++) { this.Type[i]=this.Type[i+1]; this.Shape[i]=this.Shape[i+1]; this.V0[i]=this.V0[i+1]; this.r0[i]=this.r0[i+1]; this.a[i]=this.a[i+1]; } this.Potentials--; } this.Show(); } } //--------------------------------------------------------------------------------------- // Обработка для многострочного текстового поля (2014-12-26) //--------------------------------------------------------------------------------------- function Table_Data2() { this.Columns; this.Name=""; this.makeElement=function(name,sizes,columns,onchange,tooltip,popup_menu) { // Генерация строки элемента var s; this.Name=name; SIZES=sizes.split(','); if (tooltip!="") tooltip="title='"+tooltip+"'"; if (popup_menu!='') popup_menu=" class='"+popup_menu+"'"; this.Columns=columns; s=""; document.getElementById(name).outerHTML=s; } this.clear=function() { // Начальные значения $("#ID_"+this.Name).val(''); } this.setColumns=function(columns) { this.Columns=columns; this.format(); } this.getValue=function() { return($("#ID_"+this.Name).val()); } this.setValue=function(value,format) { if (format === undefined) format=true; // По умолчанию формат вкючён $("#ID_"+this.Name).val(value); if (format) this.format(); // Форматируем текст } this.format=function() { var size=new Array(); var x=new Array(); var i,j,k,l,n,s,ss,s2,res="",w,w2; // Начальные длины полей for (i=0;isize[j]) size[j]=w.length; } // Находим X-значение x[i]=s2[0]; } // Сортировка пузырьком for (i=0;i1*x[j+1]) { w=x[j]; x[j]=x[j+1]; x[j+1]=w; w=s[j]; s[j]=s[j+1]; s[j+1]=w; } } } // Генерируем строки заново for (i=0;i\n" +"\n" +"
"+title2+"
\n" +"\n" +"\n" +"\n" +"\n" +"\n" +"\n" +"\n" +"
\n"; document.getElementById(name).outerHTML=s; } this.change=function() { var s; s=$("#ID_"+this.Name+"_LIST option:selected").text(); s=s.split(" | "); $("#ID_"+this.Name+"_VAR").val(s[1]); } this.set=function(s) { $("#ID_"+this.Name+"_VAR").val(s); } this.list=function() { if (this.Type=="variant") { $.ajax({ url: "../save/show_vars.php", type: "GET", data: { task: this.Task, name: this.Name }, success: function( data ) { var i,name; i=data.indexOf('\n'); name=data.substr(0,i); data=data.substring(i+1,data.length); var V; V=eval('(' +data+ ')'); $('#ID_'+name+'_LIST').empty(); for (i=0;i'+V[i].date+' | '+V[i].name+''); } }); } else if (this.Type=="expdata") { $.ajax({ url: "../save/show_exp_data.php", type: "GET", data: { task: this.Task, name: this.Name }, success: function( data ) { var i,name; i=data.indexOf('\n'); name=data.substr(0,i); data=data.substring(i+1,data.length); var V; V=eval('(' +data+ ')'); $('#ID_'+name+'_LIST').empty(); for (i=0;i'+V[i].date+' | '+V[i].name+''); } }); } } this.del=function() { if (this.Type=="variant") { $.ajax({ url: "../save/delete_var.php", type: "GET", data: { task: this.Task, title: $("#ID_"+this.Name+"_VAR").val(), name: this.Name }, success: function( data ) { var i,name; i=data.indexOf('\n'); name=data.substr(0,i); data=data.substring(i+1,data.length); var V; V=eval('(' +data+ ')'); $('#ID_'+name+'_LIST').empty(); for (i=0;i'+V[i].date+' | '+V[i].name+''); } }); } else if (this.Type=="expdata") { $.ajax({ url: "../save/delete_exp_data.php", type: "GET", data: { task: this.Task, title: $("#ID_"+this.Name+"_VAR").val(), name: this.Name }, success: function( data ) { var i,name; i=data.indexOf('\n'); name=data.substr(0,i); data=data.substring(i+1,data.length); var V; V=eval('(' +data+ ')'); $('#ID_'+name+'_LIST').empty(); for (i=0;i'+V[i].date+' | '+V[i].name+''); } }); } } this.load=function() { if (this.Type=="variant") { $.ajax({ url: "../save/load_var.php", type: "GET", data: { task: this.Task, name: $("#ID_"+this.Name+"_VAR").val() }, success: eval(this.OnLoadFunc) }); } else if (this.Type=="expdata") { $.ajax({ url: "../save/load_exp_data.php", type: "GET", data: { task: this.Task, name: $("#ID_"+this.Name+"_VAR").val() }, success: eval(this.OnLoadFunc) }); } } this.save=function(a) { if (this.Type=="variant") { $.ajax({ url: "../save/save_var.php", type: "POST", data: { task: this.Task, title: $("#ID_"+this.Name+"_VAR").val(), data: a, name: this.Name }, success: function( data ) { var i,name; i=data.indexOf('\n'); name=data.substr(0,i); data=data.substring(i+1,data.length); var V; V=eval('(' +data+ ')'); $('#ID_'+name+'_LIST').empty(); for (i=0;i'+V[i].date+' | '+V[i].name+''); } }); } else if (this.Type=="expdata") { $.ajax({ url: "../save/save_exp_data.php", type: "POST", data: { task: this.Task, title: $("#ID_"+this.Name+"_VAR").val(), data: a, name: this.Name }, success: function( data ) { var i,name; i=data.indexOf('\n'); name=data.substr(0,i); data=data.substring(i+1,data.length); var V; V=eval('(' +data+ ')'); $('#ID_'+name+'_LIST').empty(); for (i=0;i'+V[i].date+' | '+V[i].name+''); } }); } } } //--------------------------------------------------------------------------------------- // Вариант (2014-10-10) //--------------------------------------------------------------------------------------- function Variant() { this.Task=""; this.Var_Data=""; this.Exp_Data=""; this.set_task=function(task) { this.Task=task; } this.list_variants=function() { $.ajax({ url: "../save/show_vars.php", type: "GET", data: { task: this.Task }, success: function( data ) { var V; V=eval('(' +data+ ')'); removeOptions(document.getElementById("ID_VARIANT")); for (i=0;i'+V[i].date+' | '+V[i].name+''); } }); } this.load_variant=function() { $.ajax({ url: "../save/load_var.php", type: "GET", data: { task: this.Task, id: $("#ID_VARIANT").val() }, success: function( data ) { this.Var_Data=eval('(' +data+ ')'); } }); } this.save_variant=function() { var a; a=$.toJSON(Var_Data); $.ajax({ url: "../save/save_var.php", type: "POST", data: { task: this.Task, name: $("#ID_VARIANT_SAVE_NAME").val(), data: a }, success: function( data ) { } }); } this.list_exp_data=function() { $.ajax({ url: "../save/show_exp_data.php", type: "GET", data: { task: this.Task }, success: function( data ) { var V; V=eval('(' +data+ ')'); removeOptions(document.getElementById("ID_EXP_DATA")); for (i=0;i'+V[i].date+' | '+V[i].name+''); } }); } this.load_exp_data=function() { $.ajax({ url: "../save/load_exp_data.php", type: "GET", data: { task: this.Task, id: $("#ID_EXP_DATA").val() }, success: function( data ) { this.Exp_Data=eval('(' +data+ ')'); } }); } this.save_exp_data=function(VAR_NAME,DATA) { var a; a=$.toJSON(Exp_Data); $.ajax({ url: "../save/save_exp_data.php", type: "POST", data: { task: this.Task, name: $("#ID_EXP_DATA_SAVE_NAME").val(), data: a }, success: function( data ) { } }); } } //--------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------- function get_R_from_r(r,A) { R=Math.round(1000*r*Math.pow(A,1./3.))/1000; return(R); } //--------------------------------------------------------------------------------------- function get_r_from_R(R,A) { r=Math.round(1000*R/Math.pow(A,1./3.))/1000; return(r); } //--------------------------------------------------------------------------------------- function getDecayMode(z,a) { if ((1*dmode1[z]>a)||(1*dmode1[z]+1*dmode[1*z].length-1a)||(1*dmode1[z]+1*dmode[1*z].length-1zmax) z=zmax; if (whatchanged==0) { if (z<=92) a=Math.floor(2*z+6.38e-3*z*z); else a=Math.floor(126.15+0.3630*z+9.270e-3*z*z); } else { if (z>a) z=Math.round(a/2); } if (aamax) a=amax; // Присваиваем z v=zname+".selectedIndex=z;"; eval(v); // Присваиваем a if (a>300) a=300; v=aname+".selectedIndex=a-1;"; eval(v); // Меняем картинку v=picname+".src='"+BASEURL+"webnrv/common/show_pic.php?Z="+z+"&A="+a+"';"; eval(v); v=picname+".width=10;"; eval(v); v=picname+".height=10;"; eval(v); } //--------------------------------------------------------------------------------------- // Добавлена 2012-06-14 // Возвращает значение COOKIE function get_cookie(name){ cookie_name = name + "="; cookie_length = document.cookie.length; cookie_begin = 0; while (cookie_begin < cookie_length) { value_begin = cookie_begin + cookie_name.length; if (document.cookie.substring(cookie_begin, value_begin) == cookie_name){ var value_end = document.cookie.indexOf (";", value_begin); if (value_end == -1) value_end = cookie_length; return unescape(document.cookie.substring(value_begin, value_end)); } cookie_begin = document.cookie.indexOf(" ", cookie_begin) + 1; if (cookie_begin == 0) break; } return null; } //--------------------------------------------------------------------------------------- // Добавлена 2012-06-14 // Устанавливает значение в SELECT'е function setIndexByVal(id,val) { obj=document.getElementById(id); for (i=0;imax) w=max; if (type==0) w=Math.floor(w); v=varname+".value=w"; eval(v); if (func_call!="") eval("func_call"); } //---------------------------------------------------------------------------------------- function setCookie (name, value, expires, path, domain, secure) { document.cookie = name + "=" + escape(value) + ((expires) ? "; expires=" + expires : "") + ((path) ? "; path=" + path : "") + ((domain) ? "; domain=" + domain : "") + ((secure) ? "; secure" : ""); } function getCookie(name) { var cookie = " " + document.cookie; var search = " " + name + "="; var setStr = null; var offset = 0; var end = 0; if (cookie.length > 0) { offset = cookie.indexOf(search); if (offset != -1) { offset += search.length; end = cookie.indexOf(";", offset) if (end == -1) { end = cookie.length; } setStr = unescape(cookie.substring(offset, end)); } } return(setStr); } //---------------------------------------------------------------------------------------- function checkValue(min,max,type,def,varname) { // type 0-int, 1-float var w,v; v="w="+varname+".value"; eval(v); if (isNaN(w)) w=def; else if (w=="") w=def; if (wmax) w=max; if (type==0) w=Math.floor(w); v=varname+".value=w"; eval(v); } //--------------------------------------------------------------------------- // 2014-09-24 (alekseev) Улучшенный вариант, последняя версия, работает с ID //--------------------------------------------------------------------------- function checkValueById(min,max,type,def,id) { // type 0-int, 1-float var w,v,obj; obj=document.getElementById(id); w=obj.value; if (isNaN(w)) w=def; else if (w=="") w=def; if (1*wmax) w=max; if (type==0) w=Math.floor(w); obj.value=w; } //--------------------------------------------------------------------------- function removeOptions(selectbox) { var i; for (i=selectbox.options.length-1;i>=0;i--) selectbox.remove(i); } //--------------------------------------------------------------------------- function draw1(canvasName) { var canvas = document.getElementById(canvasName); var context = canvas.getContext('2d'); context.font = '40pt Calibri'; context.fillStyle = 'blue'; context.fillText('Hello World! '+canvas.width+"*"+canvas.height, 50, 100); } //--------------------------------------------------------------------------- function drawTopo(canvasName,A,M,N) { var canvas = document.getElementById(canvasName); var context = canvas.getContext('2d'); var min,max,dx,dy; // Минимум максимум min=A[0]; max=A[0]; for (i=1;imax) max=A[i]; if (A[i] 1.0) this.a13 += Math.pow(At,1.0/3.0); if(Ap > 1.0) this.a13 += Math.pow(Ap,1.0/3.0); if(this.a13 < 1.0) this.a13 = 1.0; } //------------------------------------------------------------------------- // set the Coulomb radius this.setCoulombParameters=function(rc) { this.r_Coul = rc; this.AddCoulomb = 1; } //------------------------------------------------------------------------- // set parameters of the nuclear part, // depending on the type we have different numbers of the parameters this.setNuclearParameters=function(type,v,r,a,vs,rs,as) { this.Type = type; switch(type) { case "Superposition": this.Vol_V = v; this.Vol_r = r; this.Vol_a = a; this.Surf_V = vs; this.Surf_r = rs; this.Surf_a = as; break; case "Volume": this.Vol_V = v; this.Vol_r = r; this.Vol_a = a; break; case "Surface": this.Surf_V = v; this.Surf_r = r; this.Surf_a = a; break; case "Gaussian": this.Gauss_V = v; this.Gauss_r = r; break; case "Proximity": this.b_Prox = v; this.r_Proj = r; this.r_Targ = a; break; case "Thomas": this.Thomas_V = v; this.Thomas_r = r; this.Thomas_a = a; break; default: break; } } //------------------------------------------------------------------------- // Считаем ф-ию от r1 до r2 (n точек) и результат заносим в массивы X[] и Y[] this.Calculate=function(r1,r2,n,X,Y) { dr=(r2-r1)/(n-1); for (i=0;i0) { z12 = 1.0*this.Z_Proj*this.Z_Targ*this.e2; rc = 1.0*this.r_Coul*this.a13; if(r0.5)x=0.5; c1 = 1.0*R_Proj*(1.0-x*x); x = 1.0*b/R_Targ; if(x>0.5)x=0.5; c2 = 1.0*R_Targ*(1.0-x*x); rp = 1.0*c1*c2/(c1+c2); x = (1.0*this.A_Proj + 1.0*this.A_Targ - 2.0*(this.Z_Proj + this.Z_Targ))/(1.0*this.A_Proj + 1.0*this.A_Targ); g = 0.951*(1.0-1.7826*x*x); y = 1.0*(r-c1-c2)/b; if(y<=0) fi = -1.7817+0.9270*y+0.143*y*y-0.09*y*y*y; else if(y<=1.9472) fi = -1.7817+0.9270*y+0.01696*y*y-0.05148*y*y*y; else fi = -4.41*Math.exp(-y/0.7176); v = 4.0*Math.PI*g*rp*b*fi; break; //------------------------------------------------------------------------ case "Thomas": R = 1.0*this.Thomas_r*this.a13; ex = Math.exp((1.0*r-1.0*R)/this.Thomas_a); v = 2.0*this.Thomas_V/(1.0*this.Thomas_a*(r+1.e-6))*ex/(1.0+ex)/(1.0+ex); break; //------------------------------------------------------------------------ default: break; }// end switch return 1.*vc+1.*v; } } // denikin } //--------------------------------------------------------------------------- //--------------------------------------------------------------------------- // Вычисление потенциала для FRESCO //--------------------------------------------------------------------------- function FRESCO_Potential() { this.e2 = 1.43986; //------------------------------------------------------------------------- // arrays for potential parameters this.nMax = 10; this.nCurrent = 0; this.type = new Array(this.nMax); this.shape = new Array(this.nMax); this.V0 = new Array(this.nMax); this.rV = new Array(this.nMax); this.aV = new Array(this.nMax); //------------------------------------------------------------------------- // default parameters definition for(i=0;i 1.0) this.a13 += Math.pow(At,1.0/3.0); if(Ap > 1.0) this.a13 += Math.pow(Ap,1.0/3.0); if(this.a13 < 1.0) this.a13 = 1.0; } //------------------------------------------------------------------------- // set the Coulomb radius this.setCoulombParameters=function(rc) { this.r_Coul = rc; this.AddCoulomb = 1; } //------------------------------------------------------------------------- this.setNTerms = function(n) { if(n>10) n=10; this.nCurrent = n; } //------------------------------------------------------------------------- // define all(!) parameters of the nuclear part // n - number of potential terms // params - all the parameters (array[n*5]) this.setAllTermsInNuclearPotential=function(n,params) { if(n > 10) n = 10; this.nCurrent = n; for(i=0;i (i+1)*5) { this.type[i] = params[i*5 + 0]; this.shape[i] = params[i*5 + 1]; this.V0[i] = params[i*5 + 2]; this.rV[i] = params[i*5 + 3]; this.aV[i] = params[i*5 + 4]; } else { this.type[i] = 1; this.shape[i] = 0; this.V0[i] = 0.0; this.rV[i] = 1.0; this.aV[i] = 1.0; } } } //------------------------------------------------------------------------- // change k-th term in potential this.setOneTermInNuclearPotential=function(k,type,shape,v0,rv,av) { if(k < this.nCurrent) { this.type[k] = type; this.shape[k] = shape; this.V0[k] = v0; this.rV[k] = rv; this.aV[k] = av; } } //------------------------------------------------------------------------- // Считаем ф-ию от r1 до r2 (n точек) и результат заносим в массивы X[] и Y[] this.Calculate=function(r1,r2,n,X,Y) { var dr; dr=(r2-r1)/(n-1); for (i=0;i0) { z12 = 1.0*this.Z_Proj*this.Z_Targ*this.e2; rc = 1.0*this.r_Coul*this.a13; if(r= this.nCurrent) return 0.0; //----------------------------------------------------------- if(r < 1.e-8) r = 1.e-8; v = 0.0; //----------------------------------------------------------- xx = (1.0*r-1.0*this.rV[k]*this.a13)/this.aV[k]; if(xx<300.0) ex = Math.exp(xx); else ex = 1.94e130; _ex = 1.0/(1.0 + 1.0*ex); //console.log("in pot: "+this.V0[k]+"|"+this.rV[k]+"|"+this.aV[k]); //----------------------------------------------------------- // Central potential if(this.type[k] == 1) switch(this.shape[k]) { default: v = 0.0; break; case 0: // Woods-Saxon v = this.V0[k]*_ex; break; case 1: // squared Woods-Saxon v = this.V0[k]*_ex*_ex; break; case 2: // Gaussian v = this.V0[k]*Math.exp(-xx*xx); break; case 3: // Yukawa v = this.V0[k]/(ex*r); break; case 4: // Exponetial v = this.V0[k]/ex; break; } //----------------------------------------------------------- // Central potential, Derivative & Spin-Orbit else if(this.type[k] == 2 || this.type[k] == 3 || this.type[k] == 4) { switch(this.shape[k]) { default: v = 0.0; break; case 0: // Woods-Saxon v = 4.0*this.V0[k]*ex*_ex*_ex; break; case 1: // squared Woods-Saxon v = 8.0*this.V0[k]*ex*ex*_ex*_ex*_ex; break; case 2: // Gaussian v = 2.0*this.V0[k]*xx*Math.exp(-xx*xx); break; case 3: // Yukawa v = this.V0[k]/(ex*r); break; case 4: // Exponetial v = this.V0[k]/ex; break; } if(this.type[k] != 2) v *= 2.0/(4.0*r*this.aV[k]); } //----------------------------------------------------------- // Tensor potential else if(this.type[k] == 5 || this.type[k] == 6) switch(this.shape[k]) { default: v = 0.0; break; case 0: // Woods-Saxon v = 8.0*this.V0[k]*ex*(ex-1.0)*_ex*_ex*_ex; break; case 1: // squared Woods-Saxon v = 4.0*this.V0[k]*ex*ex*_ex*_ex*_ex; break; case 2: // Gaussian v = 2.0*this.V0[k]*xx*Math.exp(-xx*xx); break; case 3: // Yukawa v = this.V0[k]*(1.0/(this.aV[k]*this.aV[k]) + 2.0/(r*r))/(ex*r); break; case 4: // Exponetial v = this.V0[k]/ex; break; } return v; } //------------------------------------------------------------------------- } //------------------- A.S. Denikin, 12.12.2015 -------------------------------- // порядок использования // 1. запускаем один из setReaction и заполняем массивы с помощью setData // setReaction(ap,zp,at,zt,atr,ztr,type,elab,q,descriptor); // setData(data,npt,cl,un,err_un); // // 2. функция getData будет по требованию пользователя заполнять массивы WorkData // данными для отображения на графике // getData("lab","σ/σ(Ruth)"); // function AngularDistribution() { this.Ap = -1; this.Zp = -1; this.At = -1; this.Zt = -1; this.Atr = -1; this.Ztr = -1; this._Ap = -1; this._Zp = -1; this._At = -1; this._Zt = -1; this.Npoint = 0; this.Data = new Array(); this.WorkData = new Array(); this.RuthData = new Array(); this.Elab = -1; this.Ecm = -1; this.mu = -1; this._mu = -1; this.eta = -1; this.Q = 0.0; this.transfer_type= ""; this.cm_lab = ""; this.units = ""; this.Description = ""; //----------------------------------------------------------------------------- // /*this.getString = function() { string = "Reaction: "+ this.Ap+""+NUCLEI.getElemByZ(this.Zp)+"("+round(this.Elab,1)+" MeV) + "+ this.At+""+NUCLEI.getElemByZ(this.Zt); if(this.Atr > 0)// transfer reaction { string += "-> "+ this._Ap+""+NUCLEI.getElemByZ(this._Zp)+ this._At+""+NUCLEI.getElemByZ(this._Zt)+"(Q="+round(this.Q,2)+" MeV)"; } else if(Math.abs(this.Q) > 1.0e-5) \\inelastic scattering else \\ elastic scattering string += "-> elastic scattering"; }*/ //----------------------------------------------------------------------------- // setup reaction parameters (1st variant): // ap,zp,at,zt - masses and charges of projectile and target // atr,ztr - mass and charge of transfered particle (can be equal 0, for elastic or inelastic scattering) // type - reaction type: (a+x) + b -> a + (b+x) = stripting // a + (b+x) -> (a+x) + b = pickup // it works only for transfer reaction, set any value for inelastic or elastic scattering // elab,q - lab energy, Q-values // descriptor - text string with description // this.setReaction = function (ap,zp,at,zt,atr,ztr,type,elab,q,descriptor) { this.Ap = 1.0*ap; this.Zp = 1.0*zp; this.At = 1.0*at; this.Zt = 1.0*zt; this.mu = 1.0*this.Ap*this.At/(1.0*this.Ap+1.0*this.At); this.Atr = 1.0*atr; this.Ztr = 1.0*ztr; this.transfer_type = type; if(type == "pickup") { this._Ap = 1.0*ap + 1.0*atr; this._Zp = 1.0*zp + 1.0*ztr; this._At = 1.0*at - 1.0*atr; this._Zt = 1.0*zt - 1.0*ztr; } else // stripping { this._Ap = 1.0*ap - 1.0*atr; this._Zp = 1.0*zp - 1.0*ztr; this._At = 1.0*at + 1.0*atr; this._Zt = 1.0*zt + 1.0*ztr; } this._mu = 1.0*this._Ap*this._At/(1.0*this._Ap+1.0*this._At); this.Elab = elab; this.Ecm = 1.0*elab*this.At/(1.0*this.Ap+1.0*this.At); k = Math.sqrt(2.*this.mu*this.Ecm/h2_mn); this.eta = 1.0*this.Zp*this.Zt*e2/(1.0*h2_mn*k); this.Q = q; this.Description = descriptor; } //----------------------------------------------------------------------------- // определяем массивы с исходными данными // this.Data[][0] - scattering angles // this.Data[][1] - cross section // this.Data[][2,3] - plus/minus error // npt - number of points // cl - string = cm|lab // un - string = barn|mb|mcb|nb|pb|σ/σ(Ruth) // err_un - string = abs|% // this.setData = function (data,npt,cm_or_lab,un,err_un) { this.Npoint = npt; this.Data = createArray(this.Npoint,4); this.WorkData = createArray(this.Npoint,4); this.RuthData = createArray(180,2); for(i=0;i0) { r -= 1.0*ddr; b = this.getBassPotential(r,1); if(b > 0.0) { r += 1.0*ddr/(1.0 + 1.0*Math.abs(a/b)); R_Bass = r; V_Bass = this.getBassPotential(r,0); break; } a=b; } this.VCB = V_Bass; this.RCB = R_Bass; } //----------------------------------------------------------------------------- // вычисляем потенциал Басса // V(r) if n=0 and dV/dr if n=1 this.getBassPotential = function(r,n) { rr=1.0*r; A=0.0300; B=0.0061; d1=3.30; d2=0.65; z12 = 1.0*this.Zp*this.Zt*e2; // point Coulomb interaction a13 = Math.pow(1.0*this.Ap,0.333333); a23 = Math.pow(1.0*this.At,0.333333); R10 = 1.16*a13 - 1.39/a13; R20 = 1.16*a23 - 1.39/a23; R1 = 1.0*R10; R2 = 1.0*R20; if(R1 < 0.9) R1 = 0.9; if(R2 < 0.9) R2 = 0.9; if(rr < 1.0e-5) rr = 1.0e-5; s = 1.0*rr - 1.0*R1 - 1.0*R2; g = 1.0*A*Math.exp(s/d1) + 1.0*B*Math.exp(s/d2); switch(n) { default: case 0: v = 1.0*z12/rr - 1.0*R10*R20/(1.0*R10 + 1.0*R20)/g; break; case 1: v =-1.0*z12/(rr*rr) + 1.0*R10*R20/(1.0*R10 + 1.0*R20)*(1.0*A/d1*Math.exp(s/d1) + 1.0*B/d2*Math.exp(s/d2))/(1.0*g*g); break; } return v; } } //------------------- A.S. Denikin, 17.12.2015 -------------------------------- // порядок использования // 1. запускаем setReaction и заполняем массивы с помощью setData // setReaction(ap,zp,at,zt,ch,q_gg,descriptor) // setData(data,npt,cm_or_lab,units) // // 2. функция getData будет по требованию пользователя заполнять массивы WorkData // данными для отображения на графике // getData("Eexc","mb"); // function EvrEnergyDistribution() { this.Ap = -1; this.Zp = -1; this.At = -1; this.Zt = -1; this.Npoint = 0; this.Data = new Array(); this.WorkData = new Array(); this.Esystem = ""; this.CSunits = ""; this.Channel = ""; this.Qgg = 0.0; this.Description = ""; //----------------------------------------------------------------------------- // setup reaction parameters: // ap,zp,at,zt - masses and charges of projectile and target // ch - string name of the chanell // q_gg - Qgg = MassExc(CN) - MassExc(Proj) - MassExc(Targ) // descriptor - text string with description // this.setReaction = function (ap,zp,at,zt,ch,q_gg,descriptor) { this.Ap = 1.0*ap; this.Zp = 1.0*zp; this.At = 1.0*at; this.Zt = 1.0*zt; this.Description = descriptor; this.Channel = ch; this.Qgg = q_gg; } //----------------------------------------------------------------------------- // определяем массивы с исходными данными // this.Data[][0] - Energy // this.Data[][1] - cross section // this.Data[][2,3] - plus/minus error // npt - number of points // cm_or_lab - string = cm|lab // units - string = barn|mb|mcb|nb|pb // this.setData = function (data,npt,cm_or_lab,units) { this.Npoint = npt; this.Data = createArray(this.Npoint,4); this.WorkData = createArray(this.Npoint,4); for(i=0;i