DiffEq - Modern C++ ODE Integration Library 1.0.0
High-performance C++ library for solving ODEs with async signal processing
Loading...
Searching...
No Matches
sra1.hpp
1#pragma once
2
3#include <integrators/sde/sra.hpp>
4#include <sde/sde_base.hpp>
5#include <core/state_creator.hpp>
6#include <cmath>
7
8namespace diffeq {
9
16template<system_state StateType>
17class SRA1Integrator : public SRAIntegrator<StateType> {
18public:
20
21 explicit SRA1Integrator(std::shared_ptr<typename base_type::sde_problem_type> problem,
22 std::shared_ptr<typename base_type::wiener_process_type> wiener = nullptr)
23 : base_type(problem, wiener, create_sra1_tableau()) {}
24
25 std::string name() const override {
26 return "SRA1 (Strong Order 1.5 for Additive Noise)";
27 }
28
29private:
30 static typename base_type::tableau_type create_sra1_tableau() {
31 typename base_type::tableau_type tableau;
32 tableau.stages = 2;
33 tableau.order = static_cast<typename base_type::value_type>(1.5);
34
35 // SRA1 drift coefficients
36 tableau.A0 = {{0, 0}, {1, 0}};
37 tableau.c0 = {0, 1};
38 tableau.alpha = {static_cast<typename base_type::value_type>(0.5),
39 static_cast<typename base_type::value_type>(0.5)};
40
41 // SRA1 diffusion coefficients
42 tableau.B0 = {{0, 0}, {1, 0}};
43 tableau.c1 = {0, 1};
44 tableau.beta1 = {static_cast<typename base_type::value_type>(0.5),
45 static_cast<typename base_type::value_type>(0.5)};
46 tableau.beta2 = {0, 1};
47
48 return tableau;
49 }
50};
51
52} // namespace diffeq
SRA1 integrator variant.
Definition sra1.hpp:17
SRA (Stochastic Runge-Kutta for additive noise SDEs) integrator.
Definition sra.hpp:44