Welcome to the Blog!
Here you find a broad range of different tutorials and solutions which deal with programming and software engineering. Maybe a suitable solution helps you :) Have fun reading it! You can also checkout the german version.
Here you find a broad range of different tutorials and solutions which deal with programming and software engineering. Maybe a suitable solution helps you :) Have fun reading it! You can also checkout the german version.
Discretiazation of a PDE You might be wondering where such kind of matrix structures appear. A simple example is the discretization of PDE (partial differential equations) such as: $$ -\nabla u = f(x) $$ If we consider a discretization with finite differences you can approximate your u_i as: $$ u’’(x) \approx \frac{u_{i-1} - u_i - u_{i+1}}{h^2} $$. In a 2D setting you can apply the same discretization of course for the y-direction in the same manner....
Truncate Values in an array (matrix) below a certain threshold If you perform numerical calculations like the QR-Decomposition you can come across numerical rounding errors. In this code snippet we calculate the first householder vector and matrix to perform a QR Decomposition of random integer 4x4 Matrix. The matrix looks likes this: $$ A = \begin{bmatrix} -1 & -6 & 5 & -10 \ 7 & 6 & 7 & -2 \ -1 & -10 & 0 & -2 \ -6 & 9 & 6 & -6 \ \end{bmatrix} $$...
How to rearrange LaTex more content easily? As a engineering student you will be exposed at some point during your studies to LaTex. This is probably only a matter of time ;-) I enjoy working with Latex even though it can be quite frustrating from time to time. Challenge Recently I had the following challenge: I wanted to create an exam sheet for a course with Latex. Writing such a sheet is more work than writing it immediately by hand however it also allows you once done to rearrange topics and annotate them....
How to create a zero-initialized templated std::array? This morning I wanted to come up with a simple data structure in my master thesis in order implement a multigrid algorithm. As the latter is working with matrices or in a more general way tensors I wanted to use templates and the keyword using to improve the readability. New Data Structures The new data structures are written quickly: // File: datastructures.h #include <array> #ifndef DATASTRUCTURES_H template<typename T1, int dim1, int dim2> using matrix = std::array<std::array<T1, dim1>, dim2>; template<typename T1, int dim> using tensor3D = std::array<matrix<T1, dim, dim>, dim>; #endif // !...
Yesterday I spent couple of hours on how to fix the following error: import _ssl # if we can't import it, let the error propagate ModuleNotFoundError: No module named '_ssl' The error popped up during the setup process of a docker container for CI pipeline which should test a python cli tool with tox. The problem could easily be rooted to a openssl library dependency. I also tried the setup with pyenv which is an easy python environment tool but with this approach the same errors occurred....