Modeling2.html
From 2013.igem.org
(Difference between revisions)
Line 240: | Line 240: | ||
var odePart; | var odePart; | ||
- | while ( | + | var on = true; |
- | if (this.yone[counter] < 2 ) | + | |
- | if (this.yone[counter] > 0) | + | while(on){ |
- | + | ||
+ | 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]); | |
- | + | this.yone.push(- odePart[0]*dt + this.yone[counter]); | |
- | + | this.ytwo.push(- odePart[1]*dt + this.ytwo[counter]); | |
- | + | counter++; | |
- | + | ||
- | } | + | } else{ |
- | else{ | + | on = false; |
+ | }} else{ | ||
+ | on = false; | ||
+ | }} | ||
+ | else{ | ||
+ | on = false; | ||
+ | }} | ||
+ | else{ | ||
+ | on = false; | ||
+ | } | ||
- | |||
- | |||
} | } | ||
+ | on = true; | ||
this.yone.reverse(); | this.yone.reverse(); | ||
this.ytwo.reverse(); | this.ytwo.reverse(); | ||
+ | |||
+ | while(on){ | ||
- | + | 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] < 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++; |
- | + | ||
- | } | + | } 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: | ||
// } | // } | ||
}; | }; | ||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
Revision as of 00:00, 28 September 2013