13 #ifndef MITKTWOCOMPARTMENTEXCHANGEMODELDIFFERENTIALEQUATIONS_H 14 #define MITKTWOCOMPARTMENTEXCHANGEMODELDIFFERENTIALEQUATIONS_H 41 double Ca_t = InterpolateAIFToCurrentTimeStep(t);
44 dxdt[0] = (1/this->vp) * ( this->F*(Ca_t - x[0]) - this->PS*(x[0] - x[1]) );
45 dxdt[1] = (1/this->ve) * this->PS * (x[0] - x[1]);
54 void initialize(
double Fp,
double ps,
double fi,
double fp)
71 this->m_AIFTimeGrid = grid;
82 AIFType m_AIFTimeGrid;
89 double InterpolateAIFToCurrentTimeStep(
double t)
91 double lastValue = m_AIF[0];
94 AIFType::const_iterator posITime = m_AIFTimeGrid.begin();
95 AIFType::const_iterator posValue = m_AIF.begin();
99 lastValue = *posValue;
100 lastTime = *posITime;
104 double weightLast = 1 - (t - lastTime)/(*posITime - lastTime);
105 double weightNext = 1- (*posITime - t)/(*posITime - lastTime);
106 double result = weightLast * lastValue + weightNext * (*posValue);
114 #endif // MITKTWOCOMPARTMENTEXCHANGEMODELDIFFERENTIALEQUATIONS_H std::vector< double > AIFType
TwoCompartmentExchangeModelDifferentialEquations()
DataCollection - Class to facilitate loading/accessing structured data.
Helper Class for NumericTwoCompartmentExchangeModel: Defines the differential equations (Mass Balance...
void operator()(const mitk::NumericTwoCompartmentExchangeModel::state_type &x, mitk::NumericTwoCompartmentExchangeModel::state_type &dxdt, const double t)
Functor for differential equation of Physiological Pharmacokinetic Brix Model Takes current state x =...
void setAIFTimeGrid(AIFType &grid)
void initialize(double Fp, double ps, double fi, double fp)
Initialize class with parameters F/Vp, PS/Vp, fi and fp that are free fit parameters.
std::vector< double > state_type
void setAIF(AIFType &aif)