21.3 The Finite Element Method
243
21.2 Computational Aspects
The SPECFUNPHYS class ippolynom returns the coefficients of the interpolation
polynomials. The syntax is [obj, C] = ippolynom(dof, kn) with the
input variables “dof”, the degree of freedom and “kn”, the number of nodes,
with minimum value 2. For Lagrange interpolation polynomials dof = 1, for
Hermite interpolation polynomials dof = 2, and for extended Hermite interpolation
polynomials dof = 3. The output variables are the class object “obj” with properties
“polycoef”, a table of the polynomial coefficients, “dof”, the degree of freedom,
“nodal”, the number of nodal points, and “info” with some general information.
The output variable “C” is an array of the polynomial coefficients and corresponds
to obj.polycoef.
The following examples show how to call the class. The first example to compute
and plot the Lagrange polynomial and the second one to extract the derivative
polynomials of the Hermite polynomial and to evaluate and to plot their derivative
d
d ˜
x
¯
Φ α ( ˜
x).
>> x = linspace(0,1);
>> [obj, C] = ippolynom(1, 4);
>> plot(x,polyval(obj.polycoef.L0,x)) ,grid on, hold on
>> plot(x,polyval(obj.polycoef.L1,x))
>> plot(x,polyval(obj.polycoef.L3,x))
>> plot(x,polyval(obj.polycoef.L4,x)), shg
x = linspace(0,1);
% plot argument
n = 4;
% number of nodal points
obj = ippolynom(2, n);
% polynomial coefficients
%
figure, hold on, grid on
% polynomial values + node position
for k = 0:n-1
eval([’dH = obj.polycoef.dH’,num2str(k)]);
dHder = polyder(dH);
plot(x, polyval(dHder,x),...
k/(n-1),polyval(dHder,k/(n-1)),’ * ’)
end
(This example lives in the file dHexample.m).
21.3 The Finite Element Method
The finite element method can be applied to any partial differential equation
formulated as boundary value problem. One-dimensional finite elements can be
applied either to one degree-of-freedom quantum systems or to single components
of the multi-dimensional Schrödinger equation, e.g., the radial Schrödinger equation
[1]. For simplification we will restrict the following discussion to bound states of a
Précédent

- 249/287

Suivant