Computational Fluid Dynamics (CFD)

Navier-Stokes + Incompressible + Finite difference method

Discretization methods for approximating the Partial Differential Equations (PDEs):

  1. Finite Difference (FD) \checkmark
  2. Finite Elements (FE)
  3. Finite Volume (FV)

Finite Difference (FD)

Taylor’s polynomial

    \[f(x_0 + h) = f(x_0) + \frac{f'(x_0)}{1!}h + \frac{f^{(2)}(x_0)}{2!}h^2 + \cdots + \frac{f^{(n)}(x_0)}{n!}h^n + R_n(x) \]

    \[f'(a)\approx {f(a+h)-f(a)\over h}. \]

    \[f'(a)\approx{f(a+h)+f(a-h)-2f(h)\over \Delta h^2 \]

Continue reading “Computational Fluid Dynamics (CFD)”

Modular Arithmetic Library

Modular Arithmetic Library in C++

This library provides the basics of modular arithmetic operations:

  • Great Common Divisor (GCD)
  • Least Common Multiple (LCM)
  • Bezout solver
  • Decomposition number algorithm
  • Euler’s totient function
  • a^{b}(mod\:m)
  • Primality Test
  • Find next Prime
  • Inverse function
  • Solver for 1 equation
  • Solver for multiple equations
-GitHub repository:

Modular Arithmetic Source Code

-Article

Modular Arithmetic Article


Continue reading “Modular Arithmetic Library”

Fluid Dynamics

Navier-Stokes Equation

\rho [kg/m^3] : fluid density

\mu  [Pa\cdot s] : dynamic viscosity

\nu [N/\rho=m^2/s] : kinematic viscosity

\vec{V}=(u,v,w) [m/s] : velocity

\forall : volume

Conservation of mass

  1. For a system:

        \[ \frac{d}{dt}M_{SYS}=0 \]

  2. For a C.V. (Reynolds transport theorem):\]

    \[\frac{\partial}{\partial t}\int_{CV}{\rho d\forall}+\int_{CS}{\rho \vec{V}\cdot \hat{n} dA}=0 \]

Differential form (\delta x\delta y\delta z):

    \[ \frac{\partial}{\partial t}\int_{CV}{\rho d\forall}=\frac{\rho}{\partial t} \delta x\delta y\delta z \]

Continue reading “Fluid Dynamics”

RNN, LSTM & GRU

Recurrent Neural Network (RNN), Long-Short Term Memory (LSTM) & Gated Recurrent Unit (GRU)

Is a type of artificial neural network where connections between nodes form a sequence. This allows temporal dynamic behavior for time sequence.
There are 3 types of vanilla recurrent neural network: the simple (RNN), gated recurrent unit (GRU) and long short term memory unit (LSTM).

Continue reading “RNN, LSTM & GRU”

Convolutional Neural Network (CNN)

Convolutional neural network introduction and tutorial

Introduction

Convolutional neural network (CNN or ConvNet) is a type of neural network used in artificial intelligence that is commonly applied to analyzing images.

They can be considered a pre-processing compared to image classification algorithms. They have applications in image and video recognition, recommender systems, image classification, natural language processing, etc.

Notation

f^l : filter size.
p^l : padding.
s^l : stride.
n^{l-1}_H \times n^{l-1}_W \times n^{l-1}_C: input.
n^{l}_H \times n^{l}_W \times n^{l}_C: output.
n^l = \floor{\frac{n^{l-1}+2p^l-f^l}{s^l}+1}.
f^l \times f^l \times n_c^l : filter.
a^l : activation function.
n_c^l : bias.

Continue reading “Convolutional Neural Network (CNN)”