Course Introduction to Numerical Analysis at NTU.
All codes are using Python36.
- Lecture201 -Approximation errors and Roundoff errors
practice1 : Calculating pi with Liu Hui method.
practice2 : Calculating pi with Riemann zeta function. - Lecture202 -Numerical differential and integration
practice1 : Integral with Simpson 3/8 method.
practice2 : Difference between different interval usingscipy.integrate
. - Lecture203 -Numpy array and matplotlib.
practice1 : Some basic array operation.
practice2 : Usingmatplotlib.pyplot
to plot functions. - Lecture204 -Linear algebra and matplotlib image processing.
practice1 : Usenp.linalg.inv
andnp.linalg.det
to verfiy some properties.
practice2 : Useplt.imread
to read and process image,plt.imshow
andplt.show
to show image. - Lecture205 -Root finding, curve fitting, and minimization.
practice1 : Usescipy.optimize.newton
to find root by Newton's method, and build arcsin, arccos functions.
practice2 : Usenp.polyfit
to fit,plt.errorbar
to plot data with error.
- Assignment1
1-1 : Simply numerical differential usingscipy.misc
.
1-2 : Simply numerical integration usingscipy.integrate
.
1-3 : Convolution, Breit-Wigner distribution, Gaussian distribution usingscipy.integrate
. - Assignment2
2-1 : Array operation usingnp.fromfunction
.
2-2 : Array operation usingnp.fromfunction
.
2-3 : Usenp.array
to play Game of Life. - Assignment3
3-1 : Usescipy.linalg.solve
to solve equation.
3-2 : Usenp.diag
,np.sqrt
to compute covariance matrix into correlation matrix.
3-3 : Computing least square. Code involvednp.linspace
,np.dot
,np.transpose
. - Assignment4
4-1 : Usescipy.optimize.newton
to find root by Newton's method.
4-2 : Usescipy.optimize.minimize
to fit data with error range by calculating X^2.
4-3 : Usenp.hstack
,plt.hist
to build histograms. Then try to maximize a given function byscipy.optimize.minimize
. - Assignment5
5-1 : Usescipy.integrate.solve_ivp
to solve position, velocity, acceleration, with resistance force ODE.
5-2 : Usescipy.integrate.solve_ivp
to solve ODE a multi-star system in 2D.
5-3 : Usescipy.integrate.solve_ivp
to solve ODE charged particle moving in magnetic field and electric field. - Assignment6
6-1 : Usenp.random.rand
to generate random number within the target function distribution.
6-2 : Usenp.random.rand
to generate a unit circle's chord.
6-3 : Usenp.random.rand
to generate smeared exponential decay Gaussian distribution function.