Skip to content

claudio-bonati/BasicNumericalMethods

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

**********************************************************
******     SOME BASIC C CODES TO GET ACQUAINTED     ******
******        WITH TYPICAL NUMERICAL PROBLEMS       ******
**********************************************************

Library functions 

-) root-finding: bisection and secant methods
 
-) integration: trapezoidal rule and Richardson extrapolation

-) linear algebra: 
   solvers for linear equations (Gauss-Jordan elimination, 
      Gauss-Seidel and conjugate gradient iterative solvers)   
   eigensolvers (power iterations for min/max eigenvalue, 
      Jacobi method) 

-) ODE: 
   initial problem solvers (Euler, symplectic Euler, leapfrog, 
      Runge-Kutta 4)
   two point boundary value problems (FDE, shooting)
   eigenvalue problems (FDE)

Example codes:

-) root finiding 
-) numerical integration
-) linear equations
-) eigensolvers for linear algebra
-) ODE: initial value problems
        two point boundary value problems (FDE, shooting)
        eigenvalue problems (FDE, shooting)

------------------------

To compile use 

make

and executables will be generated in the build directory. Default 
compiler is gcc, if you want to use a different compiler 
(e.g. clang), please use 

make CC="your compiler"

Default compilation options are 

CFLAGS=-O3 -Wall -Wextra -Werror -pedantic -Wconversion -std=c99

if you want to change them you can modify the Makefile in the build 
directory or use

make CFLAGS="what you want"

Even if you remove all the warnings, please be sure to keep a 
nontrivial optimization level (like -O2 or -O3) since otherwise 
the codes will be much slower!

-------------------------

About

Some C codes to explain basic numerical techniques useful for physics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors