#include <ordinary_differential_equations.h>
Definition at line 38 of file ordinary_differential_equations.h.
Enumeration of available methods for numerical integration of ordinary differential equations.
Definition at line 75 of file ordinary_differential_equations.h.
OpenNN::OrdinaryDifferentialEquations::OrdinaryDifferentialEquations | ( | void | ) | [explicit] |
Default constructor. It constructs a default ordinary differential equations object.
Definition at line 39 of file ordinary_differential_equations.cpp.
OpenNN::OrdinaryDifferentialEquations::OrdinaryDifferentialEquations | ( | TiXmlElement * | ordinary_differential_equations_element | ) | [explicit] |
XML constructor. It creates a ordinary differential equations mathematical modeel and loads its members from a Tiny XML element.
ordinary_differential_equations_element | Pointer to a XML element containing the member data. |
Definition at line 51 of file ordinary_differential_equations.cpp.
OpenNN::OrdinaryDifferentialEquations::OrdinaryDifferentialEquations | ( | const std::string & | filename | ) | [explicit] |
File constructor. It creates an ordinary differential equations mathematical model and loads its members from a XML file.
filename | Name of XML file. |
Definition at line 64 of file ordinary_differential_equations.cpp.
OpenNN::OrdinaryDifferentialEquations::OrdinaryDifferentialEquations | ( | const OrdinaryDifferentialEquations & | other_ordinary_differential_equations | ) |
Copy constructor. It creates an ordinary differential equations mathematical model object and copies its members from another object.
other_ordinary_differential_equations | Ordinary differential equations object to be copied. |
Definition at line 77 of file ordinary_differential_equations.cpp.
OpenNN::OrdinaryDifferentialEquations::~OrdinaryDifferentialEquations | ( | void | ) | [virtual] |
Destructor. It does not delete any object.
Definition at line 89 of file ordinary_differential_equations.cpp.
OrdinaryDifferentialEquations & OpenNN::OrdinaryDifferentialEquations::operator= | ( | const OrdinaryDifferentialEquations & | other_ordinary_differential_equations | ) |
Assignment operator. It assigns to this object the members of an existing ordinary differential equations object.
other_ordinary_differential_equations | Ordinary differential equations object to be assigned. |
Definition at line 102 of file ordinary_differential_equations.cpp.
bool OpenNN::OrdinaryDifferentialEquations::operator== | ( | const OrdinaryDifferentialEquations & | other_ordinary_differential_equations | ) | const |
Equal to operator. It compares this object with another object of the same class. It returns true if the members of the two objects have the same values, and false otherwise.
other_ordinary_differential_equations | Object to be compared with. |
Definition at line 124 of file ordinary_differential_equations.cpp.
const double & OpenNN::OrdinaryDifferentialEquations::get_initial_independent_variable | ( | void | ) | const |
This method returns the initial value of the independent variable.
Definition at line 145 of file ordinary_differential_equations.cpp.
const double & OpenNN::OrdinaryDifferentialEquations::get_final_independent_variable | ( | void | ) | const |
This method returns the final value of the independent variable.
Definition at line 155 of file ordinary_differential_equations.cpp.
const Vector< double > & OpenNN::OrdinaryDifferentialEquations::get_initial_dependent_variables | ( | void | ) | const |
This method returns the initial values of the independent variables.
Definition at line 165 of file ordinary_differential_equations.cpp.
const double & OpenNN::OrdinaryDifferentialEquations::get_initial_dependent_variable | ( | const unsigned int & | i | ) | const |
This method returns the initial value of a single independent variable.
i | Index of dependent variable. |
Definition at line 176 of file ordinary_differential_equations.cpp.
const OrdinaryDifferentialEquations::SolutionMethod & OpenNN::OrdinaryDifferentialEquations::get_solution_method | ( | void | ) | const |
This method returns the numerical method to be used for integration of the ordinary differential equation.
Definition at line 186 of file ordinary_differential_equations.cpp.
std::string OpenNN::OrdinaryDifferentialEquations::write_solution_method | ( | void | ) | const |
This method returns a string with the name of the numerical method to be used for integration of the ordinary differential equation.
Definition at line 196 of file ordinary_differential_equations.cpp.
const unsigned int & OpenNN::OrdinaryDifferentialEquations::get_points_number | ( | void | ) | const |
This method returns the number of integration points in the Runge-Kutta method.
Definition at line 223 of file ordinary_differential_equations.cpp.
const double & OpenNN::OrdinaryDifferentialEquations::get_tolerance | ( | void | ) | const |
This method returns the tolerance in the Runge-Kutta-Fehlberg method.
Definition at line 233 of file ordinary_differential_equations.cpp.
const unsigned int & OpenNN::OrdinaryDifferentialEquations::get_initial_size | ( | void | ) | const |
This method returns the initial size to be reserved for the solutions in the Runge-Kutta-Fehlberg method.
Definition at line 243 of file ordinary_differential_equations.cpp.
const unsigned int & OpenNN::OrdinaryDifferentialEquations::get_warning_size | ( | void | ) | const |
This method returns a warning size for the solutions in the Runge-Kutta-Fehlberg method.
Definition at line 253 of file ordinary_differential_equations.cpp.
const unsigned int & OpenNN::OrdinaryDifferentialEquations::get_error_size | ( | void | ) | const |
This method returns an error size for the solutions in the Runge-Kutta-Fehlberg method.
Definition at line 263 of file ordinary_differential_equations.cpp.
void OpenNN::OrdinaryDifferentialEquations::set | ( | const OrdinaryDifferentialEquations & | other_ordinary_differential_equations | ) |
This method sets the members of this object to be the members of another object of the same class.
other_ordinary_differential_equations | Object to be copied. |
Definition at line 274 of file ordinary_differential_equations.cpp.
void OpenNN::OrdinaryDifferentialEquations::set_initial_independent_variable | ( | const double & | new_initial_independent_variable | ) |
This method sets the initial value for the independent variable.
new_initial_independent_variable | Initial value for the independent variable. |
Definition at line 303 of file ordinary_differential_equations.cpp.
void OpenNN::OrdinaryDifferentialEquations::set_final_independent_variable | ( | const double & | new_final_independent_variable | ) |
This method sets the final value for the independent variable.
new_final_independent_variable | Final value for the independent variable. |
Definition at line 314 of file ordinary_differential_equations.cpp.
void OpenNN::OrdinaryDifferentialEquations::set_initial_dependent_variables | ( | const Vector< double > & | new_initial_dependent_variables | ) |
This method sets the initial values for the dependent variables.
new_initial_dependent_variables | Initial values for the dependent variables. |
Definition at line 325 of file ordinary_differential_equations.cpp.
void OpenNN::OrdinaryDifferentialEquations::set_initial_dependent_variable | ( | const unsigned int & | i, | |
const double & | new_initial_dependent_variable | |||
) |
This method sets the initial value for a single dependent variable.
i | Index of dependent variable. | |
new_initial_dependent_variable | Initial value for the corresponding dependent variable. |
Definition at line 337 of file ordinary_differential_equations.cpp.
void OpenNN::OrdinaryDifferentialEquations::set_solution_method | ( | const SolutionMethod & | new_solution_method | ) |
This method sets the numerical method for calculating the solution to the ordinary differential equations. Available methos include the Runge-Kutta and Runge-Kutta-Fehlber methods.
new_solution_method | Solution method. |
Definition at line 349 of file ordinary_differential_equations.cpp.
void OpenNN::OrdinaryDifferentialEquations::set_solution_method | ( | const std::string & | new_solution_method | ) |
This method sets the numerical method for calculating the solution to the ordinary differential equations. Available methos include the Runge-Kutta and Runge-Kutta-Fehlber methods.
new_solution_method | String with the name of the solution method ("RungeKutta" or "RungeKuttaFehlberg"). |
Definition at line 361 of file ordinary_differential_equations.cpp.
void OpenNN::OrdinaryDifferentialEquations::set_points_number | ( | const unsigned int & | new_points_number | ) |
This method sets the number of points in the Runge-Kutta method.
new_points_number | Number of points. |
Definition at line 389 of file ordinary_differential_equations.cpp.
void OpenNN::OrdinaryDifferentialEquations::set_tolerance | ( | const double & | new_tolerance | ) |
This method sets the tolerance in the Runge-Kutta-Fehlberg method.
new_tolerance | Tolerance value. |
Definition at line 400 of file ordinary_differential_equations.cpp.
void OpenNN::OrdinaryDifferentialEquations::set_initial_size | ( | const unsigned int & | new_initial_size | ) |
This method sets the initial size for the solution in the Runge-Kutta-Fehlberg method.
new_initial_size | Initial solution size. |
Definition at line 411 of file ordinary_differential_equations.cpp.
void OpenNN::OrdinaryDifferentialEquations::set_warning_size | ( | const unsigned int & | new_warning_size | ) |
This method sets a warning size for the solution in the Runge-Kutta-Fehlberg method.
new_warning_size | Warning solution size. |
Definition at line 422 of file ordinary_differential_equations.cpp.
void OpenNN::OrdinaryDifferentialEquations::set_error_size | ( | const unsigned int & | new_error_size | ) |
This method sets the error size for the solution in the Runge-Kutta-Fehlberg method.
new_error_size | Error solution size. |
Definition at line 433 of file ordinary_differential_equations.cpp.
void OpenNN::OrdinaryDifferentialEquations::set_default | ( | void | ) | [virtual] |
This method sets the following default values:
Reimplemented from OpenNN::MathematicalModel.
Definition at line 454 of file ordinary_differential_equations.cpp.
virtual Vector<double> OpenNN::OrdinaryDifferentialEquations::calculate_dependent_variables_dots | ( | const NeuralNetwork & | , | |
const Vector< double > & | ||||
) | const [pure virtual] |
This pure virtual method calculates the derivatives of the dependent variables with respect to the independent variable.
Matrix< double > OpenNN::OrdinaryDifferentialEquations::calculate_Runge_Kutta_solution | ( | const NeuralNetwork & | neural_network | ) | const |
This method calculate the numerical solution of the ordinary differential equations model using the Runge-Kutta method.
neural_network | Neural network which represents the external inputs to the mathematical model. |
Definition at line 479 of file ordinary_differential_equations.cpp.
Vector< double > OpenNN::OrdinaryDifferentialEquations::calculate_Runge_Kutta_final_solution | ( | const NeuralNetwork & | neural_network | ) | const |
This method calculate the solution at the final independent variable of the ordinary differential equations model using the Runge-Kutta method.
neural_network | Neural network which represents the external inputs to the mathematical model. |
Definition at line 571 of file ordinary_differential_equations.cpp.
Matrix< double > OpenNN::OrdinaryDifferentialEquations::calculate_Runge_Kutta_Fehlberg_solution | ( | const NeuralNetwork & | neural_network | ) | const |
This method calculate the numerical solution of the ordinary differential equations model using the Runge-Kutta method.
neural_network | Neural network which represents the external inputs to the mathematical model. |
Definition at line 661 of file ordinary_differential_equations.cpp.
Vector< double > OpenNN::OrdinaryDifferentialEquations::calculate_Runge_Kutta_Fehlberg_final_solution | ( | const NeuralNetwork & | neural_network | ) | const |
This method calculate the numerical solution of the ordinary differential equations model using the Runge-Kutta-Fehlberg method.
neural_network | Neural network which represents the external inputs to the mathematical model. |
Definition at line 894 of file ordinary_differential_equations.cpp.
Matrix< double > OpenNN::OrdinaryDifferentialEquations::calculate_solutions | ( | const NeuralNetwork & | ) | const [virtual] |
This virtual method returns the solutions to the mathematical model, which are given by the independent and the dependent variables. This method needs to be derived, otherwise an exception is thrown.
Reimplemented from OpenNN::MathematicalModel.
Definition at line 1092 of file ordinary_differential_equations.cpp.
Vector< double > OpenNN::OrdinaryDifferentialEquations::calculate_final_solutions | ( | const NeuralNetwork & | ) | const [virtual] |
This virtual method returns the final solutions of the mathematical model, which are given by the final independent and dependent variables. This method needs to be derived, otherwise an exception is thrown.
Reimplemented from OpenNN::MathematicalModel.
Definition at line 1125 of file ordinary_differential_equations.cpp.
std::string OpenNN::OrdinaryDifferentialEquations::to_string | ( | void | ) | const [virtual] |
This method returns a string representation of the current ordinary differential equations object.
Reimplemented from OpenNN::MathematicalModel.
Definition at line 1160 of file ordinary_differential_equations.cpp.
TiXmlElement * OpenNN::OrdinaryDifferentialEquations::to_XML | ( | void | ) | const [virtual] |
This method serializes the ordinary differential equations object into a XML element of the TinyXML library. See the OpenNN manual for more information about the format of this element.
Reimplemented from OpenNN::MathematicalModel.
Definition at line 1187 of file ordinary_differential_equations.cpp.
void OpenNN::OrdinaryDifferentialEquations::from_XML | ( | TiXmlElement * | ordinary_differential_equations_element | ) | [virtual] |
This method deserializes a TinyXML element into this ordinary differential equations object.
ordinary_differential_equations_element | Pointer to a XML element containing the member data. |
Reimplemented from OpenNN::MathematicalModel.
Definition at line 1344 of file ordinary_differential_equations.cpp.
void OpenNN::OrdinaryDifferentialEquations::save_data | ( | const NeuralNetwork & | , | |
const std::string & | ||||
) | const [virtual] |
Reimplemented from OpenNN::MathematicalModel.
Definition at line 1602 of file ordinary_differential_equations.cpp.
double OpenNN::OrdinaryDifferentialEquations::initial_independent_variable [protected] |
Initial value for the only independent variable.
Definition at line 152 of file ordinary_differential_equations.h.
double OpenNN::OrdinaryDifferentialEquations::final_independent_variable [protected] |
Final value for the only independent variable.
Definition at line 156 of file ordinary_differential_equations.h.
Vector<double> OpenNN::OrdinaryDifferentialEquations::initial_dependent_variables [protected] |
Initial values for the dependent variables.
Definition at line 160 of file ordinary_differential_equations.h.
Numerical integration method (Runge-Kutta or Runge-Kutta-Fehlberg).
Definition at line 164 of file ordinary_differential_equations.h.
unsigned int OpenNN::OrdinaryDifferentialEquations::points_number [protected] |
Number of points in the Runge-Kutta method.
Definition at line 168 of file ordinary_differential_equations.h.
double OpenNN::OrdinaryDifferentialEquations::tolerance [protected] |
Tolerance in the Runge-Kutta-Fehlberg method.
Definition at line 172 of file ordinary_differential_equations.h.
unsigned int OpenNN::OrdinaryDifferentialEquations::initial_size [protected] |
Initial number of points in the Runge-Kutta-Fehlberg method.
Definition at line 176 of file ordinary_differential_equations.h.
unsigned int OpenNN::OrdinaryDifferentialEquations::warning_size [protected] |
Number of points at which the the Runge-Kutta-Fehlberg method displays a warning message.
Definition at line 180 of file ordinary_differential_equations.h.
unsigned int OpenNN::OrdinaryDifferentialEquations::error_size [protected] |
Number of points at which the the Runge-Kutta-Fehlberg method throws an exception.
Definition at line 184 of file ordinary_differential_equations.h.