Modeling2.html

From 2013.igem.org

(Difference between revisions)
Line 240: Line 240:
     var odePart;  
     var odePart;  
-
while (1===1){
+
    var on = true;
-
         if (this.yone[counter] < 2 )
+
 
-
             if (this.yone[counter] > 0)  
+
    while(on){
-
                if (this.ytwo[counter] > 0)
+
 
 +
         if (this.yone[counter] < 2){
 +
             if (this.yone[counter] > 0 ){
 +
                if (this.ytwo[counter] > 0){
                     if (this.ytwo[counter] < 2) {
                     if (this.ytwo[counter] < 2) {
-
                   
+
                                odePart = odefunX(this.yone[counter], this.ytwo[counter]);
-
        odePart = odefunX(this.yone[counter], this.ytwo[counter]);
+
                                this.yone.push(- odePart[0]*dt + this.yone[counter]);
-
        this.yone.push(- odePart[0]*dt + this.yone[counter]);
+
                                this.ytwo.push(- odePart[1]*dt + this.ytwo[counter]);
-
        this.ytwo.push(- odePart[1]*dt + this.ytwo[counter]);
+
                                counter++;
-
        counter++;
+
 
-
}
+
                    }                   else{
-
else{
+
                        on = false;
 +
                    }}                    else{
 +
                        on = false;
 +
                    }}
 +
                                    else{
 +
                        on = false;
 +
                    }}
 +
                    else{
 +
                        on = false;
 +
                    }
-
break;
 
-
}
 
     }
     }
 +
on = true;
     this.yone.reverse();
     this.yone.reverse();
     this.ytwo.reverse();  
     this.ytwo.reverse();  
 +
 +
      while(on){
-
while (1===1){
+
         if (this.yone[counter] < 2){
-
         if (this.yone[counter] < 2 )
+
             if (this.yone[counter] > 0.1 ){
-
             if (this.yone[counter] > 0)  
+
                if (this.ytwo[counter] > 0.1){
-
                if (this.ytwo[counter] > 0)
+
                     if (this.ytwo[counter] < 2) {
                     if (this.ytwo[counter] < 2) {
-
                     
 
         odePart = odefunX(this.yone[counter], this.ytwo[counter]);
         odePart = odefunX(this.yone[counter], this.ytwo[counter]);
         this.yone.push(odePart[0]*dt + this.yone[counter]);
         this.yone.push(odePart[0]*dt + this.yone[counter]);
-
         this.ytwo.push(odePart[1]*dt + this.ytwo[counter]);}
+
         this.ytwo.push(odePart[1]*dt + this.ytwo[counter]);
-
else{
+
                                counter++;
-
break;
+
 
-
}
+
                    }                   else{
-
}
+
                        on = false;
 +
                    }}                    else{
 +
                        on = false;  
 +
                    }}
 +
                                    else{
 +
                        on = false;
 +
                    }}
 +
                    else{
 +
                        on = false;
 +
                    }
 +
 
 +
    }
 +
 
 +
 
 +
};
     this.plot = function(){
     this.plot = function(){
     plotSolution(this.yone, this.ytwo, graphyMin);  
     plotSolution(this.yone, this.ytwo, graphyMin);  
-
};
 
};
};
};
};
 +
var flagellum = function(x, y1, y2, theta) {
var flagellum = function(x, y1, y2, theta) {
Line 289: Line 314:
};
};
-
 
var s = 9;
var s = 9;
Line 325: Line 349:
   // }
   // }
};
};
-
 
-
 
-
var interactiveSolver = function (icONE, icTWO) {
 
-
    this.yone = [];
 
-
    this.ytwo = [];
 
-
    this.t = [];
 
-
    t.push(0);
 
-
    this.yone.push(icONE);
 
-
    this.ytwo.push(icTWO);
 
-
 
-
    var counter = 0;
 
-
    var odePart;
 
-
while (1===1){
 
-
        if (this.yone[counter] < 2 )
 
-
            if (this.yone[counter] > 0.05)
 
-
                if (this.ytwo[counter] > 0.05)
 
-
                    if (this.ytwo[counter] < 2) {
 
-
        odePart = odefunX(this.yone[counter], this.ytwo[counter]);
 
-
        this.yone.push(odePart[0]*dt + this.yone[counter]);
 
-
        this.ytwo.push(odePart[1]*dt + this.ytwo[counter]);
 
-
        counter++;
 
-
        this.t.push(counter*dt);
 
-
}
 
-
else{
 
-
break;
 
-
}
 
-
    }
 
-
        textFont(myFont, 18);
 
-
        fill(0, 0, 0);
 
-
        textAlign(CENTER, CENTER);
 
-
 
-
        noFill();
 
-
    if (this.yone[counter] > 0.8) {
 
-
 
-
            text("The Population Survives!", graphxMin + graphWidth/2, dieHeadingY);
 
-
            //dead = false;
 
-
            stroke(0, 250, 0);
 
-
    }
 
-
    else {
 
-
            text("The Population Dies", graphxMin + graphWidth/2, dieHeadingY);
 
-
            //dead = true;
 
-
            stroke(250, 0, 0);
 
-
    }
 
-
            rect(graphxMin, 7, graphWidth, 80, 10);
 
-
 
-
 
-
    plotSolution(this.yone, this.ytwo, graphyMin, 1);
 
-
    plotSolution(this.t, this.ytwo, graph2yMin);
 
-
    plotSolution(this.t, this.yone, graph2yMin);
 
-
 
-
 
-
    var eColiY= - (this.ytwo[0] - yMin)*graphHeight/yLength + graph2yMin;
 
-
    var yeastY= -(this.yone[0] - yMin)*graphHeight/yLength + graph2yMin;
 
-
    drawYeast(graphxMin, yeastY);
 
-
    drawBacteria(graphxMin, eColiY);
 
-
  // drawBacteria(graphxMin - 40, graphyMin - graphHeight*5/8);
 
-
  //  drawYeast(graphxMin + graphWidth*5/9 + 10, graphyMin + 45);
 
-
};
 
-
 
-
 
-
};
 
-
 
-
 

Revision as of 00:00, 28 September 2013

iGEM