00001 /* 00002 00003 Copyright (C) University of Oxford, 2005-2010 00004 00005 University of Oxford means the Chancellor, Masters and Scholars of the 00006 University of Oxford, having an administrative office at Wellington 00007 Square, Oxford OX1 2JD, UK. 00008 00009 This file is part of Chaste. 00010 00011 Chaste is free software: you can redistribute it and/or modify it 00012 under the terms of the GNU Lesser General Public License as published 00013 by the Free Software Foundation, either version 2.1 of the License, or 00014 (at your option) any later version. 00015 00016 Chaste is distributed in the hope that it will be useful, but WITHOUT 00017 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 00018 FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public 00019 License for more details. The offer of Chaste under the terms of the 00020 License is subject to the License being interpreted in accordance with 00021 English Law and subject to any action against the University of Oxford 00022 being under the jurisdiction of the English Courts. 00023 00024 You should have received a copy of the GNU Lesser General Public License 00025 along with Chaste. If not, see <http://www.gnu.org/licenses/>. 00026 00027 */ 00028 00029 #ifndef NASH2004CONTRACTIONMODEL_HPP_ 00030 #define NASH2004CONTRACTIONMODEL_HPP_ 00031 00032 #include "AbstractOdeBasedContractionModel.hpp" 00033 #include "OdeSystemInformation.hpp" 00034 #include "Exception.hpp" 00035 00053 class Nash2004ContractionModel : public AbstractOdeBasedContractionModel 00054 { 00056 static const double kTa; 00057 00059 static const double e0ByT0; 00060 00062 double mScaledVoltage; 00063 00064 public: 00066 Nash2004ContractionModel() : AbstractOdeBasedContractionModel(1) 00067 { 00068 this->mpSystemInfo = OdeSystemInformation<Nash2004ContractionModel>::Instance(); 00069 00070 mScaledVoltage = 0.0; 00071 this->mStateVariables.push_back(0.0); 00072 } 00073 00080 void EvaluateYDerivatives(double time, const std::vector<double>& rY, std::vector<double>& rDY) 00081 { 00082 double epsilon = (mScaledVoltage < 0.05 ? e0ByT0 : 10*e0ByT0); 00083 rDY[0] = epsilon * (kTa*mScaledVoltage - rY[0]); 00084 } 00085 00090 void SetInputParameters(ContractionModelInputParameters& rInputParameters) 00091 { 00092 assert(rInputParameters.voltage != DOUBLE_UNSET); 00093 mScaledVoltage = (rInputParameters.voltage+85)/125; 00094 } 00095 00101 void SetStretchAndStretchRate(double stretch, double stretchRate) 00102 { 00103 } 00104 00108 double GetActiveTension() 00109 { 00110 return rGetStateVariables()[0]; 00111 } 00112 00117 double GetNextActiveTension() 00118 { 00119 return mTemporaryStateVariables[0]; 00120 } 00121 00122 00126 bool IsStretchDependent() 00127 { 00128 return false; 00129 } 00130 00134 bool IsStretchRateDependent() 00135 { 00136 return false; 00137 } 00138 }; 00139 00140 00141 00142 #endif /*NASH2004CONTRACTIONMODEL_HPP_*/