42 #ifndef SVK_2_SITE_IM_COST_COST_FUNCTION_H
43 #define SVK_2_SITE_IM_COST_COST_FUNCTION_H
73 this->InitNumberOfSignals();
84 float Rinj = parameters[0];
85 float Kpyr = parameters[1];
86 float Tarrival = parameters[2];
87 float Kpl = parameters[3];
88 float Klac = parameters[4];
89 float dc = parameters[5];
91 float injectionDuration = 14/3;
92 int Tend =
static_cast<int>( roundf(Tarrival + injectionDuration) );
93 Tarrival =
static_cast<int>( roundf(Tarrival) );
103 for (
int t = 0; t < this->numTimePoints; t++ ) {
105 if ( t < Tarrival ) {
106 this->GetModelSignal(PYR)[t] = 0;
107 this->GetModelSignal(LAC)[t] = 0;
110 if ( Tarrival <= t < Tend) {
113 this->GetModelSignal(PYR)[t] = (Rinj/Kpyr) * (1 - exp( -1 * Kpyr * (t - Tarrival)) ) + dc;
116 this->GetModelSignal(LAC)[t] = ( (Kpl * Rinj)/(Kpyr - Klac) )
118 ( ( 1 - exp( -1 * Klac * ( t - Tarrival)) )/Klac )
119 - ( ( 1 - exp( -1 * Kpyr * ( t - Tarrival)) )/Kpyr )
126 this->GetModelSignal(PYR)[t] = this->GetSignalAtTime(PYR, Tend) * (exp( -1 * Kpyr * ( t - Tend) ) ) + dc;
129 this->GetModelSignal(LAC)[t] = ( ( this->GetSignalAtTime(LAC, Tend) * Kpl ) / ( Kpyr - Klac ) )
130 * ( exp( -1 * Klac * (t-Tend)) - exp( -1 * Kpyr * (t-Tend)) )
131 + this->GetSignalAtTime(LAC, Tend) * exp ( -1 * Klac * ( t - Tend)) + dc;
146 int numParameters = 6;
147 return numParameters;
157 this->SetNumberOfSignals(2);
166 outputDescriptionVector->resize( this->GetNumberOfOutputPorts() );
167 (*outputDescriptionVector)[0] =
"pyr";
168 (*outputDescriptionVector)[1] =
"lac";
170 (*outputDescriptionVector)[2] =
"Rinj";
171 (*outputDescriptionVector)[3] =
"Kpyr";
172 (*outputDescriptionVector)[4] =
"Tarrival";
174 (*outputDescriptionVector)[5] =
"Kpl";
175 (*outputDescriptionVector)[6] =
"Klac";
176 (*outputDescriptionVector)[7] =
"dcoffset";
188 upperBounds[0] = 100000000 * this->TR;
189 lowerBounds[0] = 1000 * this->TR;
191 upperBounds[1] = 0.20 * this->TR;
192 lowerBounds[1] = 0.0001 * this->TR;
194 upperBounds[2] = 0 / this->TR;
195 lowerBounds[2] = -4.00 / this->TR;
198 upperBounds[3] = 0.08 * this->TR;
199 lowerBounds[3] = 0.0001 * this->TR;
201 upperBounds[4] = 0.20 * this->TR;
202 lowerBounds[4] = 0.0001 * this->TR;
205 upperBounds[5] = 100000;
206 lowerBounds[5] = -100000;
215 if (this->TR == 0 ) {
216 cout <<
"ERROR: TR Must be set before initializing parameters" << endl;
220 (*initialPosition)[0] = 50000 * this->TR;
221 (*initialPosition)[1] = 0.15 * this->TR;
222 (*initialPosition)[2] = -3 / this->TR;
225 (*initialPosition)[3] = 0.01 * this->TR;
226 (*initialPosition)[4] = 0.05 * this->TR;
227 (*initialPosition)[5] = 70000;
236 if (this->TR == 0 ) {
237 cout <<
"ERROR: TR Must be set before scaling final parameters" << endl;
242 (*finalPosition)[0] /= this->TR;
243 (*finalPosition)[1] /= this->TR;
244 (*finalPosition)[2] *= this->TR;
247 (*finalPosition)[3] /= this->TR;
248 (*finalPosition)[4] /= this->TR;
257 #endif// SVK_2_SITE_IM_COST_COST_FUNCTION_H
Definition: svk2SiteIMCostFunction.h:59
Definition: svkKineticModelCostFunction.h:53
svk2SiteIMCostFunction()
Definition: svk2SiteIMCostFunction.h:71
virtual void InitNumberOfSignals(void)
Definition: svk2SiteIMCostFunction.h:154
virtual void InitOutputDescriptionVector(vector< string > *outputDescriptionVector) const
Definition: svk2SiteIMCostFunction.h:164
svk2SiteIMCostFunction Self
Definition: svk2SiteIMCostFunction.h:64
Superclass::ParametersType ParametersType
Definition: svkKineticModelCostFunction.h:64
virtual void GetParamFinalScaledPosition(ParametersType *finalPosition)
Definition: svk2SiteIMCostFunction.h:234
virtual void InitParamInitialPosition(ParametersType *initialPosition)
Definition: svk2SiteIMCostFunction.h:213
virtual void GetKineticModel(const ParametersType ¶meters) const
Definition: svk2SiteIMCostFunction.h:81
virtual void InitParamBounds(float *lowerBounds, float *upperBounds)
Definition: svk2SiteIMCostFunction.h:184
virtual unsigned int GetNumberOfParameters(void) const
Definition: svk2SiteIMCostFunction.h:144