Back
ExamFull examExam paper only

Exam1

Full exam for Numerical Modeling of Differential Problems in the Aerospace Engineering degree programme at Politecnico di Milano. The document covers: Numerical Modeling of Differential Problems Prof. Edie Miglio - August 23, 2021 Duration of the exam: 2.5 hours Exercise 1 (14+2 points) Consider the problem −∆u =f in Ω = (0, 1)2, ∇u· n +u =gN on ∂Ω, (1) where f(x,y ) =π2 ( cos(2π(y +x)) + cos(2π(y−x)) + cos(2πy) + cos(2πx) ) .

Numerical Modeling of Differential ProblemsFull exam

Document information

What's included in this study material

Full exam for Numerical Modeling of Differential Problems in the Aerospace Engineering degree programme at Politecnico di Milano. The document covers: Numerical Modeling of Differential Problems Prof. Edie Miglio - August 23, 2021 Duration of the exam: 2.5 hours Exercise 1 (14+2 points) Consider the problem −∆u =f in Ω = (0, 1)2, ∇u· n +u =gN on ∂Ω, (1) where f(x,y ) =π2 ( cos(2π(y +x)) + cos(2π(y−x)) + cos(2πy) + cos(2πx) ) .

Import quality: text was extracted directly from the original document.

Extracted content from the document

Representative passages recognised in different parts of the material. The full extracted text remains available to search, while this compact preview makes the page easier to read.

Page 1

Numerical Modeling of Differential Problems Prof. Edie Miglio - August 23, 2021 Duration of the exam: 2.5 hours Exercise 1 (14+2 points) Consider the problem −∆u =f in Ω = (0, 1)2, ∇u· n +u =gN on ∂Ω, (1) where f(x,y ) =π2 ( cos(2π(y +x)) + cos(2π(y−x)) + cos(2πy) + cos(2πx) ) . 1. ( 2pts) Write the weak formulation of the problem. 2. ( 4pts) Discuss the well posedness of the (weak) problem. Does a solution exist? Is this unique? 3. ( 2pts) Consider the exact solution u(x,y ) = (cos(xπ) cos(yπ))2. • Compute the gradient∇u(x,y ). • Show that∇u(x,y )· n = 0 on ∂Ω and that gN(x,y ) = (cos(xπ) cos(yπ))2 on ∂Ω. 4. ( 2pts) Solve the problem using FEniCS and plot the solution. 5. ( 4pts) Study the accuracy of the FE discretization. 6. (Extra points 2pts) Prove your answer for point 2. To do that you may use the following version of the Poincar´ e-Friedrichs inequality ∥v∥2 L2(Ω)≤C ( ∥∇v∥2 L2(Ω) +∥v∥2 L2(∂Ω) ) for all v∈H1(Ω) and the following inequality ∥v∥L2(∂Ω)≤ ˜C∥v∥H 1(Ω) for all v∈H1(Ω), where C and ˜C are positive constants. Exercise 2 (10 points) Consider the following code: from fenics import * import matplotlib.pyplot as plt n = 10 degree = 1 mu = Constant(1e-3) b = Constant((1.0, 1.0)) f = Constant(1.0) gD = Constant(0.0) def solve_problem(n, degree, f, gD, b, mu): mesh = UnitSquareMesh(n, n, ’crossed’) V = FunctionSpace(mesh, ’CG’, degree) def boundary(x, on_boundary): 1 return on_boundary bc = DirichletBC(V, gD, boundary) u = TrialFunction(V) v = TestFunction(V) a = (mu * dot(grad(u), grad(v)) + dot(b, grad(u)) * v) * dx L = f * v * dx u = Function(V) solve(a == L, u, bc) return u, mesh u, mesh = solve_problem(n, degree, f, gD, b, mu) ax = plot(mesh) ax = plot(u) plt.colorbar(ax,fraction=0.045) plt.show() 1. ( 4pts) Study the code and identify the problem that this…

Preview

First page of the document.

First page: Exam1