Code

Summary

FEA Gif

This is a matlab code for the approximation of following 2nd order partial differential equation:

\[\frac{\partial p}{\partial t} - \nabla\cdot(\bf{K}\nabla p) = q\]

by converting the strong form to weak form using divergent theorem, and approximating the solution using discretization, shape function, Gallerkin’s approximation, and Gaussian quadrature. The resulting animation is below, whichshows the approximate solution beingupdated every time step to obtain theoretical solution.