Modeling2.html
From 2013.igem.org
(Difference between revisions)
Line 215: | Line 215: | ||
point1X = point2X; | point1X = point2X; | ||
point1Y = point2Y; } | point1Y = point2Y; } | ||
+ | }; | ||
- | |||
+ | var odefunX = function(y1, y2){ | ||
+ | var sol = []; | ||
+ | sol[0] = y2 - y1; | ||
+ | sol[1] = thetaPlay*y2*(y1 - 1); | ||
+ | return sol; | ||
+ | }; | ||
+ | |||
+ | |||
+ | |||
+ | var odeSolution = function (icONE, icTWO) { | ||
+ | this.yone = []; | ||
+ | this.ytwo = []; | ||
+ | this.calculate = function(){ | ||
+ | this.yone = []; | ||
+ | this.ytwo = []; | ||
+ | |||
+ | |||
+ | |||
+ | this.yone.push(icONE); | ||
+ | this.ytwo.push(icTWO); | ||
+ | var counter = 0; | ||
+ | |||
+ | |||
+ | var odePart; | ||
+ | while (this.yone[counter] < 2 && this.yone[counter] > 0 && this.ytwo[counter] > 0 && 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.yone.reverse(); | ||
+ | this.ytwo.reverse(); | ||
+ | |||
+ | |||
+ | while (this.yone[counter] < 2 && this.yone[counter] > 0.1 && this.ytwo[counter] > 0.1 && 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.plot = function(){ | ||
+ | plotSolution(this.yone, this.ytwo, graphyMin); | ||
}; | }; | ||
+ | }; | ||
var draw = function(){ | var draw = function(){ |
Revision as of 22:50, 27 September 2013