%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%

%

%

% PURPOSE: This Matlab code solves a two-dimensional scattering problem

% using the finite element method. The scatterer is a perfectly

% conducting circular cylinder of radius robj; all the dimensions are given

% in terms of the free-space wavelength. A TM-to-z incident plane wave is

% scattered from the circular cylinder and propagates undisturbed toward

% infinity. To simulate this undisturbed propagation of the scattered field

% toward infinity, a first-order absorbing boundary condition (ABC) was

% imposed at a distance rho away from the center of the cylinder. The farther

% the ABC boundary is placed, the more accurate the ABC is. The free space

% between the circular cylinder and the ABC boundary is subdivided into

% triangles governed by linear interpolation functions. Dirichlet boundary

% conditions are applied on the surface of the cylinder; i.e., the tangential

% electric field, in this case Ez, is set to zero for all the nodes that

% coincide with the surface of the circular cylinder.

%

% The finite element method is applied to the homogeneous scalar wave

% equation, otherwise known as the homogeneous Helmholtz equation. The

% primary unknown quantity is the total electric field in the z-direction

% which is given by the incident field plus the scattered field. The

% direction of the incident field is set toward the positive x-axis (phi_i=0)

% whereas the total field is evaluated at a distance half-way between the

% scatterer and the ABC boundary for all observation angles between 0 and 360

% degrees. The numerical solution is compared with the exact analytical

% solution.

%

% The user is allowed to set the following input parameters:

%

% rhoj = radius of the scatterer (circular cylinder) in wavelengths

% rho = radius of the ABC boundary in wavelengths

% h = discritization size in wavelengths

% E0 = amplitude of the...