42 #ifndef SVK_2_SITE_IM_PYR_COST_COST_FUNCTION_H
43 #define SVK_2_SITE_IM_PYR_COST_COST_FUNCTION_H
78 this->InitNumberOfSignals();
89 float Rinj = parameters[0];
90 float Kpyr = parameters[1];
91 float Tarrival = parameters[2];
93 float injectionDuration = 14/3;
97 int Tend =
static_cast<int>( roundf(Tarrival + injectionDuration) );
98 Tarrival =
static_cast<int>( roundf(Tarrival) );
108 for (
int t = 0; t < this->numTimePoints; t++ ) {
110 if ( t < Tarrival ) {
111 cout <<
"PRE T ARRIVAL" << endl;
112 this->GetModelSignal(PYR)[t] = 0.;
115 if ( Tarrival <= t < Tend) {
117 this->GetModelSignal(PYR)[t] = (Rinj/Kpyr) * (1 - exp( -1 * Kpyr * (t - Tarrival)) ) ;
122 this->GetModelSignal(PYR)[t] = this->GetSignalAtTime(PYR, Tend) * (exp( -1 * Kpyr * ( t - Tend) ) );
137 int numParameters = 3;
138 return numParameters;
148 this->SetNumberOfSignals(1);
157 outputDescriptionVector->resize( this->GetNumberOfOutputPorts() );
159 (*outputDescriptionVector)[0] =
"pyr";
162 (*outputDescriptionVector)[1] =
"Rinj";
163 (*outputDescriptionVector)[2] =
"Kpyr";
164 (*outputDescriptionVector)[3] =
"Tarrival";
175 upperBounds[0] = 100000000 * this->TR;
176 lowerBounds[0] = 10000 * this->TR;
178 upperBounds[1] = 0.20 * this->TR;
179 lowerBounds[1] = 0.0001 * this->TR;
181 upperBounds[2] = 0 / this->TR;
182 lowerBounds[2] = -4.00 / this->TR;
191 if (this->TR == 0 ) {
192 cout <<
"ERROR: TR Must be set before initializing parameters" << endl;
196 (*initialPosition)[0] = 50000 * this->TR;
197 (*initialPosition)[1] = 0.05 * this->TR;
198 (*initialPosition)[2] = -3 / this->TR;
207 if (this->TR == 0 ) {
208 cout <<
"ERROR: TR Must be set before scaling final parameters" << endl;
213 (*finalPosition)[0] /= this->TR;
214 (*finalPosition)[1] /= this->TR;
215 (*finalPosition)[2] *= this->TR;
225 #endif// SVK_2_SITE_IM_PYR_COST_COST_FUNCTION_H
Definition: svkKineticModelCostFunction.h:53
Definition: svk2SiteIMPyrCostFunction.h:64
virtual void GetParamFinalScaledPosition(ParametersType *finalPosition)
Definition: svk2SiteIMPyrCostFunction.h:205
virtual void InitParamInitialPosition(ParametersType *initialPosition)
Definition: svk2SiteIMPyrCostFunction.h:189
virtual void GetKineticModel(const ParametersType ¶meters) const
Definition: svk2SiteIMPyrCostFunction.h:86
virtual void InitNumberOfSignals(void)
Definition: svk2SiteIMPyrCostFunction.h:145
svk2SiteIMPyrCostFunction()
Definition: svk2SiteIMPyrCostFunction.h:76
virtual void InitOutputDescriptionVector(vector< string > *outputDescriptionVector) const
Definition: svk2SiteIMPyrCostFunction.h:155
Superclass::ParametersType ParametersType
Definition: svkKineticModelCostFunction.h:64
virtual unsigned int GetNumberOfParameters(void) const
Definition: svk2SiteIMPyrCostFunction.h:135
virtual void InitParamBounds(float *lowerBounds, float *upperBounds)
Definition: svk2SiteIMPyrCostFunction.h:172
svk2SiteIMPyrCostFunction Self
Definition: svk2SiteIMPyrCostFunction.h:69