Implementation of various algorithms for Numerical Methods class, in Fortran.
Mainly exposed as a library. Support for CMake and FPM is planned.
Done in a Test Driven Development fashion using test-drive
- Interpolation:
- Newton's Forward
- Newton's Backward
- Newton's Divided Difference
- Lagrange's
- DiffyQ:
- Range-Kutta 2 (Modified Euler)
- Euler's Method
- Range-Kutta 4
- Milne's Predictor Corrector
- Taylor Series Method
- Algebraic Equations:
- Bisection
- Newton-Rhapson
- Regula Falsi
- System of Linear Equations
- Gauss Elimination
- Gaus Jordan
- Gauss Seidel
- LU Factorisation [Not Implementing. Use
stdlib_linalg->solve_lu]
- Finite Differences BVP
- 2nd Order Solver
- TBD
Note
Please check iter_zero after using set_first_interval. Only continue if iter_zero is false. If it is true then that indicates that the first interval search was not successfuly. You can override this behaviour by manually specifying the first interval while defining an instance of algeb_prob and setting iter_zero to false and setting correct [a,b] for it. When you do want to use set_first_interval, you can ignore iter_zero by not providing it in the constructor and setting any random a,b
Caution
DiffyQ's return value is currently not precision controlled. It is on TODO for now. The output is correct.
Note: DiffyQ's support first order derivatives only. The diffyq_prob type should be used as a derived type to set a problem using init_prob. The eqn_interface provides a general interface to represent the diffyq.
cd nummet
fpm build
fpm test- GNUPlot Integration (ogpf)
- Switch to using ISO types.
- Look into real(dp) for diffyQ
- Use
select typeto extract thesolveimplementations in the diffyQ modules as a single function1.
- Newton's Backward: p + i - 1
- Newton's Forward: p - i + 1
Footnotes
-
I am aware of the code repetition in the diffyq modules (the driver function is very much the same). The only reason they are kept that way is the function call changes in each. A simple
select typewould do the trick is what I am expecting but in an ideal case some metaprogramming way would be nice. ↩