

We will compare this known solution with the approximate solution from Finite Elements. Just like in the previous example, the solution is known, To show this we will next use the Finite Element Method to solve the following poisson equation over the unit circle, \(-U_=0\) on region bounded by unit circle with \(\sin(3\theta)\) as the boundary value at radius 1. Solving 2D Poisson on Unit Circle with Finite Elements One of the advantages that the Finite Element Method (and the Finite Volume Method) has over Finite Difference Method is that it can be used to solve Laplace or Poisson over an arbitrary shape including shapes with curved boundaries. This particular problem could also have been solved using the Finite Difference Method because of it’s square shape. It then solves Poisson’s equation using the Matlab command U = KF.After that it sets the Dirichlet boundary conditions to zero.Next it assembles the K matrix and F vector for Poisson’s equation KU=F from each of the triangle elements using a piecewise linear finite element algorithm.First it generates a triangular mesh over the region.
#Matlab 2012 code#
If you look at the Matlab code you will see that it is broken down into the following steps. Solution of the Poisson’s equation on a square mesh using femcode.m Running the code in MATLAB produced the following Figure 1. The MATLAB code in femcode.m solves Poisson’s equation on a square shape with a mesh made up of right triangles and a value of zero on the boundary.
#Matlab 2012 generator#
I will use the second implementation of the Finite Element Method as a starting point and show how it can be combined with a Mesh Generator to solve Laplace and Poisson equations in 2D on an arbitrary shape. The first one of these came with a paper explaining how it worked and the second one was from section 3.6 of the book “Computational Science and Engineering” by Prof. Searching the web I came across these two implementations of the Finite Element Method written in less than 50 lines of MATLAB code: The Finite Element Method is one of the techniques used for approximating solutions to Laplace or Poisson equations. If your article is on scientific computing, plasma modeling, or basic plasma / rarefied gas research, we are interested! You may also be interested in an article on FEM PIC. Would you like to submit an article? If so, please see the submission guidelines.

This guest article was submitted by John Coady (bio below).
