← Indietro
EsameEsame completoTesto d’esame

Exam1

Esame completo di Numerical Modeling of Differential Problems per il corso di Aerospace Engineering presso Politecnico di Milano. Materiale proveniente dall’archivio storico Studwiz e classificato per la consultazione online.

Numerical Modeling of Differential ProblemsEsame completo

Informazioni sul documento

Cosa trovi in questo materiale

Esame completo di Numerical Modeling of Differential Problems per il corso di Aerospace Engineering presso Politecnico di Milano. Materiale proveniente dall’archivio storico Studwiz e classificato per la consultazione online.

Qualità dell’importazione: il testo è stato estratto direttamente dal documento originale.

Contenuti estratti dal documento

Passaggi rappresentativi riconosciuti nelle diverse parti del materiale. Il testo completo resta presente nella pagina per la ricerca, mentre l’anteprima compatta rende più semplice la lettura.

Pagina 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…

Anteprima

Prima pagina del documento.

Prima pagina: Exam1