more ai generated doc with human review
This commit is contained in:
@@ -1,6 +1,13 @@
|
||||
/*! \file pimathsolver.h
|
||||
* \brief PIMathSolver
|
||||
*/
|
||||
//! \addtogroup Math
|
||||
//! \{
|
||||
//! \file pimathsolver.h
|
||||
//! \brief
|
||||
//! \~english Mathematical solver for differential equations
|
||||
//! \~russian Математический решатель дифференциальных уравнений
|
||||
//! \details
|
||||
//! \~english Solver for ordinary differential equations using various numerical methods
|
||||
//! \~russian Решатель обыкновенных дифференциальных уравнений с использованием различных численных методов
|
||||
//! \}
|
||||
/*
|
||||
PIP - Platform Independent Primitives
|
||||
PIMathSolver
|
||||
@@ -27,48 +34,83 @@
|
||||
|
||||
/// Differential evaluations
|
||||
|
||||
//! Transfer function representation
|
||||
//! \~english Structure representing transfer function with numerator and denominator coefficients
|
||||
//! \~russian Структура, представляющая передаточную функцию с коэффициентами числителя и знаменателя
|
||||
struct PIP_EXPORT TransferFunction {
|
||||
PIVector<double> vector_Bm, vector_An;
|
||||
};
|
||||
|
||||
//! Mathematical solver for differential equations
|
||||
//! \~\english Solver for ordinary differential equations using various numerical methods
|
||||
//! \~russian Решатель обыкновенных дифференциальных уравнений
|
||||
class PIP_EXPORT PIMathSolver {
|
||||
public:
|
||||
//! Solving methods for differential equations
|
||||
enum Method {
|
||||
Global = -1,
|
||||
Eyler_1 = 01,
|
||||
Eyler_2 = 02,
|
||||
EylerKoshi = 03,
|
||||
RungeKutta_4 = 14,
|
||||
AdamsBashfortMoulton_2 = 22,
|
||||
AdamsBashfortMoulton_3 = 23,
|
||||
AdamsBashfortMoulton_4 = 24,
|
||||
PolynomialApproximation_2 = 32,
|
||||
PolynomialApproximation_3 = 33,
|
||||
PolynomialApproximation_4 = 34,
|
||||
PolynomialApproximation_5 = 35
|
||||
Global = -1, //!< Use global method
|
||||
Eyler_1 = 01, //!< Euler method (first order)
|
||||
Eyler_2 = 02, //!< Euler method (second order)
|
||||
EylerKoshi = 03, //!< Euler-Cauchy method
|
||||
RungeKutta_4 = 14, //!< Runge-Kutta 4th order
|
||||
AdamsBashfortMoulton_2 = 22, //!< Adams-Bashforth-Moulton 2nd order
|
||||
AdamsBashfortMoulton_3 = 23, //!< Adams-Bashforth-Moulton 3rd order
|
||||
AdamsBashfortMoulton_4 = 24, //!< Adams-Bashforth-Moulton 4th order
|
||||
PolynomialApproximation_2 = 32, //!< Polynomial approximation 2nd order
|
||||
PolynomialApproximation_3 = 33, //!< Polynomial approximation 3rd order
|
||||
PolynomialApproximation_4 = 34, //!< Polynomial approximation 4th order
|
||||
PolynomialApproximation_5 = 35 //!< Polynomial approximation 5th order
|
||||
};
|
||||
|
||||
//! Constructs an empty solver
|
||||
PIMathSolver();
|
||||
|
||||
//! Solve differential equation with step h
|
||||
//! \~english Solve differential equation at point u with step h
|
||||
//! \~russian Решить дифференциальное уравнение в точке u с шагом h
|
||||
void solve(double u, double h);
|
||||
|
||||
//! Initialize from transfer function
|
||||
//! \~english Set up solver from transfer function coefficients
|
||||
//! \~russian Инициализировать решатель из коэффициентов передаточной функции
|
||||
void fromTF(const TransferFunction & TF);
|
||||
//! Set solving method
|
||||
//! \~english Set numerical method for solving
|
||||
//! \~russian Установить численный метод решения
|
||||
void setMethod(Method m) { method = m; }
|
||||
//! Set simulation time
|
||||
//! \~english Set simulation time
|
||||
//! \~russian Установить время моделирования
|
||||
void setTime(double time);
|
||||
|
||||
//! Solve using Euler method (1st order)
|
||||
void solveEyler1(double u, double h);
|
||||
//! Solve using Euler method (2nd order)
|
||||
void solveEyler2(double u, double h);
|
||||
//! Solve using Runge-Kutta 4th order
|
||||
void solveRK4(double u, double h);
|
||||
//! Solve using Adams-Bashforth-Moulton 2nd order
|
||||
void solveABM2(double u, double h);
|
||||
//! Solve using Adams-Bashforth-Moulton 3rd order
|
||||
void solveABM3(double u, double h);
|
||||
//! Solve using Adams-Bashforth-Moulton 4th order
|
||||
void solveABM4(double u, double h);
|
||||
//! Solve using polynomial approximation
|
||||
void solvePA(double u, double h, uint deg);
|
||||
//! Solve using polynomial approximation 2nd order
|
||||
void solvePA2(double u, double h);
|
||||
//! Solve using polynomial approximation 3rd order
|
||||
void solvePA3(double u, double h);
|
||||
//! Solve using polynomial approximation 4th order
|
||||
void solvePA4(double u, double h);
|
||||
//! Solve using polynomial approximation 5th order
|
||||
void solvePA5(double u, double h);
|
||||
|
||||
//! Solution vector
|
||||
PIMathVectord X;
|
||||
//! Global default method
|
||||
static Method method_global;
|
||||
//! Description of available methods
|
||||
static const char methods_desc[];
|
||||
|
||||
private:
|
||||
|
||||
Reference in New Issue
Block a user