1D Linear Differential Equations - Finite Element Method

1D - Boundary Value Problem

Boundary value problem to solve

differential equations, linear, lde, finite element method, fem, analytical solution, boundary value problem, Octave, Matlab, taketechease

where external force

differential equations, linear differential equations, lde, finite element method, fem, analytical solution, boundary value problem, taketechease


for x in [0, L] and boundary conditions are: phi(0) = phiL, phi(L) = phiR.
The problem is trivial and can be easily solve analytically.

Analytical solution.

The solution reads:

differential equations, linear differential equations, lde, finite element method, fem, analytical solution, boundary value problem, taketechease

Because of its simplicity the presented problem is a good example to test the numerical solution obtained with help of fem1D_lde.m program (written in Octave and Matlab code).

FEM solution.

FEM solution can be obtained from the Octave (MATLAB) program:

fem1D_lde.m consists of the function fem1D_lde(L, h1, NL, NI, NR, phiL, phiR, q, k, linear, varargin) where input arguments are:

To test the finite element method try to consider the following situations:

  1. NL = NR = 0, NI = 4;
    How good is a numerical solution? How large is the element size h?
  2. When is it useful to set NL and NR different from 0?
  3. Is it a difference between QI vectors computed for different values of the parameter linear (0 or 1)?

Note! If do not feel quite familiar with the Octave (Matlab) language of programming and you do not want to go through them by your own you can always join the course: Introduction to Octave and Matlab. Let us see how easy and fast is programming using the Matrix Laboratory.

differential equations, finite element method, fem, taketechease differential equations, linear differential equations, lde, finite element method, fem, analytical solution, initial value problem, time, Octave, Matlab, taketechease
Last update: February 22, 2020
© 2013-2020 taketechease.com Privacy Policy Terms of Use