Types

HOODESolver.HOODEProblemType
HOODEProblem(f, u0, tspan, p, A, epsilon, B)

The HOODE problem is :

\[\frac{du}{dt} = ( \frac{1}{\epsilon} A + B) u + f(u,p,t)\]

  • The initial condition is $u(tspan[1]) = u0$.
  • The solution $u(t)$ will be computed for $tspan[1] ≤ t ≤ tspan[2]$
  • Constant parameters to be supplied as the second argument of $f$.
  • Periodic Matrix of the problem.
  • epsilon of the problem.
  • Matrix of linear problem to get the exact solution
source
HOODESolver.PolyExpType
PolyExp(p::Vector{T}, a::T, b::T)
PolyExp(pol::Polynomial{T},a::T,b::T)

On the model of Polynomial from package Polynomials, construct a function that is a polynome multiply by an exponential function. The exponential is an exponential of an affine function $a x + b$. The polynome is construct from its coefficients p, lowest order first.

If $f = (p_n x^n + \ldots + p_2 x^2 + p_1 x + p_0)e^{a x + b}$, we construct this through PolyExp([p_0, p_1, ..., p_n], a, b). It is also possible to construct it directly from the polynome.

In the sequels some methods with the same name than for Polynomial are implemented (derivative, integrate, strings, ...) but not all, only the methods needed are developped.

Arguments :

  • p::Vector{T} or pol::Polynomial{T} : vector of coefficients of the polynome, or directly the polynome.
  • a::T, b::T : coefficients of affine exponentiated function.

Examples

julia> pe=PolyExp([1,2,3],2,1)
PolyExp(Polynomial(1 + 2*x + 3*x^2)*exp(2*x + 1))

julia> pe(0)
2.718281828459045

julia> pe(1)
120.51322153912601
source
HOODESolver.PrepareFftBigType
PrepareFftBig( size_fft::Unsigned, [T=BigFloat])

Immutable structure to operate fft transform, x is the type of non transformed data also called signal.

Arguments :

  • size_fft::Integer : Number of values, must be a power of two
  • [T=BigFloat | x::T ] : type of the values

Implementation

  • size_fft : size of the signal
  • tab_permut : permutation
  • root_one : size order roots of one
  • rootoneconj : conjugate of root_one
source
HOODESolver.PreparePhiType
PreparePhi(n_tau::Integer, epsilon::AbstractFloat, matrix_A::Matrix{Number},
fct::Function, [matrix_B::Matrix])

Immutable structure, to share calculations, needed for the phi function. These data can be used elsewhere for example in twoscale function.

Arguments :

  • n_tau::Integer : number of value around the unit disk, it must be a power of two.
  • epsilon::AbstractFloat : epsilon of the system, the type of this value will be the typeof the result.
  • matrix_A::Matrix{Number} : Matrix of twoscale system
  • fct::Function : function of the system
  • [matrix_B::Matrix] : matrix representing the linear function for debug

Keywords

  • mode=1 : possibility of addionnal modes for optional behavior
  • paramfct=missing : middle parameter of function fct
  • t_0=zero(epsilon) : beginning of the time

Fields :

  • epsilon : epsilon of the system.
  • n_tau : number of values for fft
  • tau_list : list of values around the unit disk (0 ... ntau/2 -ntau/2-1 ... -1 )
  • tau_int : list of values to integrate FFT
  • matrix_Ap : sparse matrix with time dimension
  • tau_Ap : for each angular $\tau$ around the unit disk the matrix $e^{(\tau \time Ap)}$
  • tau_Ap_inv : inverse of tau_Ap
  • par_fft : fft parameters
  • fct : function of differential equation
  • paramfct : middle parameter of function fct
  • size_vect : size of vector that is the size of the matrix
  • matrix_B : B matrix for the linear case
  • mode : for optional behavior
  • t_0 : beginning of the time
source
HOODESolver.PrepareTwoScalesPureABType
PrepareTwoScalesPureAB(nb_t, t_max, order, par_u0::PrepareU0)

Immutable structure, to share calculations, needed for the twoscale function

Arguments :

  • nb_t::Int : number of time slices
  • t_max: end of the time
  • order : order for compute the coefficients
  • par_u0::PrepareU0 : prepared initial data

Keywords :

  • p_coef::Union{CoefExpAB,Missing}=missing : precomputed coefficients of AB method
  • verbose=100 : trace level

Fields :

  • nb_t : number of time slices
  • t_max : end of the time
  • order : order for compute the coefficients
  • parphi : prepared parameters for phi (from par_u0)
  • par_u0 : prepared initial data
  • p_coef : computed coefficients
  • exptau : exp( -imdt' au'/epsilon) for all ' au' values
  • exptau_inv : inverse of exptau
  • verbose : trace level
source
HOODESolver.PrepareU0Type
PrepareU0(parphi::PreparePhi, order, u0, newprec)

Preparation of the original data

Arguments

  • parphi::PreparePhi : phi prepared parameters
  • order : order of the preparation
  • u0 : initial data
  • [newprec] : precision for the compute, if no given a default value is computed as a function of epsilon

Fields

  • parphi : phi prepared parameters
  • order : order of the preparation
  • ut0 : formated initial data
  • u0 :initial data
source