Difference between revisions of "Template:Heidelberg/code arabinose"

Line 52: Line 52:
 
     var time = new Array(501);
 
     var time = new Array(501);
 
     var ca = new Array(501);
 
     var ca = new Array(501);
 +
    var eq = new Array(501);
 
      
 
      
  
Line 58: Line 59:
  
 
         ca[it] = Math.max(0, (fra/frl) * cas - ((fra/frl * cas ) - cal0) * Math.exp(-frl*(time[it]/60)));
 
         ca[it] = Math.max(0, (fra/frl) * cas - ((fra/frl * cas ) - cal0) * Math.exp(-frl*(time[it]/60)));
 +
       
 +
        eq[it] = equilibrium;
 
     }
 
     }
 
        
 
        
Line 66: Line 69:
 
     var aradata = [{x: time,
 
     var aradata = [{x: time,
 
                         y: ca,
 
                         y: ca,
                         name: 'Arabinose [g/l] ' + Math.round((call+2)/2),  
+
                         name: 'Arabinose [g/l] ' + Math.round((call),  
 
                         line: {color: colors[call % colors.length]},
 
                         line: {color: colors[call % colors.length]},
 +
                        hoverlabel: {font: {family: 'Josefin Sans'} }
 +
                      },
 +
                  {x: time,
 +
                        y: eq,
 +
                        name: 'Arabinose [g/l] ' + (call+1),
 +
                        line: {color: colors[(call+1) % colors.length]},
 
                         hoverlabel: {font: {family: 'Josefin Sans'} }
 
                         hoverlabel: {font: {family: 'Josefin Sans'} }
 
                       }];
 
                       }];
    call++;
 
 
        
 
        
 
     var color = '#393939';
 
     var color = '#393939';
Line 133: Line 141:
 
     else{
 
     else{
 
         Plotly.plot(arabinoseplot, aradata, layout);
 
         Plotly.plot(arabinoseplot, aradata, layout);
         call++;
+
         call+=2;
 
     }
 
     }
 
}
 
}

Revision as of 23:39, 30 October 2017