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 00052 class Nash2004ContractionModel : public AbstractOdeBasedContractionModel 00053 { 00055 static const double kTa; 00056 00058 static const double e0ByT0; 00059 00061 double mScaledVoltage; 00062 00063 public: 00065 Nash2004ContractionModel() : AbstractOdeBasedContractionModel(1) 00066 { 00067 this->mpSystemInfo = OdeSystemInformation<Nash2004ContractionModel>::Instance(); 00068 00069 mScaledVoltage = 0.0; 00070 this->mStateVariables.push_back(0.0); 00071 } 00072 00079 void EvaluateYDerivatives(double time, const std::vector<double>& rY, std::vector<double>& rDY) 00080 { 00081 double epsilon = (mScaledVoltage < 0.05 ? e0ByT0 : 10*e0ByT0); 00082 rDY[0] = epsilon * (kTa*mScaledVoltage - rY[0]); 00083 } 00084 00089 void SetInputParameters(ContractionModelInputParameters& rInputParameters) 00090 { 00091 assert(rInputParameters.voltage != DOUBLE_UNSET); 00092 mScaledVoltage = (rInputParameters.voltage+85)/125; 00093 } 00094 00100 void SetStretchAndStretchRate(double stretch, double stretchRate) 00101 { 00102 } 00103 00107 double GetActiveTension() 00108 { 00109 return rGetStateVariables()[0]; 00110 } 00111 00116 double GetNextActiveTension() 00117 { 00118 return mTemporaryStateVariables[0]; 00119 } 00120 00121 00125 bool IsStretchDependent() 00126 { 00127 return false; 00128 } 00129 00133 bool IsStretchRateDependent() 00134 { 00135 return false; 00136 } 00137 }; 00138 00139 00140 00141 #endif /*NASH2004CONTRACTIONMODEL_HPP_*/