Template:Fudan kernel3/Javascript

var HA,HB,HC; var HlkonN = -3; var HlkonX = -5; var HlkonY = -2; var n1 = 1; var n2 = 2; var n3 = 2; paramUpdateHE(); FplotHE('Fplot3',[HA,HB,HC]); function FplotHE(id,fn) {

   var plotData=[];
   var color=['#2e62ff','Orange','#ff769a'];
   for(var i=0;i<fn.length;i++){
       plotData[i]={
           fn: fn[i],
           sampler: 'builtIn',
           graphType: 'polyline',
           color: color[i],
           attr: {'stroke-width': 3}
       };
   }
   functionPlot({
       target: '#'+id+' .FplotImg',
       disableZoom: true,
       grid: true,
       xAxis: {
           label: 'Log[tTa]',
           domain: [-6, 1]
       },
       yAxis: {
           label: 'Concentration',
           domain: [0, 20]
       },
       data: plotData
   });

} var HEtextkonN=$('#HEkonNtext'); $('#HlkonN').slider({

   min:-5,
   max:-1,
   step:0.01,
   value:-3,
   create: function() {
       HEtextkonN.text( $( this ).slider( "value" ) );
   },
   slide: function(event,ui) {
       HlkonN=ui.value;
       HEtextkonN.text( ui.value );
       paramUpdateHE();
       FplotHE('Fplot3',[HA,HB,HC]);
   }

}); var HEtextkonX=$('#HEkonXtext'); $('#HlkonX').slider({

   min:-7,
   max:-3,
   step:0.01,
   value:-5,
   create: function() {
       HEtextkonX.text( $( this ).slider( "value" ) );
   },
   slide: function(event,ui) {
       HlkonX=ui.value;
       HEtextkonX.text( ui.value );
       paramUpdateHE();
       FplotHE('Fplot3',[HA,HB,HC]);
   }

}); var HEtextkonY=$('#HEkonYtext'); $('#HlkonY').slider({

   min:-4,
   max:-0,
   step:0.01,
   value:-2,
   create: function() {
       HEtextkonY.text( $( this ).slider( "value" ) );
   },
   slide: function(event,ui) {
       HlkonY=ui.value;
       HEtextkonY.text( ui.value );
       paramUpdateHE();
       FplotHE('Fplot3',[HA,HB,HC]);
   }

}); var HEtextn1=$('#HEn1text'); $('#n1').slider({

   min:1,
   max:3,
   step:0.01,
   value:1,
   create: function() {
       HEtextn1.text( $( this ).slider( "value" ) );
   },
   slide: function(event,ui) {
       n1=ui.value;
       HEtextn1.text( ui.value );
       paramUpdateHE();
       FplotHE('Fplot3',[HA,HB,HC]);
   }

}); var HEtextn2=$('#HEn2text'); $('#n2').slider({

   min:1,
   max:3,
   step:0.01,
   value:2,
   create: function() {
       HEtextn2.text( $( this ).slider( "value" ) );
   },
   slide: function(event,ui) {
       n2=ui.value;
       HEtextn2.text( ui.value );
       paramUpdateHE();
       FplotHE('Fplot3',[HA,HB,HC]);
   }

}); var HEtextn3=$('#HEn3text'); $('#n3').slider({

   min:1,
   max:3,
   step:0.01,
   value:2,
   create: function() {
       HEtextn3.text( $( this ).slider( "value" ) );
   },
   slide: function(event,ui) {
       n3=ui.value;
       HEtextn3.text( ui.value );
       paramUpdateHE();
       FplotHE('Fplot3',[HA,HB,HC]);
   }

}); function paramUpdateHE() {

   HA='1/0.08*(10^(x))^'+n1+'/(10^(-5)/10^('+HlkonN+') + (10^(x))^('+n1+'))';
   HB='1/0.08*(10^(-5)/10^('+HlkonY+'))/(10^(-5)/10^('+HlkonY+') + (1/0.08*(10^(x))^'+n1+'/(10^(-5)/10^('+HlkonN+') + (10^(x))^('+n1+')))^('+n2+'))';
   HC='2/0.1*10^(-5)/(10^('+HlkonX+'))/(10^(-5)/10^('+HlkonX+') + (1/0.08*(10^(x))^'+n1+'/(10^(-5)/10^('+HlkonN+') + (10^(x))^('+n1+'))+1/0.08*(10^(-5)/10^('+HlkonY+'))/(10^(-5)/10^('+HlkonY+') + (1/0.08*(10^(x))^'+n1+'/(10^(-5)/10^('+HlkonN+') + (10^(x))^('+n1+')))^('+n2+')))^('+n3+'))';

}