Numerical Methods

FEM Solution
June 8th, 2012, 10 comments

2D Finite Element Method in MATLAB

This tutorial discusses how to generate unstructured meshes using a Matlab code distmesh.m and how to use the mesh in a Matlab Finite Element Solver to solve the Poisson's equation on an unstructured domain.
Interpolation from polygon vertices onto a 2D mesh
June 4th, 2012, 3 comments

Interpolation using an arbitrary quadrilateral

This article describes how to interpolate data between a particle and an arbitrary quadrilateral cell used in non-Cartesian grids. The technique is illustrated with several Matlab / Octave examples. The examples show how pick points located inside the polygon, how to classify their position, and how to scatter and gather particle data.
phi
April 30th, 2012, 6 comments

Nonlinear Poisson Solver

Nonlinear Poisson's equation arises in typical plasma simulations which use a fluid approximation to model electron density. This article describes how to solve the non-linear Poisson's equation using the Newton's method and demonstrates the algorithm with a simple Matlab code.
Computational times vs. number of nodes
April 22nd, 2012, 12 comments

Code Optimization: Speed up your code by rearranging data access

Often, a significant code speed up can be accomplished by simply rearranging the way data is stored or accessed in memory. This article compares data access with arrays vs. linked lists, and compares loop ordering for 3D data sets. It also looks at a flat 1D array representation of 3D data via a mapping function.
Curvilinear Coordinate System
January 16th, 2012, 3 comments

Orthogonal Curvilinear Coordinates

Cylindrical and spherical coordinates are just two examples of general orthogonal curvilinear coordinates. In this article we derive the vector operators such as gradient, divergence, Laplacian, and curl for a general orthogonal curvilinear coordinate system.
den
November 28th, 2011, 40 comments

Simple Particle In Cell Code in Matlab

This article includes the source code for a simple particle in cell code. The code simulates flow of plasma over a charged plate and is written in Matlab.
Hall thruster magnetic mesh
August 24th, 2011, 4 comments

Multiscale Modeling of Hall Thrusters

One of the topics we specialize in at Particle In Cell Consulting is modeling of electric propulsion (EP) thrusters. These devices generate thrust by accelerating ionized propellant (plasma). One of the most efficient EP devices is the Hall thruster. These devices have been flown for over 40 years, however, much still remains unknown about the details of their operation.
cores
June 25th, 2011, 6 comments

Get results faster with Java multithreading

Code parallelization is the process of modifying a simulation program so that it can take advantage of multiple computational cores to obtain results faster. One method is to distribute the workload locally in the form of computational threads. Java makes it easy to add multithreading to your code. Here we show you how to implement a "poor-man's" method, in which individual cases run serially, but multiple cases are launched concurrently.
Finite Volume Method
April 19th, 2011, 20 comments

The Finite Volume Method

The Finite Volume Method (FVM) is an algorithm for solving differential equations. It is based on the integral formulation of the problem, with each computational element corresponding to a volume over which the integration is performed. It is somewhat more complex than the Finite Difference, however, it can be applied to arbitrarily shaped domains. In this article we show you the basics of this method and provide a simple solver.
Plasma flow around a flat plate
November 8th, 2010, 23 comments

The Electrostatic Particle In Cell (ES-PIC) Method

Particle In Cell (PIC) is the name of a method used to numerically model dynamics of ionized gases, or plasmas. Its name stems from the fact that the gas is represented by a large number of computational particles that move in a disretized domain. The mesh cells are used to determine the global interactions between the charged particles. In this tutorial we show you how to implement the PIC method and provide a simple Matlab PIC code.