Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/jagot/finitedifferencesquasi.jl


https://github.com/jagot/finitedifferencesquasi.jl

Last synced: 6 days ago
JSON representation

Awesome Lists containing this project

README

        

#+TITLE: FiniteDifferencesQuasi.jl
#+AUTHOR: Stefanos Carlström
#+EMAIL: [email protected]

*THIS LIBRARY HAS BEEN DEPRECATED*

a more structured library, with support for FE-DVR and
B-splines as well can be found at

[[https://github.com/JuliaApproximation/CompactBases.jl]]

[[https://travis-ci.org/jagot/FiniteDifferencesQuasi.jl][https://travis-ci.org/jagot/FiniteDifferencesQuasi.jl.svg?branch=master]]
[[https://ci.appveyor.com/project/jagot/finitedifferencesquasi-jl][https://img.shields.io/appveyor/ci/jagot/finitedifferencesquasi-jl.svg?logo=appveyor]]
[[https://codecov.io/gh/jagot/FiniteDifferencesQuasi.jl][https://codecov.io/gh/jagot/FiniteDifferencesQuasi.jl/branch/master/graph/badge.svg]]

#+PROPERTY: header-args:julia :session *julia-README*

Implementation of finite differences in the framework of
[[https://github.com/JuliaApproximation/ContinuumArrays.jl][ContinuumArrays.jl]].

#+BEGIN_SRC julia :exports none
using Pkg
Pkg.activate(".")
#+END_SRC

#+BEGIN_SRC julia :exports both :results verbatim
using FiniteDifferencesQuasi

B = FiniteDifferences(5,1.0)
#+END_SRC

#+RESULTS:
: Finite differences basis {Float64} on 1.0..5.0 with 5 points spaced by Δx = 1.0

#+BEGIN_SRC julia :exports both :results verbatim
D = Derivative(axes(B,1))
#+END_SRC

#+RESULTS:
: Derivative{Float64,IntervalSets.Interval{:closed,:closed,Float64}}(1.0..5.0)

#+BEGIN_SRC julia :exports both :results verbatim
∇ = B'*D*B
#+END_SRC

#+RESULTS:
: 5×5 LinearAlgebra.Tridiagonal{Float64,Array{Float64,1}}:
: 0.0 0.5 ⋅ ⋅ ⋅
: -0.5 0.0 0.5 ⋅ ⋅
: ⋅ -0.5 0.0 0.5 ⋅
: ⋅ ⋅ -0.5 0.0 0.5
: ⋅ ⋅ ⋅ -0.5 0.0

#+BEGIN_SRC julia :exports both :results verbatim
∇² = B'D'D*B
#+END_SRC

#+RESULTS:
: 5×5 LinearAlgebra.SymTridiagonal{Float64,Array{Float64,1}}:
: -2.0 1.0 ⋅ ⋅ ⋅
: 1.0 -2.0 1.0 ⋅ ⋅
: ⋅ 1.0 -2.0 1.0 ⋅
: ⋅ ⋅ 1.0 -2.0 1.0
: ⋅ ⋅ ⋅ 1.0 -2.0