GithubHelp home page GithubHelp logo

pnavaro / hoodesolver.jl Goto Github PK

View Code? Open in Web Editor NEW
16.0 4.0 4.0 6.33 MB

High Oscillatory Ordinary Differential Equation Solver in Julia

Home Page: https://pnavaro.github.io/HOODESolver.jl/dev

License: MIT License

Julia 100.00%
julia high-oscillatory fft ode-solver adams-bashforth-methods

hoodesolver.jl's Introduction

HOODESolver.jl

A Julia package for solving numerically highly-oscillatory ODE problems

Stable Dev Build Status codecov License status

This Julia package implements Uniformly Accurate numerical methods (UA) for highly oscillating problems. We propose to solve the following equation:

$$\frac{d u(t)}{dt} = \frac{1}{\varepsilon} A u(t) + f(t, u(t)), \qquad u(t=t_{start})=u_{in}, \qquad \varepsilon \in ]0, 1],$$

with

$u : t \in [t_{start}, t_{end}] \mapsto u(t) \in \mathbb{R}^n, t_{start}, t_{end} \in \mathbb{R}, \qquad u_{in}\in \mathbb{R}^n$,

$A\in {\mathcal{M}}_{n,n}(\mathbb{R})\quad$ is such that $\quad \tau \mapsto e^{\tau A}\quad$ is $2 \pi$-periodic, $\quad f : (t, u) \in \mathbb{R} \times \mathbb{R}^n \mapsto \mathbb{R}^n$.

Installation

HOODESolver.jl is a registered package and can be installed using the Julia package manager. From the Julia REPL, enter Pkg mode (by pressing ])

julia>]
(@v1.5) pkg> add HOODESolver

Usage

The following is an example with the system of Hénon-Heiles. Please see the documentation for further usage, tutorials, and api reference.

using HOODESolver
using Plots

epsilon= 0.0001

A = [ 0 0 1 0 ; 
      0 0 0 0 ; 
     -1 0 0 0 ; 
      0 0 0 0 ]

f1 = LinearHOODEOperator( epsilon, A)

f2 = (u,p,t) ->  [ 0, u[4], 2*u[1]*u[2], -u[2] - u[1]^2 + u[2]^2 ] 

tspan = (0.0, 3.0)

u0 = [0.55, 0.12, 0.03, 0.89]
prob = SplitODEProblem(f1, f2, u0, tspan)

solve the defined problem

sol = solve(prob, HOODEAB()) 
plot(sol) 

For support with using HOODESolver.jl, please open an issue describing the problem and steps to reproduce it.

How to Contribute

Here's an outline of the workflow you should use if you want to make contributions to this package.

  1. Fork this repository
  2. Make a new branch on your fork, named after whatever changes you'll be making
  3. Apply your code changes to the branch on your fork
  4. When you're done, submit a PR to HOODESolver.jl to merge your fork into master branch.

This package is licensed under the MIT Expat license. See LICENSE for more information.

hoodesolver.jl's People

Contributors

chrisrackauckas avatar crouseilles avatar github-actions[bot] avatar pnavaro avatar vissarion avatar ymocquar avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

hoodesolver.jl's Issues

Examples from the docs do not work

Thanks for the nice documentation! However, some examples do not work properly, e.g. since using Plots is missing in

The latter yields additionally

julia> rng = MersenneTwister(1111)
ERROR: UndefVarError: MersenneTwister not defined
Stacktrace:
 [1] top-level scope
   @ REPL[19]:1

It would be great if you could turn these code examples into doctests using Documenter and check them automatically via GitHub actions.

Minor Grammar Corrections [JOSS]

Part of openjournals/joss-reviews#3077. In no order.

  • P1 L7 "has a long" --> "have a long|
  • P1 L11 "coming their" --> "relating to their"
  • P1 L12 "creating" --> "which gives rise to "
  • P1 L18 "method able" --> "method which is able"
  • P1 L23 "this type of stiff problems" --> "the stiff problems discussed above"
  • P1 L24 "solution" --> "solutions"
  • P1 L33: "uniform accuracy: uniformly accurate (UA) methods are indeed able to" --> "uniformly accurate (UA) methods which are"
  • P1 L33 "allows to skip several oscillations in a single time step" --> "allows skipping several oscillations each time step"

Update dependency bounds

Thanks for this nice package! I wanted to install it but couldn't do that in my current setup because of version conflicts of dependencies of HOODESolver.jl and other direct dependencies of my project. It would be great if you could update the upper version bounds of

  • GenericSchur.jl
  • Polynomials.jl
  • Reexport.jl

(as long as they are compatible with your package). You can automate this process using the GitHub action https://github.com/JuliaRegistries/CompatHelper.jl.

Contribution Guidelines [JOSS]

Part of openjournals/joss-reviews#3077.

I was wondering if the README could have a section added to it describing the contribution workflow (fork, open PR, ensure tests pass). Some more explicit lines will go a long way in satisfying the community guidelines point. A few repo templates for issues would help as well.

However I consider this to be a non-blocker.

JOSS paper

Thanks for creating this nice package, @pnavaro et al. It looks like a really valuable contribution to the community to me. Please find below some comments and suggestions.

  • Would it be possible to leverage ApproxFun.jl (and/or related Matlab tools) for these problems?
  • From reading the manuscript and the README, it's not clear to me what kind of scalability to expect. Is it correct that this package is restricted to using a single CPU and only dense Matrix types for linear operator? At least something like the following (adapted from the README) does not work.
    julia> using HOODESolver, SparseArrays
    
    julia> A = spzeros(4, 4); A[1,3] = 1; A[3,1] = -1; A
    4×4 SparseMatrixCSC{Float64, Int64} with 2 stored entries:
             1.0   
                  
    -1.0           
                  
    
    julia> f1 = LinearHOODEOperator(1.0e-4, A)
    ERROR: MethodError: no method matching LinearHOODEOperator(::Float64, ::SparseMatrixCSC{Float64, Int64})
    Closest candidates are:
      LinearHOODEOperator(::T, ::Matrix{T} where T) where T at .../HOODESolver/src/common_interface.jl:9
    Stacktrace:
    [1] top-level scope
      @ REPL[3]:1
    Thus, it looks like the package is mostly made for (small) ODEs but not really applicable to, say, typical PDE discretizations that can run on a single workstation. It would be great if you could clarify this aspect.

TagBot trigger issue

This issue is used to trigger TagBot; feel free to unsubscribe.

If you haven't already, you should update your TagBot.yml to include issue comment triggers.
Please see this post on Discourse for instructions and more details.

If you'd like for me to do this for you, comment TagBot fix on this issue.
I'll open a PR within a few hours, please be patient!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.