diff --git a/exercise-instructions.md b/exercise-instructions.md index c055ede..cff2c92 100644 --- a/exercise-instructions.md +++ b/exercise-instructions.md @@ -3,7 +3,7 @@ Download (clone) the exercise material with ```bash -$ git clone https://github.com/csc-training/hpc-python.git +$ git clone -b mooc https://github.com/csc-training/hpc-python.git ``` The external Python packages can be installed with **pip** by using the provided [requirements.txt](requirements.txt) file. In CSC classroom this can be done diff --git a/numpy/broadcast-rotation/README.md b/numpy/broadcast-rotation/README.md index 03aac56..c043e6e 100644 --- a/numpy/broadcast-rotation/README.md +++ b/numpy/broadcast-rotation/README.md @@ -11,7 +11,7 @@ R = \end{pmatrix} ---> -![img](http://quicklatex.com/cache3/9c/ql_ee4015bef241c06a5119104118f9a19c_l3.png) +![img](../img/rotation-matrix.png) where θ is the angle of rotation (in radians). Start from the x-y coordinates in the file points_circle.dat and rotate them by 90°. Utilize broadcasting for diff --git a/numpy/finite-difference/README.md b/numpy/finite-difference/README.md index 792f139..777ab47 100644 --- a/numpy/finite-difference/README.md +++ b/numpy/finite-difference/README.md @@ -9,7 +9,7 @@ as: f'(x_i) = \frac{f(x_i + \Delta x)- f(x_i - \Delta x)}{2 \Delta x} ---> -![img](https://quicklatex.com/cache3/0a/ql_d10c99a114e66c7ed0535e0aeb041d0a_l3.png) +![img](../img/finite-difference.png) Construct 1D Numpy array containing the values of xi in the interval [0,π/2] with spacing Δx=0.1. Evaluate numerically the derivative of **sin** in this diff --git a/numpy/heat-equation/README.md b/numpy/heat-equation/README.md index 5f14513..96b30be 100644 --- a/numpy/heat-equation/README.md +++ b/numpy/heat-equation/README.md @@ -5,7 +5,7 @@ Heat (or diffusion) equation is -![img](https://quicklatex.com/cache3/d2/ql_b3f6b8bdc3a8862c73c5a97862afb9d2_l3.png) +![img](../img/heat-equation.png) where **u(x, y, t)** is the temperature field that varies in space and time, and α is thermal diffusivity constant. The two dimensional Laplacian can be @@ -17,7 +17,7 @@ discretized with finite differences as &+ \frac{u(i,j-1)-2u(i,j)+u(i,j+1)}{(\Delta y)^2} \end{align*} --> -![img](https://quicklatex.com/cache3/2d/ql_59f49ed64dbbe76704e0679b8ad7c22d_l3.png) +![img](../img/nabla.png) Given an initial condition (u(t=0) = u0) one can follow the time dependence of the temperature field with explicit time evolution method: @@ -25,14 +25,14 @@ the temperature field with explicit time evolution method: -![img](https://quicklatex.com/cache3/9e/ql_9eb7ce5f3d5eccd6cfc1ff5638bf199e_l3.png) +![img](../img/heat-time-propagation.png) Note: Algorithm is stable only when -![img](https://quicklatex.com/cache3/d1/ql_0e7107049c9183d11dbb1e81174280d1_l3.png) +![img](../img/heat-stability.png) Implement two dimensional heat equation with NumPy using the initial temperature field in the file [bottle.dat](bottle.dat) (the file consists of a diff --git a/numpy/img/finite-difference.png b/numpy/img/finite-difference.png new file mode 100644 index 0000000..62e3a31 Binary files /dev/null and b/numpy/img/finite-difference.png differ diff --git a/numpy/img/heat-equation.png b/numpy/img/heat-equation.png new file mode 100644 index 0000000..2cae86b Binary files /dev/null and b/numpy/img/heat-equation.png differ diff --git a/numpy/img/heat-stability.png b/numpy/img/heat-stability.png new file mode 100644 index 0000000..9a418e2 Binary files /dev/null and b/numpy/img/heat-stability.png differ diff --git a/numpy/img/heat-time-propagation.png b/numpy/img/heat-time-propagation.png new file mode 100644 index 0000000..ec2e024 Binary files /dev/null and b/numpy/img/heat-time-propagation.png differ diff --git a/numpy/img/nabla.png b/numpy/img/nabla.png new file mode 100644 index 0000000..6a0cc87 Binary files /dev/null and b/numpy/img/nabla.png differ diff --git a/numpy/img/rieman-sum1.png b/numpy/img/rieman-sum1.png new file mode 100644 index 0000000..ab919d1 Binary files /dev/null and b/numpy/img/rieman-sum1.png differ diff --git a/numpy/img/rieman-sum2.png b/numpy/img/rieman-sum2.png new file mode 100644 index 0000000..eb07078 Binary files /dev/null and b/numpy/img/rieman-sum2.png differ diff --git a/numpy/img/rotation-matrix.png b/numpy/img/rotation-matrix.png new file mode 100644 index 0000000..b1d6168 Binary files /dev/null and b/numpy/img/rotation-matrix.png differ diff --git a/numpy/integration/README.md b/numpy/integration/README.md index de2993e..857f76e 100644 --- a/numpy/integration/README.md +++ b/numpy/integration/README.md @@ -7,7 +7,7 @@ sum S = \int_a^b f(x) dx = \sum_{i=1}^n f(x'_i) \Delta x ---> -![img](https://quicklatex.com/cache3/e2/ql_30419670e67bc2b3d039e8a9d8653de2_l3.png) +![img](../img/rieman-sum1.png) with @@ -15,7 +15,7 @@ with x'_i = (x_i + x_{i-1}) / 2; x_0 = a, x_n = b ---> -![img](https://quicklatex.com/cache3/09/ql_f124fd5c831e873c6abd41160fae2d09_l3.png) +![img](../img/rieman-sum2.png) Calculate the integral in the interval [0,π/2] and investigate how much the Riemann sum of **sin** differs from 1.0. Avoid `for` loops. Investigate also