00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 #include "TysonNovak2001OdeSystem.hpp"
00029 #include "OdeSystemInformation.hpp"
00030
00031 TysonNovak2001OdeSystem::TysonNovak2001OdeSystem()
00032 : AbstractOdeSystemWithAnalyticJacobian(6)
00033 {
00034 mpSystemInfo = OdeSystemInformation<TysonNovak2001OdeSystem>::Instance();
00035
00036 Init();
00037 }
00038
00039 TysonNovak2001OdeSystem::~TysonNovak2001OdeSystem()
00040 {
00041
00042 }
00043
00044 void TysonNovak2001OdeSystem::Init()
00045 {
00046
00047 mK1 = 0.04;
00048 mK2d = 0.04;
00049 mK2dd = 1.0;
00050 mK2ddd = 1.0;
00051 mCycB_threshold = 0.1;
00052 mK3d = 1.0;
00053 mK3dd = 10.0;
00054 mK4d = 2.0;
00055 mK4 = 35;
00056 mJ3 = 0.04;
00057 mJ4 = 0.04;
00058 mK5d = 0.005;
00059 mK5dd = 0.2;
00060 mK6 = 0.1;
00061 mJ5 = 0.3;
00062 mN = 4;
00063 mK7 = 1.0;
00064 mK8 = 0.5;
00065 mJ7 = 1e-3;
00066 mJ8 = 1e-3;
00067 mMad = 1.0;
00068 mK9 = 0.1;
00069 mK10 = 0.02;
00070 mK11 = 1.0;
00071 mK12d = 0.2;
00072 mK12dd = 50.0;
00073 mK12ddd = 100.0;
00074 mKeq = 1e3;
00075 mK13 = 1.0;
00076 mK14 = 1.0;
00077 mK15d = 1.5;
00078 mK15dd = 0.05;
00079 mK16d = 1.0;
00080 mK16dd = 3.0;
00081 mJ15 = 0.01;
00082 mJ16 = 0.01;
00083 mMu = 0.01;
00084 mMstar = 10.0;
00085 }
00086
00087 void TysonNovak2001OdeSystem::EvaluateYDerivatives(double time, const std::vector<double>& rY, std::vector<double>& rDY)
00088 {
00089 double x1 = rY[0];
00090 double x2 = rY[1];
00091 double x3 = rY[2];
00092 double x4 = rY[3];
00093 double x5 = rY[4];
00094 double x6 = rY[5];
00095
00096 double dx1 = 0.0;
00097 double dx2 = 0.0;
00098 double dx3 = 0.0;
00099 double dx4 = 0.0;
00100 double dx5 = 0.0;
00101 double dx6 = 0.0;
00102
00103 double temp1 = 0.0;
00104 double temp2 = 0.0;
00105 double temp3 = 0.0;
00106
00116 dx1 = mK1-(mK2d+mK2dd*x2)*x1;
00117
00118
00119
00120
00121 temp1 = ((mK3d+mK3dd*x4)*(1.0-x2))/(mJ3+1.0-x2);
00122 temp2 = (mK4*x6*x1*x2)/(mJ4+x2);
00123 dx2 = temp1-temp2;
00124
00125 temp1 = mK5dd*(pow(x1*x6/mJ5,mN)/(1+pow(x1*x6/mJ5,mN)));
00126 temp2 = mK6*x3;
00127 dx3 = mK5d + temp1 - temp2;
00128
00129 temp1 = (mK7*x5*(x3-x4))/(mJ7+x3-x4);
00130 temp2 = (mK8*mMad*x4)/(mJ8+x4);
00131 temp3 = mK6*x4;
00132 dx4 = temp1 - temp2 - temp3;
00133
00134 dx5 = mK9*x6*x1*(1.0-x5) - mK10*x5;
00135
00136 dx6 = mMu*x6*(1.0-x6/mMstar);
00137
00138
00139 rDY[0] = dx1*60.0;
00140 rDY[1] = dx2*60.0;
00141 rDY[2] = dx3*60.0;
00142 rDY[3] = dx4*60.0;
00143 rDY[4] = dx5*60.0;
00144 rDY[5] = dx6*60.0;
00145 }
00146
00147 void TysonNovak2001OdeSystem::AnalyticJacobian(const std::vector<double>& rSolutionGuess, double** jacobian, double time, double timeStep)
00148 {
00149 timeStep *= 60.0;
00150 double x1 = rSolutionGuess[0];
00151 double x2 = rSolutionGuess[1];
00152 double x3 = rSolutionGuess[2];
00153 double x4 = rSolutionGuess[3];
00154 double x5 = rSolutionGuess[4];
00155 double x6 = rSolutionGuess[5];
00156
00157
00158 double df1_dx1 = -mK2d - mK2dd*x2;
00159 double df1_dx2 = -mK2dd*x1;
00160
00161 jacobian[0][0] = 1-timeStep*df1_dx1;
00162 jacobian[0][1] = -timeStep*df1_dx2;
00163
00164
00165 double df2_dx1 = -mK4*x6*x2/(mJ4+x2);
00166 double df2_dx2 = -mJ3*(mK3d + mK3dd*x4)/(pow((mJ3 + 1 - x2),2))
00167 -mJ4*mK4*x6*x1/(pow((mJ4+x2),2));
00168 double df2_dx4 = mK3dd*(1-x2)/(mJ3+1-x2);
00169 double df2_dx6 = -mK4*x1*x2/(mJ4+x2);
00170
00171 jacobian[1][0] = -timeStep*df2_dx1;
00172 jacobian[1][1] = 1-timeStep*df2_dx2;
00173 jacobian[1][3] = -timeStep*df2_dx4;
00174 jacobian[1][5] = -timeStep*df2_dx6;
00175
00176
00177 double z = x1*x6/mJ5;
00178 double df3_dx1 = (mK5dd*x6/mJ5)*mN*pow(z,mN-1)/(pow((1-pow(z,mN)),2));
00179 double df3_dx3 = -mK6;
00180 double df3_dx6 = (mK5dd*x1/mJ5)*mN*pow(z,mN-1)/(pow((1-pow(z,mN)),2));
00181
00182 jacobian[2][0] = -timeStep*df3_dx1;
00183 jacobian[2][2] = 1-timeStep*df3_dx3;
00184 jacobian[2][5] = -timeStep*df3_dx6;
00185
00186
00187 double df4_dx3 = mJ7*mK7*x5/(pow(mJ7+x3-x4,2));
00188 double df4_dx4 = -mJ7*mK7*x5/(pow(mJ7+x3-x4,2)) - mK6 - mJ8*mK8*mMad/(pow(mJ8+x4,2));
00189 double df4_dx5 = mK7*(x3-x4)/(mJ7+x3-x4);
00190
00191 jacobian[3][2] = -timeStep*df4_dx3;
00192 jacobian[3][3] = 1-timeStep*df4_dx4;
00193 jacobian[3][4] = -timeStep*df4_dx5;
00194
00195
00196 double df5_dx1 = mK9*x6*(1-x5);
00197 double df5_dx5 = -mK10 - mK9*x6*x1;
00198 double df5_dx6 = mK9*x1*(1-x5);
00199
00200 jacobian[4][0] = -timeStep*df5_dx1;
00201 jacobian[4][4] = 1-timeStep*df5_dx5;
00202 jacobian[4][5] = -timeStep*df5_dx6;
00203
00204
00205 double df6_dx6 = mMu - 2*mMu*x6/mMstar;
00206
00207 jacobian[5][5] = 1-timeStep*df6_dx6;
00208 }
00209
00210 bool TysonNovak2001OdeSystem::CalculateStoppingEvent(double time, const std::vector<double>& rY)
00211 {
00212 std::vector<double> dy(rY.size());
00213 EvaluateYDerivatives(time, rY, dy);
00214
00215
00216
00217 return ( (rY[5] > 0.6 )&& (rY[0] < mCycB_threshold) && dy[0] < 0.0 );
00218 }
00219
00220 double TysonNovak2001OdeSystem::CalculateRootFunction(double time, const std::vector<double>& rY)
00221 {
00222 std::vector<double> dy(rY.size());
00223 EvaluateYDerivatives(time, rY, dy);
00224
00225
00226
00227 if (rY[5]<0.6)
00228 {
00229 return 1.0;
00230 }
00231
00232 if (dy[0] >= 0.0)
00233 {
00234 return 1.0;
00235 }
00236 return rY[0]-mCycB_threshold;
00237 }
00238
00239 template<>
00240 void OdeSystemInformation<TysonNovak2001OdeSystem>::Initialise()
00241 {
00242
00243
00244
00245
00246
00247
00248
00249 this->mVariableNames.push_back("CycB");
00250 this->mVariableUnits.push_back("nM");
00251
00252 this->mInitialConditions.push_back(0.099999999999977);
00253
00254 this->mVariableNames.push_back("Cdh1");
00255 this->mVariableUnits.push_back("nM");
00256
00257 this->mInitialConditions.push_back(0.989026454281841);
00258
00259 this->mVariableNames.push_back("Cdc20T");
00260 this->mVariableUnits.push_back("nM");
00261
00262 this->mInitialConditions.push_back(1.547942029285891);
00263
00264 this->mVariableNames.push_back("Cdc20A");
00265 this->mVariableUnits.push_back("nM");
00266
00267 this->mInitialConditions.push_back(1.421110920135839);
00268
00269 this->mVariableNames.push_back("IEP");
00270 this->mVariableUnits.push_back("nM");
00271
00272 this->mInitialConditions.push_back(0.672838844290094);
00273
00274 this->mVariableNames.push_back("mass");
00275 this->mVariableUnits.push_back("");
00276
00277 this->mInitialConditions.push_back(0.970831277863956 / 2);
00278
00279 this->mInitialised = true;
00280 }