svZeroDSolver
Loading...
Searching...
No Matches
TwoHillActivation Class Reference

Two hill activation function. More...

#include <ActivationFunction.h>

Inheritance diagram for TwoHillActivation:
[legend]

Public Member Functions

 TwoHillActivation (double cardiac_period)
 Construct with default parameter values (loader fills via set_param).
double compute (double time) override
 Compute activation value at given time.
void finalize () override
 Called once after all parameters have been read from the input file (e.g. by the loader).
Public Member Functions inherited from ActivationFunction
 ActivationFunction (double cardiac_period, const std::vector< std::pair< std::string, InputParameter > > &input_param_properties)
 Construct activation function.
virtual ActivationSignalType signal_type () const
 Type of signal this activation function's compute() produces.
Public Member Functions inherited from ParameterHolder
 ParameterHolder (const std::vector< std::pair< std::string, InputParameter > > &props)
 Construct a ParameterHolder.
void set_param (const std::string &name, double value)
 Set a scalar parameter value by name.
void set_param_vector (const std::string &name, const std::vector< double > &value)
 Set a vector-valued parameter value by name.

Additional Inherited Members

Static Public Member Functions inherited from ActivationFunction
static std::unique_ptr< ActivationFunction > create_default (const std::string &type_str, double cardiac_period)
 Create a default activation function from activation function type.
Public Attributes inherited from ParameterHolder
const std::vector< std::pair< std::string, InputParameter > > input_param_properties
 Properties of the input parameters for this component [(name, InputParameter), ...].
Protected Attributes inherited from ActivationFunction
double cardiac_period_
 Time duration of one cardiac cycle.
Protected Attributes inherited from ParameterHolder
std::map< std::string, double > params_
 Map of scalar parameter names to their values.
std::map< std::string, std::vector< double > > params_vec_
 Map of vector-valued parameter names to their values.

Detailed Description

Two hill activation function.

This implements the two-hill activation function which provides more flexible and physiologically realistic waveforms. See https://link.springer.com/article/10.1007/s10439-022-03047-3

The activation is computed as:

\‍[A(t) = C \cdot \frac{g_1(t)}{1 + g_1(t)} \cdot \frac{1}{1 + g_2(t)}
\‍]

where:

\‍[g_1(t) = \left(\frac{t_{shifted}}{\tau_1}\right)^{m_1}, \quad
g_2(t) = \left(\frac{t_{shifted}}{\tau_2}\right)^{m_2}
\‍]

and $t_{shifted} = (t - t_{shift}) \bmod T_{cardiac}$, and $C$ is a normalization constant to ensure max activation is 1.

Constructor & Destructor Documentation

◆ TwoHillActivation()

TwoHillActivation::TwoHillActivation ( double cardiac_period)
inlineexplicit

Construct with default parameter values (loader fills via set_param).

Parameters
cardiac_periodCardiac cycle period

Member Function Documentation

◆ compute()

double TwoHillActivation::compute ( double time)
overridevirtual

Compute activation value at given time.

Parameters
timeCurrent time
Returns
Activation value between 0 and 1

Implements ActivationFunction.

◆ finalize()

void TwoHillActivation::finalize ( )
overridevirtual

Called once after all parameters have been read from the input file (e.g. by the loader).

Default no-op; subclasses override to validate the parameters they were given or precompute derived values (e.g. normalization constants).

Reimplemented from ParameterHolder.


The documentation for this class was generated from the following files: