

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


Department of Mathematics Spring 2009 MATH 4365, Section 19530 MW 5:30-7:00PM A. Caboussat
Turn in programs, outputs, figures and results. You may use the codes provided with the book. Write a short report to present your results.
Let us consider a non-homogeneous anisotropic rope of length one. The resistance of the rope is given by the function a ∈ C([0, 1]), which is assumed to be positive. Let f ∈ C([0, 1]) be the density force applied onto the rope. We want to compute the vertical deformation u : x ∈ [0, 1] → u(x) ∈ R that satisfies the following boundary value problem:
d dx
a(x)
d dx
u(x)
= f (x), x ∈ (0, 1), u(0) = u(1) = 0.
We consider the particular case when a(x) = 1 + x and f (x) = αex(1−x), α ∈ R+. Let N be a positive (large) integer, h = (^) N 1 +1 be the step size and xj = jh, j = 0, 1 , 2 , ..., (N + 1) the equally spaced grid points of the discretization. Answer to the following questions and detail your explanations.
1.a) Write a finite differences discretization of the problem (1) by using centered finite differences in space. Show that this discretization can be written as a linear system A~u = ~b. Explicit the matrix A and the vectors ~u and ~b.
1.b) Write a finite differences code for the numerical simulation of the deformation of the rope and plot the numerical approximation ~u of the function u(x). Repeat for N = 10, 50 , 100 , 1000 , 10000. Observe the convergence of the numerical approximation of u(x).
1.c) If the boundary condition u(1) = 0 is replaced by u(1) + βu′(1) = 0, β given, rewrite the numerical scheme and the code and plot the solution of the new problem for β = 1. Explain your procedure.
1.d) We want to solve (1) with a finite element method. Let V be the function space of the continuous functions g, with piecewise continuous first derivatives g′^ and such that g(0) = g(1) = 0. Show that the weak formulation corresponding to the problem (1) reads: find u ∈ V satisfying:
∫ (^1)
0
a(x)u′(x)v′(x)dx =
0
f (x)v(x)dx, ∀v ∈ V. (2)
1.e) Let ϕ 1 (x), ϕ 2 (x),... , ϕN (x) be linear independent functions in V and Vh the subspace generated by ϕ 1 (x),... , ϕN (x). Write the Galerkin approximation of (2) and show that it is equivalent to a linear system B~v = ~c.
1.f ) We consider continuous piecewise linear finite element to solve (1). Let the finite element basis functions (hat functions) corresponding to the grid points (xj )Nj=1 be defined as:
ϕj (x) =
x − xj− 1 xj − xj− 1
si x ∈ [xj− 1 , xj ]
x − xj+ xj − xj+
si x ∈ [xj , xj+1]
0 otherwise
, j = 1,... , N. (3)
Calculate the coefficients of B and observe that B is tridiagonal.
1.g) We use the trapezoidal formula for the computation of the integrals appearing in B and ~c. The linear system obtained is by computing these coefficients is denoted by B˜~v˜ = ~˜c. Calculate the coefficients of B˜ and ~c˜.
1.h) Write a code for the resolution of B~˜˜v = ~˜c and plot the numerical approximation of the function u(x) for N = 10, 50 , 100 , 1000. Compare with the finite differences approximation obtained before.
Problem 2 40
We consider the heat equation with a reaction term in a metallic bar of length one. We want to find the temperature u : (x, t) ∈ [0, 1] × R+ 7 → u(x, t) ∈ R satisfying
∂u ∂t
(x, t) −
∂^2 u ∂x^2
(x, t) + α(u(x, t)) = f (x, t), ∀ x ∈]0, 1[, ∀ t > 0 , u(0, t) = u(1, t) = 0, ∀ t > 0 , u(x, 0) = u 0 (x), ∀ x ∈ [0, 1].
We are interested in the approximation of this problem for various values of the coefficient α. Let us denote by τ the time step and tn^ = nτ , n = 0, 1 , 2 ,... and let N be a positive (large) integer, h = (^) N^1 +1 is the step size and xj = jh, j = 0, 1 , 2 , ..., (N + 1) are the equally spaced grid points of the discretization.
2.a) Write a numerical code for the approximation of (4) based on centered finite differences in space and an explicit Euler scheme in time. Write the corresponding numerical code for its resolution when α = 0, N = 10, τ = 1/1000 and f (x, t) = 0 and f (x, t) = 10 sin(x) cos(t). Observe the stability of the scheme when you increase the time step τ = 1/ 500 , 1 / 300 , 1 /200 and compare with the stability condition:
τ 6 h^2 2
Comment on the stability condition (5) when you consider α = 100 instead of α = 0.
2.b) For f (x, t) > 0 and α = 0, we keep n fixed and we assume that (5) holds. Prove that
(a) If uni > 0, i = 0,... , N + 1 then un i +1> 0, i = 0,... , N + 1. (b) If f ≡ 0:
max 06 i 6 N +
|un i +1| 6 max 06 i 6 N +
|uni |.