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”

Spacecraft Trajectory Optimization

Trajectory optimization using AI

Spacecraft mission will become more common. There are relevant open projects such that Mars colonization and exploring missions outside the Solar System.

These missions require high accuracy calculations because the error propagates in time and would be able to modify the trajectory.

There are many ways to face this problem: analytical or numerical approaches.

The analytical approaches could only be used for simplified problems, and thus it is really restrictive.

The numerical approaches commonly used and include metaheuristics and nonlinear programming. I have used genetic algorithms to solve a basic problem which consists of optimizing trajectory to travel to Mars from the Earth.

Continue reading “Spacecraft Trajectory Optimization”

Nuclear Fusion + AI

Fusion Reactor Simulations + Deep learning

Fusion power is a proposed form of power generation that would generate electricity by using heat from nuclear fusion reactions.

There are many methods to achieve the fusion: magnetic confinement, inertial confinement, electric pinches, inertial electrostatic confinement, …

magnetic confinement – tokamak

Pulsotron is a Tokamak fusion power reactor. It is an evolutionary prototype that was designed by Javier Luis López. The simulations were made using C++ and OpenGL.

Continue reading “Nuclear Fusion + AI”

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”

CPU vs GPU | Neural Network

GPU vs CPU neural network

I have done two libraries for AI,

  • CPU with Eigen 1 2
  • GPU with CUDA 1 2

They are optimized and work properly. However, there are significant differences in performance.

The GPU library can adapt to other Nvidia graphic card and furthermore improve the time that I obtain within my circumstances. In addition, the graphics card industry is constantly improving their models and we have recently seen the clusters of the graphics card in the business.

The CPU library is stable and can work on any computer because it does not rely on Nvidia hardware, it is a completely cross-platform library that only needs Eigen library which is compatible with every OS.

I have used for the test: i7-7700k vs Nvidia GeForce GTX 1070

Continue reading “CPU vs GPU | Neural Network”