Document information
- University
- Politecnico di Milano
- Degree programme
- Mathematical Engineering
- Subject
- Matematica Numerica
- Material language
- Italian
- Classification
- Exercises · By topic
- Original format
- Text
- Searchable text
Study material for Matematica Numerica, shared by the Studwiz community and reviewed by moderators.
Study material for Matematica Numerica, shared by the Studwiz community and reviewed by moderators.
Import quality: text was extracted directly from the original 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.
MATEMATICA NUMERICA A.A. 2018 - 2019 Ingegneria Matematica Prof. A. Quarteroni Prof. A. Manzoni, Dr. I. Fumagalli Esercitazione 2 - Soluzione Introduzione a PoliFEM Esercizio 1 (P) Testare il codicePoliFEM eseguendo lo script Ex1_ProbExample.m, che risolve il seguente problema ai limiti : { − ((1 +x)u′)′ + 10xu ′ + sin(x)u = 4π2 sin(2πx), 0<x< 1, u(0) = 0, u(1) = 0, con il metodo degli elementi finiti, usando elementi lineari. Soluzione 1 Il main script per eseguire la chiamata al solutoreElliptic1D_Solver è il seguente : %% POLIFEM - Esercizio 1 -- MATEMATICA NUMERICA, Prof. A. Quarteroni % Solution of the advection-diffusion problem, constant coefficients, % by the finite element method. % Copyright MOX-Politecnico di Milano, 2018 % clear everything clear all close all addpath(’Code’); %% Build Mesh a = 0; b = 1; N = 9; %% Solve with P1 finite elements fem = ’P1’; [vertices,elements,boundaries] = mesh1D(a, b, N); [uh_P1, FE_SPACE, MESH, DATA] = Elliptic1D_Solver(elements,... vertices,boundaries,fem,’Ex1_ProbExample_data’); figure feplot(uh_P1, MESH.nodes, MESH.elements, fem, ’-k’) Il data file usato per definire i coefficienti e i dati del problema è il seguente : 1 0 0.2 0.4 0.6 0.8 1-0.2 0 0.2 0.4 0.6 0.8 1 1.2 1.4 Figure 1 – Soluzione numerica del problema differenziale dell’esercizio 1, ottenuta mediante Ex1_ProbExample.m. %% POLIFEM - Esercizio 1, datafile -- MATEMATICA NUMERICA, Prof. A. Quarteroni % Solution of the advection-diffusion problem, constant coefficients, % by the finite element method. % Copyright MOX-Politecnico di Milano, 2018 data.flag_dirichlet = [1 2]; data.flag_neumann = []; data.flag_robin = []; data.bcDir = @(x,t,param)(0.*x); data.bcNeu = @(x,t,param)(0.*x); data.bcRob_alpha = @(x,t,param)(0.*x); data.bcRob_gamma = @(x,t,param)(0.*x);…
First page of the document.