Other numerical methods 271
end
iter = 0;
for k = 1:1000
iter = iter+1;
difmax = 0;
for i = 2:imax1
f(i) = (c(i)-a(i,i+1)*f(i+1)-a(i,i-1)*f(i-1))/a(i,i);
end
end
x = 0;
for i = 1:imax
fexact(i) = x*(1-x^2)/6;
x = x+dx;
end
plot(0:imax-1,f,'b','Linewidth',2)
hold on
plot(0:imax-1,fexact,'r')
xlabel('Solution domain x 10^-^1')
ylabel('Function f(x)')
legend('FE Galerkin','Exact Solution',2)
PROBLEM 9.3
Solve the same problem (Equation 9.34 or Equation 9.35) according to the
following instructions:
1. Subdivide the solution domain into three finite elements of equal
length and apply the Rayleigh-Ritz method. Calculate the solution by
hand.
2. Subdivide the solution domain into three finite elements of equal
length and apply the finite elements Galerkin method. Calculate the
solution by hand.
3. Use the computer to solve the problem described in question (2).
4. Use the quadratic element (Equations 9.45 through 9.47) to solve
the problem described in Example 9.3 utilizing one finite element
Rayleigh-Ritz method.
5. Use the quadratic element (Equations 9.45 through 9.47) to solve the
problem described in Example 9.3 utilizing the finite element Galerkin
method.
9.3.3 Application of the finite elements
method in water resources
In the previous sections, the finite elements method was demonstrated by
using simple ordinary differential equations. In the following, without
elaborating into much detail, the finite element Galerkin method is applied
for a second-order hyperbolic partial differential equation (telegrapher’s
Précédent

- 284/302

Suivant