42 #include "AbstractCvodeCellWithDataClamp.hpp"
44 #include "HeartConfig.hpp"
50 unsigned numberOfStateVariables,
51 unsigned voltageIndex,
52 boost::shared_ptr<AbstractStimulusFunction> pIntracellularStimulus)
53 :
AbstractCvodeCell(pSolver, numberOfStateVariables, voltageIndex, pIntracellularStimulus),
54 mDataAvailable(false),
64 std::vector<double> experimentalVoltages)
66 assert(experimentalVoltages.size()==experimentalTimes.size());
67 assert(experimentalVoltages.size()>1u);
83 EXCEPTION(
"The requested time " << rTime <<
" is outside the times stored in the data clamp.");
86 std::vector<double>::iterator low;
97 if (upper_index == 0u)
104 double increment = rTime - lower_time;
107 return mExperimentalVoltages[upper_index-1] + increment * voltage_step / time_step;
129 this->
SetParameter(
"membrane_data_clamp_current_conductance",0);
137 EXCEPTION(
"Before calling TurnOnDataClamp(), please provide experimental data via the SetExperimentalData() method.");
140 this->
SetParameter(
"membrane_data_clamp_current_conductance", conductance);
144 #endif // CHASTE_CVODEWITHDATACLAMP
AbstractCvodeCellWithDataClamp(boost::shared_ptr< AbstractIvpOdeSolver > pSolver, unsigned numberOfStateVariables, unsigned voltageIndex, boost::shared_ptr< AbstractStimulusFunction > pIntracellularStimulus)
#define EXCEPTION(message)
void SetParameter(const std::string &rParameterName, double value)
std::vector< double > mExperimentalVoltages
const double DOUBLE_UNSET
virtual ~AbstractCvodeCellWithDataClamp()
double GetExperimentalVoltageAtTimeT(const double &rTime)
void SetExperimentalData(std::vector< double > experimentalTimes, std::vector< double > experimentalVoltages)
void TurnOnDataClamp(double conductance=100)
std::vector< double > mExperimentalTimes