6 using namespace Input::Type;
9 =
Record(
"LinearODEAnalytic",
"Evaluate analytic solution of the system of ODEs.")
25 step_changed_ =
false;
28 output_vec = solution_matrix_ * init_vector;
35 ASSERT(system_matrix_.n_cols == system_matrix_.n_rows,
"Matrix is not square.");
36 solution_matrix_.copy_size(system_matrix_);
38 double exponential, temp;
39 for(
unsigned int i = 0; i < solution_matrix_.n_rows; i++)
41 exponential = std::exp(system_matrix_(i,i) * step_);
42 for(
unsigned int j = 0; j < solution_matrix_.n_cols; j++)
45 if( (i != j) && (system_matrix_(i,i) != 0.0) )
46 temp = -system_matrix_(j,i)/system_matrix_(i,i);
48 solution_matrix_(j,i) = (1-exponential)*temp;
50 solution_matrix_(i,i) = exponential;
static Input::Type::AbstractRecord input_type
void update_solution(arma::vec &init_vector, arma::vec &output_vec) override
Updates solution of the ODEs system.
#define START_TIMER(tag)
Starts a timer with specified tag.
~LinearODEAnalytic(void)
Destructor.
LinearODEAnalytic()
Default constructor is possible because the input record is not needed.
static Input::Type::Record input_type