SlideShare a Scribd company logo
1 of 8
Download to read offline
UNIVERSITÀ DEGLI STUDI DI ROMA
TOR VERGATA
Dipartimento di Matematica
Laurea in Matematica pura e applicata
Laurea in Mathematical Engineering
Laboratorio di calcolo
Finite Element Method with Freefem++
Filingeri Giuseppe
Peluso Fabio
Zenelanska Alexandra
Prof.ssa Pelosi Francesca
Prof. Baldi Paolo
1
Contents
1 Introduction 3
2 Case study 4
2.1 Poisson problem in (0, 1)2
. . . . . . . . . . . . . . . . . . . . 4
2.2 Poisson problem in the circle . . . . . . . . . . . . . . . . . . . 6
2
1 Introduction
In mathematics, a partial dierential equation (PDE) is a dierential
equation that contains unknown multivariable functions and their partial
derivatives. (A special case are ordinary dierential equations (ODEs), which
deal with functions of a single variable and their derivatives.) PDEs are used
to formulate problems involving functions of several variables, and are either
solved by hand, or used to create a relevant computer model. In this paper
we will consider a time independent PDE given by a 2-dimensional Poisson
problem with Dirichlet boundary condition.
−∆u = f on Ω
u = g on ∂Ω
where as usually we denote ∆ the Laplacian operator and f ∈ L2
(Ω). In
most general case a PDE closed form solution in not quite easy to obtain.
For this reason several discretization method were developed such as Finite
Dierence Method (FDM) and Finite Element one (FEM). According to
FEM, strong formulation could be redened weakly applying test functions
in Sobolev space. Thanks to Divergence Theorem and Green one thus we
obtain weak formulation for our problem:
Ω
u · vdΩ = Ω
fvdΩ
with test function v choosen in {v : Ω → R|v, ∂v
∂xi
∈ L2
(Ω), v = 0 su ∂Ω}.
The above term, seen as bilinear form a(u, v) and a linear function F(v)
can be espressed as
a(u, v) = F(v)
Thus, considering the approximated solution as the right solution for
every basis function in the space ϕi, we obtain
a(ui, ϕi) = F(ϕi)
from which we obtain the linear system
Au = f
for every v belonging to the space above dened where u is still the
solution we are looking for.
3
2 Case study
Using Freefem++ to approximate the Poisson problem according to Galerkin
method with C0
the space of linear stepwise function. In our case, recalling
that in
−∆u = f on Ω
u = g on ∂Ω
the equation is not homogeneus, the formulation becomes:
Ω
u · vdΩ − dΩ
∂u
∂n
vdγ = Ω
fvdΩ
2.1 Poisson problem in (0, 1)2
let us dene Ω = (0, 1)2
, g(x, y) = y cos(2πx) on ∂Ω as the right solution
u(x, y). f(x, y) = 4(π2
)y cos(2πx) as −∆U(x, y)
In this case the set Ω is the square (0, 1)2
thus boundaries are splitted
in four region. In the Freefem++ code we use triangulated mesh with poly-
nomials P1. Then, setting laplace in the source code the program solves
weak formulation problem generating u function isovalued plot and its trian-
gulated domain Th. Finally, we obtain the discretized surface for dierent
number of points discretization.
The error behaviour in L2
norm and the order of convergence are the
following:
4
(a) n = 4 (b) n = 8.
(c) n = 16. (d) n = 32.
Figure 1: Poisson discretization for dierent number of mesh points
5
2.2 Poisson problem in the circle
let us dene Ω = (x, y) ∈ R2
: x2
+ y2
 9, g(x, y) = x2
+ y2
− 9 on ∂Ω as
the right solution u(x, y), f(x, y) = −4 as −∆U(x, y) In this case the set Ω
is the circle of radius 3 thus boundaries are equal. In the Freefem++ code
we use triangulated mesh with polynomials P1. Then, setting laplace in
the source code the program solves weak formulation problem generating u
function isovalued plot and its triangulated domain Th. Finally, we obtain
the discretized surface for dierent number of points discretization.
Per il problema i) b otteniamo i risultati seguenti. In questo caso, essendo
il bordo un cerchio, viene parametrizzato.
The error behaviour in L2
norm and the order of convergence are the fol-
lowing:
6
(a) n = 4 (b) n = 8.
(c) n = 16. (d) n = 32.
Figure 2: Poisson discretization for dierent number of mesh points
7
Considering another polynomial space for basis function with another one
of higher order we expect a higher order of accuracy and a lower error in L2
norm for xed number of discretization points. Using polynomial belong-
ing to P2, thus the error decrease for xed mesh points. Note that in the
second case the error does not decrease since we are near to the maximum
representation error in C++.
8

More Related Content

What's hot

Finite difference method
Finite difference methodFinite difference method
Finite difference methodDivyansh Verma
 
1st order differential equations
1st order differential equations1st order differential equations
1st order differential equationsNisarg Amin
 
Automobile 3rd sem aem ppt.2016
Automobile 3rd sem aem ppt.2016Automobile 3rd sem aem ppt.2016
Automobile 3rd sem aem ppt.2016kalpeshvaghdodiya
 
Exact & non differential equation
Exact & non differential equationExact & non differential equation
Exact & non differential equationSiddhi Shrivas
 
System of linear equations and their solution
System of linear equations and their solutionSystem of linear equations and their solution
System of linear equations and their solutionJoseph Nilo
 
Differential equations of first order
Differential equations of first orderDifferential equations of first order
Differential equations of first ordervishalgohel12195
 
formulation of first order linear and nonlinear 2nd order differential equation
formulation of first order linear and nonlinear 2nd order differential equationformulation of first order linear and nonlinear 2nd order differential equation
formulation of first order linear and nonlinear 2nd order differential equationMahaswari Jogia
 
Second order homogeneous linear differential equations
Second order homogeneous linear differential equations Second order homogeneous linear differential equations
Second order homogeneous linear differential equations Viraj Patel
 
umerical algorithm for solving second order nonlinear fuzzy initial value pro...
umerical algorithm for solving second order nonlinear fuzzy initial value pro...umerical algorithm for solving second order nonlinear fuzzy initial value pro...
umerical algorithm for solving second order nonlinear fuzzy initial value pro...IJECEIAES
 
Solution of system of linear equations by elimination
Solution of system of linear equations by eliminationSolution of system of linear equations by elimination
Solution of system of linear equations by eliminationRegie Panganiban
 
Edexcel Maths – Core 2 – Algebraic Division and Remainder Theorem
Edexcel Maths – Core 2 – Algebraic Division and Remainder TheoremEdexcel Maths – Core 2 – Algebraic Division and Remainder Theorem
Edexcel Maths – Core 2 – Algebraic Division and Remainder TheoremUmayr Dawood
 
Engr 213 sample midterm 2b sol 2010
Engr 213 sample midterm 2b sol 2010Engr 213 sample midterm 2b sol 2010
Engr 213 sample midterm 2b sol 2010akabaka12
 
Partial differential equations
Partial differential equationsPartial differential equations
Partial differential equationsaman1894
 

What's hot (20)

Finite difference method
Finite difference methodFinite difference method
Finite difference method
 
1st order differential equations
1st order differential equations1st order differential equations
1st order differential equations
 
Lecture 02
Lecture 02Lecture 02
Lecture 02
 
Automobile 3rd sem aem ppt.2016
Automobile 3rd sem aem ppt.2016Automobile 3rd sem aem ppt.2016
Automobile 3rd sem aem ppt.2016
 
Exact & non differential equation
Exact & non differential equationExact & non differential equation
Exact & non differential equation
 
System of linear equations and their solution
System of linear equations and their solutionSystem of linear equations and their solution
System of linear equations and their solution
 
Differential equations of first order
Differential equations of first orderDifferential equations of first order
Differential equations of first order
 
formulation of first order linear and nonlinear 2nd order differential equation
formulation of first order linear and nonlinear 2nd order differential equationformulation of first order linear and nonlinear 2nd order differential equation
formulation of first order linear and nonlinear 2nd order differential equation
 
Second order homogeneous linear differential equations
Second order homogeneous linear differential equations Second order homogeneous linear differential equations
Second order homogeneous linear differential equations
 
Differential equations
Differential equationsDifferential equations
Differential equations
 
Functions limits and continuity
Functions limits and continuityFunctions limits and continuity
Functions limits and continuity
 
First order ordinary differential equations and applications
First order ordinary differential equations and applicationsFirst order ordinary differential equations and applications
First order ordinary differential equations and applications
 
Systems of equations
Systems of equationsSystems of equations
Systems of equations
 
umerical algorithm for solving second order nonlinear fuzzy initial value pro...
umerical algorithm for solving second order nonlinear fuzzy initial value pro...umerical algorithm for solving second order nonlinear fuzzy initial value pro...
umerical algorithm for solving second order nonlinear fuzzy initial value pro...
 
Improper integral
Improper integralImproper integral
Improper integral
 
Solution of system of linear equations by elimination
Solution of system of linear equations by eliminationSolution of system of linear equations by elimination
Solution of system of linear equations by elimination
 
Edexcel Maths – Core 2 – Algebraic Division and Remainder Theorem
Edexcel Maths – Core 2 – Algebraic Division and Remainder TheoremEdexcel Maths – Core 2 – Algebraic Division and Remainder Theorem
Edexcel Maths – Core 2 – Algebraic Division and Remainder Theorem
 
Engr 213 sample midterm 2b sol 2010
Engr 213 sample midterm 2b sol 2010Engr 213 sample midterm 2b sol 2010
Engr 213 sample midterm 2b sol 2010
 
Partial differential equations
Partial differential equationsPartial differential equations
Partial differential equations
 
Ch03 1
Ch03 1Ch03 1
Ch03 1
 

Similar to progfree++

Digital Text Book :POTENTIAL THEORY AND ELLIPTIC PARTIAL DIFFERENTIAL EQUATIONS
Digital Text Book :POTENTIAL THEORY AND ELLIPTIC PARTIAL DIFFERENTIAL EQUATIONS Digital Text Book :POTENTIAL THEORY AND ELLIPTIC PARTIAL DIFFERENTIAL EQUATIONS
Digital Text Book :POTENTIAL THEORY AND ELLIPTIC PARTIAL DIFFERENTIAL EQUATIONS Baasilroy
 
Numerical_PDE_Paper
Numerical_PDE_PaperNumerical_PDE_Paper
Numerical_PDE_PaperWilliam Ruys
 
590-Article Text.pdf
590-Article Text.pdf590-Article Text.pdf
590-Article Text.pdfBenoitValea
 
590-Article Text.pdf
590-Article Text.pdf590-Article Text.pdf
590-Article Text.pdfBenoitValea
 
Lecture13p.pdf.pdfThedeepness of freedom are threevalues.docx
Lecture13p.pdf.pdfThedeepness of freedom are threevalues.docxLecture13p.pdf.pdfThedeepness of freedom are threevalues.docx
Lecture13p.pdf.pdfThedeepness of freedom are threevalues.docxcroysierkathey
 
Lecture13p.pdf.pdfThedeepness of freedom are threevalues.docx
Lecture13p.pdf.pdfThedeepness of freedom are threevalues.docxLecture13p.pdf.pdfThedeepness of freedom are threevalues.docx
Lecture13p.pdf.pdfThedeepness of freedom are threevalues.docxjeremylockett77
 
Numerical solution of linear volterra fredholm integro-
Numerical solution of linear volterra fredholm integro-Numerical solution of linear volterra fredholm integro-
Numerical solution of linear volterra fredholm integro-Alexander Decker
 
first order ode with its application
 first order ode with its application first order ode with its application
first order ode with its applicationKrishna Peshivadiya
 
Fractional Newton-Raphson Method and Some Variants for the Solution of Nonlin...
Fractional Newton-Raphson Method and Some Variants for the Solution of Nonlin...Fractional Newton-Raphson Method and Some Variants for the Solution of Nonlin...
Fractional Newton-Raphson Method and Some Variants for the Solution of Nonlin...mathsjournal
 
A Fast Numerical Method For Solving Calculus Of Variation Problems
A Fast Numerical Method For Solving Calculus Of Variation ProblemsA Fast Numerical Method For Solving Calculus Of Variation Problems
A Fast Numerical Method For Solving Calculus Of Variation ProblemsSara Alvarez
 
Lecture_Slides_Mathematics_06_Optimization.pdf
Lecture_Slides_Mathematics_06_Optimization.pdfLecture_Slides_Mathematics_06_Optimization.pdf
Lecture_Slides_Mathematics_06_Optimization.pdfSantiagoGarridoBulln
 
Amity university sem ii applied mathematics ii lecturer notes
Amity university sem ii applied mathematics ii lecturer notesAmity university sem ii applied mathematics ii lecturer notes
Amity university sem ii applied mathematics ii lecturer notesAlbert Jose
 
Engineering Mathematics-IV_B.Tech_Semester-IV_Unit-IV
Engineering Mathematics-IV_B.Tech_Semester-IV_Unit-IVEngineering Mathematics-IV_B.Tech_Semester-IV_Unit-IV
Engineering Mathematics-IV_B.Tech_Semester-IV_Unit-IVRai University
 
engineeringmathematics-iv_unit-iv
engineeringmathematics-iv_unit-ivengineeringmathematics-iv_unit-iv
engineeringmathematics-iv_unit-ivKundan Kumar
 
Differential Equations Assignment Help
Differential Equations Assignment HelpDifferential Equations Assignment Help
Differential Equations Assignment HelpMaths Assignment Help
 
Reciprocity Law For Flat Conformal Metrics With Conical Singularities
Reciprocity Law For Flat Conformal Metrics With Conical SingularitiesReciprocity Law For Flat Conformal Metrics With Conical Singularities
Reciprocity Law For Flat Conformal Metrics With Conical SingularitiesLukasz Obara
 
Functional analysis in mechanics 2e
Functional analysis in mechanics  2eFunctional analysis in mechanics  2e
Functional analysis in mechanics 2eSpringer
 

Similar to progfree++ (20)

Digital Text Book :POTENTIAL THEORY AND ELLIPTIC PARTIAL DIFFERENTIAL EQUATIONS
Digital Text Book :POTENTIAL THEORY AND ELLIPTIC PARTIAL DIFFERENTIAL EQUATIONS Digital Text Book :POTENTIAL THEORY AND ELLIPTIC PARTIAL DIFFERENTIAL EQUATIONS
Digital Text Book :POTENTIAL THEORY AND ELLIPTIC PARTIAL DIFFERENTIAL EQUATIONS
 
Numerical_PDE_Paper
Numerical_PDE_PaperNumerical_PDE_Paper
Numerical_PDE_Paper
 
590-Article Text.pdf
590-Article Text.pdf590-Article Text.pdf
590-Article Text.pdf
 
590-Article Text.pdf
590-Article Text.pdf590-Article Text.pdf
590-Article Text.pdf
 
19 6
19 619 6
19 6
 
Lecture13p.pdf.pdfThedeepness of freedom are threevalues.docx
Lecture13p.pdf.pdfThedeepness of freedom are threevalues.docxLecture13p.pdf.pdfThedeepness of freedom are threevalues.docx
Lecture13p.pdf.pdfThedeepness of freedom are threevalues.docx
 
Lecture13p.pdf.pdfThedeepness of freedom are threevalues.docx
Lecture13p.pdf.pdfThedeepness of freedom are threevalues.docxLecture13p.pdf.pdfThedeepness of freedom are threevalues.docx
Lecture13p.pdf.pdfThedeepness of freedom are threevalues.docx
 
Numerical solution of linear volterra fredholm integro-
Numerical solution of linear volterra fredholm integro-Numerical solution of linear volterra fredholm integro-
Numerical solution of linear volterra fredholm integro-
 
first order ode with its application
 first order ode with its application first order ode with its application
first order ode with its application
 
Fractional Newton-Raphson Method and Some Variants for the Solution of Nonlin...
Fractional Newton-Raphson Method and Some Variants for the Solution of Nonlin...Fractional Newton-Raphson Method and Some Variants for the Solution of Nonlin...
Fractional Newton-Raphson Method and Some Variants for the Solution of Nonlin...
 
A Fast Numerical Method For Solving Calculus Of Variation Problems
A Fast Numerical Method For Solving Calculus Of Variation ProblemsA Fast Numerical Method For Solving Calculus Of Variation Problems
A Fast Numerical Method For Solving Calculus Of Variation Problems
 
Lecture_Slides_Mathematics_06_Optimization.pdf
Lecture_Slides_Mathematics_06_Optimization.pdfLecture_Slides_Mathematics_06_Optimization.pdf
Lecture_Slides_Mathematics_06_Optimization.pdf
 
ODE.pdf
ODE.pdfODE.pdf
ODE.pdf
 
Amity university sem ii applied mathematics ii lecturer notes
Amity university sem ii applied mathematics ii lecturer notesAmity university sem ii applied mathematics ii lecturer notes
Amity university sem ii applied mathematics ii lecturer notes
 
Engineering Mathematics-IV_B.Tech_Semester-IV_Unit-IV
Engineering Mathematics-IV_B.Tech_Semester-IV_Unit-IVEngineering Mathematics-IV_B.Tech_Semester-IV_Unit-IV
Engineering Mathematics-IV_B.Tech_Semester-IV_Unit-IV
 
engineeringmathematics-iv_unit-iv
engineeringmathematics-iv_unit-ivengineeringmathematics-iv_unit-iv
engineeringmathematics-iv_unit-iv
 
Differential Equations Assignment Help
Differential Equations Assignment HelpDifferential Equations Assignment Help
Differential Equations Assignment Help
 
Reciprocity Law For Flat Conformal Metrics With Conical Singularities
Reciprocity Law For Flat Conformal Metrics With Conical SingularitiesReciprocity Law For Flat Conformal Metrics With Conical Singularities
Reciprocity Law For Flat Conformal Metrics With Conical Singularities
 
Diffy Q Paper
Diffy Q PaperDiffy Q Paper
Diffy Q Paper
 
Functional analysis in mechanics 2e
Functional analysis in mechanics  2eFunctional analysis in mechanics  2e
Functional analysis in mechanics 2e
 

More from Giuseppe Filingeri (6)

presentazione
presentazionepresentazione
presentazione
 
Web_Alg_Project
Web_Alg_ProjectWeb_Alg_Project
Web_Alg_Project
 
A
AA
A
 
2
22
2
 
6
66
6
 
5
55
5
 

progfree++

  • 1. UNIVERSITÀ DEGLI STUDI DI ROMA TOR VERGATA Dipartimento di Matematica Laurea in Matematica pura e applicata Laurea in Mathematical Engineering Laboratorio di calcolo Finite Element Method with Freefem++ Filingeri Giuseppe Peluso Fabio Zenelanska Alexandra Prof.ssa Pelosi Francesca Prof. Baldi Paolo 1
  • 2. Contents 1 Introduction 3 2 Case study 4 2.1 Poisson problem in (0, 1)2 . . . . . . . . . . . . . . . . . . . . 4 2.2 Poisson problem in the circle . . . . . . . . . . . . . . . . . . . 6 2
  • 3. 1 Introduction In mathematics, a partial dierential equation (PDE) is a dierential equation that contains unknown multivariable functions and their partial derivatives. (A special case are ordinary dierential equations (ODEs), which deal with functions of a single variable and their derivatives.) PDEs are used to formulate problems involving functions of several variables, and are either solved by hand, or used to create a relevant computer model. In this paper we will consider a time independent PDE given by a 2-dimensional Poisson problem with Dirichlet boundary condition. −∆u = f on Ω u = g on ∂Ω where as usually we denote ∆ the Laplacian operator and f ∈ L2 (Ω). In most general case a PDE closed form solution in not quite easy to obtain. For this reason several discretization method were developed such as Finite Dierence Method (FDM) and Finite Element one (FEM). According to FEM, strong formulation could be redened weakly applying test functions in Sobolev space. Thanks to Divergence Theorem and Green one thus we obtain weak formulation for our problem: Ω u · vdΩ = Ω fvdΩ with test function v choosen in {v : Ω → R|v, ∂v ∂xi ∈ L2 (Ω), v = 0 su ∂Ω}. The above term, seen as bilinear form a(u, v) and a linear function F(v) can be espressed as a(u, v) = F(v) Thus, considering the approximated solution as the right solution for every basis function in the space ϕi, we obtain a(ui, ϕi) = F(ϕi) from which we obtain the linear system Au = f for every v belonging to the space above dened where u is still the solution we are looking for. 3
  • 4. 2 Case study Using Freefem++ to approximate the Poisson problem according to Galerkin method with C0 the space of linear stepwise function. In our case, recalling that in −∆u = f on Ω u = g on ∂Ω the equation is not homogeneus, the formulation becomes: Ω u · vdΩ − dΩ ∂u ∂n vdγ = Ω fvdΩ 2.1 Poisson problem in (0, 1)2 let us dene Ω = (0, 1)2 , g(x, y) = y cos(2πx) on ∂Ω as the right solution u(x, y). f(x, y) = 4(π2 )y cos(2πx) as −∆U(x, y) In this case the set Ω is the square (0, 1)2 thus boundaries are splitted in four region. In the Freefem++ code we use triangulated mesh with poly- nomials P1. Then, setting laplace in the source code the program solves weak formulation problem generating u function isovalued plot and its trian- gulated domain Th. Finally, we obtain the discretized surface for dierent number of points discretization. The error behaviour in L2 norm and the order of convergence are the following: 4
  • 5. (a) n = 4 (b) n = 8. (c) n = 16. (d) n = 32. Figure 1: Poisson discretization for dierent number of mesh points 5
  • 6. 2.2 Poisson problem in the circle let us dene Ω = (x, y) ∈ R2 : x2 + y2 9, g(x, y) = x2 + y2 − 9 on ∂Ω as the right solution u(x, y), f(x, y) = −4 as −∆U(x, y) In this case the set Ω is the circle of radius 3 thus boundaries are equal. In the Freefem++ code we use triangulated mesh with polynomials P1. Then, setting laplace in the source code the program solves weak formulation problem generating u function isovalued plot and its triangulated domain Th. Finally, we obtain the discretized surface for dierent number of points discretization. Per il problema i) b otteniamo i risultati seguenti. In questo caso, essendo il bordo un cerchio, viene parametrizzato. The error behaviour in L2 norm and the order of convergence are the fol- lowing: 6
  • 7. (a) n = 4 (b) n = 8. (c) n = 16. (d) n = 32. Figure 2: Poisson discretization for dierent number of mesh points 7
  • 8. Considering another polynomial space for basis function with another one of higher order we expect a higher order of accuracy and a lower error in L2 norm for xed number of discretization points. Using polynomial belong- ing to P2, thus the error decrease for xed mesh points. Note that in the second case the error does not decrease since we are near to the maximum representation error in C++. 8