solutions to exercises as part of the numerical methods in programming course by Prof. Sunethra Ramanan at IIT Madras. To the most extent, solutions are written in c, python and fortran.
exercise0
-
estimating the area of a circle
- user input using scanf
- for loop
- 1D arrays
- writing data to files
-
convering an integer from base 10 to base 2
- while loop
-
computing machine precision
exercise1
-
estimating the area of a circle
- user input using files, use of argc and argv[]
-
computes the forward and reverser sum of a given set of numbers and compares error
exercise2
-
estimate the areas of verious polygons
- use of functions
- using make files
- linking executables and preprocessor directives
-
compute the forward and central derivatives of a function
- computing relative errors
-
compute the second derivative of a function
exercise3
-
compute the forward and central derivatives of a function
- initializing, loading and using structures
-
compute the integral of a function
- use of header files
- trapezoidal method, simpsons method and 3/8ths method
exercise4
- compute the integral of a function using (a faulty) adaptive method
exercise5
- polynomial interpolation (faulty)
- plotting legendre polynomials using gsl
- creating files iteratively i.e of type 'file_i.dat'
exercise6
- finding the root of a function
- bisection method, newton-phapson method, secant method
exercise7
- solving the equation AX = B
- various methods of defining matrices
- using gsl to solve the above equation
- estimating time taken using time.h and clock_t
- use of gnuplot .plt files
exercise8
-
solving the equation AX = B
- using gsl tridiagonal solver
-
compute the value of an exponential using various methods
exercise9
- solving a first order differential equation
- euler, predictor-corrector, rungekutta 2 and 4 solvers
- solving a second order differential equation
- returning multiple values from a function using an array
quizI
- compute the summation of an alternating positive and negative series in various ways and compute errors
- compute the integral of a function using a given method, using change of variable, thereby drastically increasing the accuracy of estimate
quizII
- solving the schrodinger equation for a particle in a potential well, to compare eigen values obtained with theoretical results and plot eigen vectors
- using the eigenvalue solver in gsl
exercise10
-
solve the diffusion equation
- implicit and crank-nicholson methods
- matrix inverse using gsl
-
use lapack functions to solve the set of linear equations AX=B we solved earlier using gsl.
- calling lapack functions from C
additional exercises
- runge-kutta 2 and 4 methods to solve the simple and damped harmonic oscillators
- area of a circle and volume of a sphere using newton-cotes methods and monte carlo integration - comparison of error
- use of cpython outside of ipython, creating a shared library from the cpython (.pyx) file and linking
the github markdown cheat sheet can be found here