Introduction to PDEs: Assignment 9: Finite elements in 1D

Size: px
Start display at page:

Download "Introduction to PDEs: Assignment 9: Finite elements in 1D"

Transcription

1 Institute of Scientific Computing Technical University Braunschweig Dr. Elmar Zander Dr. Noemi Friedman Winter Semester 213/14 Assignment 9 Due date: Introduction to PDEs: Assignment 9: Finite elements in 1D In the current assignment the Poisson equation 1 shall be solved on the unit interval using the finite element method. The problem is given by u (x) = sin(πx), u() = u(1) =. The interval shall be divided into 8 equally spaced elements, i.e. we have 9 nodes at which the function value u i has to be determined with linear interpolation in between. To make things more realistic, i.e. like in a real FEM program, we consider an arbitrary ordering of the elements and the nodes instead of the usual linear ordering in 1D; This will also translate better to higher dimensions later. The numbers of the elements and the nodes should be assigned as follows: x: 1/ /8 1 elem: node: Your task will be to create appropriate data structures to store the element and node information, assemble the system matrix and right hand side, solve the system, and display the solution. Exercise 1: Definition and test of data structures (12 points) The first thing to do is to set up two data structure to store the information as to the nodes belong to each element and to the positions of each node and to initialize them according to the scheme given above. The two data structures: 2/8 coord of node nodes of elelement nodes of elelement 2 coord of node 2 4/8 coord of node nodes of elelement nodes = coord = 9 4 3/ /8 6/ /8 6 1 nodes of elelement 8 7/8 coord of node 9 And we also define a vector with the restricted nodes (where boundary conditions has to be enforced): restr_nodes = [ ] Only the special case where the right hand side is zero is called Laplace equation. Still, some authors use errorneously the name Laplace equation also in the inhomogenous case considered here.

2 The corresponding matlab code: %Set i n i t i a l parameters numel =8; numnode=numel +1; h=1/numel ; %Set data s t r u c t u r e nodes =[8,7; 5, 3 ; 1, 5 ; 3, 8 ; 9, 4 ; 7, 9 ; 2, 6 ; 6, 1 ] ; node_order = [ 2 ; 6 ; 1 ; 5 ; 3 ; 8 ; 7 ; 9 ; 4 ] ; [ nn, IX]= s o r t ( node_order ) ; x=l i n s p a c e (, 1, numnode ) ; coord=x ( IX ) ; restr_nodes = [ 2, 4 ] ; Test your data structures with the following tests: Check for element 7 that the left node is at x = and for element 5 that the right node is at x = 1. Check one node of three more elements of your choice. For all elements check that it has the correct size h, i.e. coord(nodes(i,2))-coord(nodes(i,1)) should be equal to h within some reasonable accuracy (supposing you have the coordinates belonging to each node in coords and the nodes belonging to each element in nodes). i f testing_ mode %Check coord o f l e f t node o f element 7 and o f r i g h t node o f element 5 i f ~ ( coord ( nodes ( 7, 1 ) ) == ) e r r o r ( TESTING FAILED :... ) e l s e d i s p l a y ( TESTING... ok ) i f ~ ( coord ( nodes ( 5, 2 ) ) == 1) e r r o r ( TESTING FAILED :... ) e l s e d i s p l a y ( TESTING... ok ) %Check wether each element has length 1/8=,125 within a t h r e s h o l d eps eps =1^ 5; element_lengths=coord ( nodes (:,2)) coord ( nodes ( :, 1 ) ) ; err_length=abs ( element_lengths h ones ( s i z e ( element_lengths ) ) ) ; i f any ( err_length > eps ones ( s i z e ( err_length ) ) ) e r r o r ( TESTING FAILED :... ) e l s e d i s p l a y ( TESTING... ok )

3 Note: The testing section should be inside an if block looking something like: if testing_mode, then some lines of code doing the test, and then an statement. That way you can decide whether to run the tests by setting testing_mode to either or 1. Exercise 2: Write a plot function and test it (12 points) Before we solve the equation, we should make sure that if we have solution we can also plot it otherwise we wouldn t know whether the error is in the solution algorithm or in the plotting function. The function to be plotted is given by f(x) = sin(2πx). Store the values into a vector v such that v(i) is the value of node i i.e. v i = f(x i ). Now plot the solution using the line drawing mode x- in the plot command. Note that you first have to sort the coordinates and then the function values according to the previous sorting of the coordinates (read the help for the sort command, especially with two output arguments). Make sure that it looks like a sin function of one wavelength without any zigzagging lines. The matlab code for plotting the testfunction (or any other function): f u n c t i o n p l o t f u n c t i o n ( f, coord ) i f i s a ( f, function_handle ) v=f e v a l ( f, coord ) ; e l s e v=f ; [X, IX]= s o r t ( coord ) ; V_i=v ( IX ) ; p l o t (X, V_i, r x ) f u n c t i o n v=t e s t f u n c t i o n ( x ) v=s i n (2 pi x ) ; The plotfunction can be tested (when in testing_mode) with the command: i f testing_ mode p l o t f u n c t i o n coord ) ; The plot should give the following result when tested:

4 1.8 testing f=sin(2*pi*x) Exercise 3: Assemble the matrix (14 points) Now assemble the stiffness matrix K and the right hand side vector F. You can calculate the right by assembling the whole mass matrix M and calculating the right hand side like F = M f, or which is more efficient assemble it directly in the assembly loop by summing up local contributions using only the local mass matrix. The element stiffness matrix and mass matrix are given by ( ) ( ) K e = 1 h 1 1 M e = h respectively. Matlab code to assemble the global stiffness matrix and the right hand side F: %Define element s t i f f n e s s matrix : K_e=1/h [1, 1; 1,1]; M_e=h / 6 [ 2, 1 ; 1, 2 ] ; %Assemble g l o b a l s t i f f n e s s matrix (K) K=z e r o s ( numnode, numnode ) ; F=z e r o s ( numnode, 1 ) ; f o r i =1:numel K( nodes ( i, : ), nodes ( i, : ) ) =K( nodes ( i, : ), nodes ( i, : ) ) +K_e ( :, : ) ;

5 f_e=source_function ( coord ( nodes ( i, : ) ) ) ; F_e=M_e f_e ; F( nodes ( i, : ) ) =F( nodes ( i, : ) ) + F_e ; f u n c t i o n v=source_function ( x ) v=s i n ( pi x ) ; Test the correctness of the assembled matrix: The diagonal entries of K have to be 2/h for all inner nodes. In each row corresponding to an inner node there should be exactly three non-zero elements where the off-diagonal entries have the value 1/h. The stiffness matrix has to be singular before application of the boundary conditions and non-singular afterwards. The nonreduced stiffnes matrix: K = F = The singularity of the non-reduced stiffness matrix can be tested: i f testing_ mode i f ~ det (K)== e r r o r ( TESTING FAILED :... ) e l s e d i s p l a y ( TESTING... ok ) The given boundary condition can be enforced by changing the rows, corresponding to the restricted nodes, of F and of K (in our case row 2 and row 4): %Change K and F in accordance with the boundary c o n d i t i o n s f o r j =1: s i z e ( restr_nodes, 2 ) rn=restr_nodes ( j ) ; K( rn, : ) = z e r o s ( 1, numnode ) ; K( rn, rn )=1; F( rn )=;

6 Which gives K = F = From the resulted matrices the solution can be calculated. However it is recommed to check whether the siffness matrix is not singular: i f testing_ mode i f det (K)== e r r o r ( TESTING FAILED :... ) e l s e d i s p l a y ( TESTING... ok ) Plot the right hand side F. It should look like a smoothed version of the original function f(x) = sin(πx).

7 1.9 F sin(pi*x) Exercise 4: Solve the system (12 points) Now solve the system Ku = F for u to get the desired solution; plot it. Calculate the exact solution and compare it to your numerical result graphically (put both graphs into one diagram). The analytical solution of the PDE is: u a = 1 π 2 sin(πx) And the numerical solution can be calculated by solving the system of equations: Ku = F Using the matlab command: v=k\f Where the elements of u give the value of the solution in the distinct nodes. The function of the solution can be calculated from the ansatz function: u(x) = i v i N i (x) where N i (x) are the linear nodal basis functions. Plotting both, the analytical and the numerical solutions on one figure should give similar results:

8 .12.1 FEM solution analytical solution Now compute the error in different norms. Use the L norm (or absolute value norm) and the L 2 norm (or Euclidian norm). For simplicity use the midpoint rule for integration in each element. Computing error in the L norm means we have to calculate: u a (x) u(x) = max u a (x) u(x) We will approximate this error by linearizing the analytical solution in between the nodal values, and correspondingly we take only the maximal value of the difference in between the nodal values: u_an=( a n a l y t i c a l _ s o l u t i o n ( coord ) ) ; e r r o r _ i n f=norm ( ( u_an v ), 1 ) r e l _ e r r o r _ i n f=e r r o r _ i n f /norm (u_an, 1 ) f u n c t i o n v=a n a l y t i c a l _ s o l u t i o n ( x ) v=s i n ( pi x ) / ( pi ) ^ 2 ; Which will give the maximal nodal error:.65 And the relative error (the given error devided by the L norm of the analytical solution) is.128, thus around one percent. For the L 2 norm the following expression has to be calculated:

9 1 1 u a (x) u(x) 2 = u a (x) u(x) 2 dx We will approximate the integral by the mid-point rule: u a (x) u(x) 2 dx h [ u a ( x 1 ) u( x 1 ) 2 + u a ( x 2 ) u( x 2 ) u a ( x N ) u( x N ) 2] where x i is the coordinate of the midpoint of the elements, and N is the number of the elements (numnode). It is somewhat easy to calculate the value of numerical solution at the midpoints, as the approximated ansatzfunctions were linear, so the values can be calculated from the avarage of the values at the nodes. However, the midpoint values of the analytical solution have to be calculated from the midpointcoordinates x i.: L2_norm=; ref_norm =; f o r i =1:numel v_mid=mean( v ( nodes ( i, : ) ) ) ; coord_mid= mean( coord ( nodes ( i, : ) ) ) ; u_an_mid=a n a l y t i c a l _ s o l u t i o n ( coord_mid ) ; L2_norm=L2_norm+ h ( v_mid u_an_mid ) ^ 2 ; ref_norm=ref_norm+h u_an_mid ^ 2; error_2= s q r t ( L2_norm ) rel_error_2=error_2 / s q r t ( ref_norm ) This will give the absolute error.23, and the relative error.317. It would be somewhat faster to calculate the L2 norm using the trapezoidal rule, that is by avaraging the nodal values, that would give smaller errors. (8.962e-4, rel error:.128) Exercise 5: Optional: 2 δ-function on right hand side (2 points) (a) Modify your program in such a way that you can put a δ function on the right hand side of the original PDE. Note that you have to calculate the right hand side vector F now analytically, and not like in exercise 3, by interpolation of f. Place the position of the δ peak once on x = 1/2, i.e. exactly on a node, and once on x = 7/16, i.e. in between nodes. Give plots of both solutions. The integral to get the right hand side of the week form: F i = δ(x x 3 )N i (x)dx Ω When the dirac delta pic is at the midpoint of the bar(over node 3), the integral gives zero everywere, except when integrating with the basis function N 3 (x), corresponding to the hat function, taking unit value at the 3rd node. In the second case, only those integrals will not vanish, which involves the basis functions that are not zero on element 2, that is, the basis functions N 3 (x) and N 5 (x). Both basis function take value 1/2 at x = 7/16 and accordingly the two nonzero element of the right 2 You can gain extra points by doing this exercise, if not, this will not be counted for eligibility to the exam.

10 hand side are: F 5 = Ω 5 δ(x x 3 )N 5 (x)dx = 1/2 F 3 = Ω 3 δ(x x 3 )N 3 (x)dx = 1/2 Correspondingly the right hand side in the two cases needs to be modified to: F 1 =. 1 F 2 =..5.5 (1 points) (b) Compare the results from (a) with the exact solution. Explain why the numerical solution coincides with the exact solutions in one case, but not in the other.

11 .25 Solution with Dirac delta with midpic FEM solution analytical solution

12 .25 FEM solution analytical solution (1 points)

Numerical methods for PDEs FEM convergence, error estimates, piecewise polynomials

Numerical methods for PDEs FEM convergence, error estimates, piecewise polynomials Platzhalter für Bild, Bild auf Titelfolie hinter das Logo einsetzen Numerical methods for PDEs FEM convergence, error estimates, piecewise polynomials Dr. Noemi Friedman Contents of the course Fundamentals

More information

Time-dependent variational forms

Time-dependent variational forms Time-dependent variational forms Hans Petter Langtangen 1,2 1 Center for Biomedical Computing, Simula Research Laboratory 2 Department of Informatics, University of Oslo Oct 30, 2015 PRELIMINARY VERSION

More information

Numerical methods for PDEs FEM convergence, error estimates, piecewise polynomials

Numerical methods for PDEs FEM convergence, error estimates, piecewise polynomials Platzhalter für Bild, Bild auf Titelfolie hinter das Logo einsetzen Numerical methods for PDEs FEM convergence, error estimates, piecewise polynomials Dr. Noemi Friedman Contents of the course Fundamentals

More information

Chapter 4: Interpolation and Approximation. October 28, 2005

Chapter 4: Interpolation and Approximation. October 28, 2005 Chapter 4: Interpolation and Approximation October 28, 2005 Outline 1 2.4 Linear Interpolation 2 4.1 Lagrange Interpolation 3 4.2 Newton Interpolation and Divided Differences 4 4.3 Interpolation Error

More information

Finite Elements for Nonlinear Problems

Finite Elements for Nonlinear Problems Finite Elements for Nonlinear Problems Computer Lab 2 In this computer lab we apply finite element method to nonlinear model problems and study two of the most common techniques for solving the resulting

More information

Qualifying Examination

Qualifying Examination Summer 24 Day. Monday, September 5, 24 You have three hours to complete this exam. Work all problems. Start each problem on a All problems are 2 points. Please email any electronic files in support of

More information

Scientific Computing I

Scientific Computing I Scientific Computing I Module 8: An Introduction to Finite Element Methods Tobias Neckel Winter 2013/2014 Module 8: An Introduction to Finite Element Methods, Winter 2013/2014 1 Part I: Introduction to

More information

TMA4220: Programming project - part 1

TMA4220: Programming project - part 1 TMA4220: Programming project - part 1 TMA4220 - Numerical solution of partial differential equations using the finite element method The programming project will be split into two parts. This is the first

More information

Finite Elements. Colin Cotter. January 15, Colin Cotter FEM

Finite Elements. Colin Cotter. January 15, Colin Cotter FEM Finite Elements January 15, 2018 Why Can solve PDEs on complicated domains. Have flexibility to increase order of accuracy and match the numerics to the physics. has an elegant mathematical formulation

More information

INTRODUCTION TO FINITE ELEMENT METHODS

INTRODUCTION TO FINITE ELEMENT METHODS INTRODUCTION TO FINITE ELEMENT METHODS LONG CHEN Finite element methods are based on the variational formulation of partial differential equations which only need to compute the gradient of a function.

More information

Homework and Computer Problems for Math*2130 (W17).

Homework and Computer Problems for Math*2130 (W17). Homework and Computer Problems for Math*2130 (W17). MARCUS R. GARVIE 1 December 21, 2016 1 Department of Mathematics & Statistics, University of Guelph NOTES: These questions are a bare minimum. You should

More information

The Closed Form Reproducing Polynomial Particle Shape Functions for Meshfree Particle Methods

The Closed Form Reproducing Polynomial Particle Shape Functions for Meshfree Particle Methods The Closed Form Reproducing Polynomial Particle Shape Functions for Meshfree Particle Methods by Hae-Soo Oh Department of Mathematics, University of North Carolina at Charlotte, Charlotte, NC 28223 June

More information

A brief introduction to finite element methods

A brief introduction to finite element methods CHAPTER A brief introduction to finite element methods 1. Two-point boundary value problem and the variational formulation 1.1. The model problem. Consider the two-point boundary value problem: Given a

More information

Computational Methods for Engineering Applications II. Homework Problem Sheet 4

Computational Methods for Engineering Applications II. Homework Problem Sheet 4 S. Mishra K. O. Lye L. Scarabosio Autumn Term 2015 Computational Methods for Engineering Applications II ETH Zürich D-MATH Homework Problem Sheet 4 This assignment sheet contains some tasks marked as Core

More information

Simple Examples on Rectangular Domains

Simple Examples on Rectangular Domains 84 Chapter 5 Simple Examples on Rectangular Domains In this chapter we consider simple elliptic boundary value problems in rectangular domains in R 2 or R 3 ; our prototype example is the Poisson equation

More information

Lehrstuhl Informatik V. Lehrstuhl Informatik V. 1. solve weak form of PDE to reduce regularity properties. Lehrstuhl Informatik V

Lehrstuhl Informatik V. Lehrstuhl Informatik V. 1. solve weak form of PDE to reduce regularity properties. Lehrstuhl Informatik V Part I: Introduction to Finite Element Methods Scientific Computing I Module 8: An Introduction to Finite Element Methods Tobias Necel Winter 4/5 The Model Problem FEM Main Ingredients Wea Forms and Wea

More information

Chapter Two: Numerical Methods for Elliptic PDEs. 1 Finite Difference Methods for Elliptic PDEs

Chapter Two: Numerical Methods for Elliptic PDEs. 1 Finite Difference Methods for Elliptic PDEs Chapter Two: Numerical Methods for Elliptic PDEs Finite Difference Methods for Elliptic PDEs.. Finite difference scheme. We consider a simple example u := subject to Dirichlet boundary conditions ( ) u

More information

MATH 333: Partial Differential Equations

MATH 333: Partial Differential Equations MATH 333: Partial Differential Equations Problem Set 9, Final version Due Date: Tues., Nov. 29, 2011 Relevant sources: Farlow s book: Lessons 9, 37 39 MacCluer s book: Chapter 3 44 Show that the Poisson

More information

n 1 f n 1 c 1 n+1 = c 1 n $ c 1 n 1. After taking logs, this becomes

n 1 f n 1 c 1 n+1 = c 1 n $ c 1 n 1. After taking logs, this becomes Root finding: 1 a The points {x n+1, }, {x n, f n }, {x n 1, f n 1 } should be co-linear Say they lie on the line x + y = This gives the relations x n+1 + = x n +f n = x n 1 +f n 1 = Eliminating α and

More information

1 Introduction. 2 Elements and Shape Functions in 1D

1 Introduction. 2 Elements and Shape Functions in 1D Introduction Introduction to the Finite Element Method James R Nagel Department of Electrical and Computer Engineering University of Utah, Salt Lake City, Utah April 4, 0 The finite element method (FEM)

More information

1. Let a(x) > 0, and assume that u and u h are the solutions of the Dirichlet problem:

1. Let a(x) > 0, and assume that u and u h are the solutions of the Dirichlet problem: Mathematics Chalmers & GU TMA37/MMG800: Partial Differential Equations, 011 08 4; kl 8.30-13.30. Telephone: Ida Säfström: 0703-088304 Calculators, formula notes and other subject related material are not

More information

A simple FEM solver and its data parallelism

A simple FEM solver and its data parallelism A simple FEM solver and its data parallelism Gundolf Haase Institute for Mathematics and Scientific Computing University of Graz, Austria Chile, Jan. 2015 Partial differential equation Considered Problem

More information

Fundamental Solutions and Green s functions. Simulation Methods in Acoustics

Fundamental Solutions and Green s functions. Simulation Methods in Acoustics Fundamental Solutions and Green s functions Simulation Methods in Acoustics Definitions Fundamental solution The solution F (x, x 0 ) of the linear PDE L {F (x, x 0 )} = δ(x x 0 ) x R d Is called the fundamental

More information

Linear Systems of Equations. ChEn 2450

Linear Systems of Equations. ChEn 2450 Linear Systems of Equations ChEn 450 LinearSystems-directkey - August 5, 04 Example Circuit analysis (also used in heat transfer) + v _ R R4 I I I3 R R5 R3 Kirchoff s Laws give the following equations

More information

LECTURE NOTES ELEMENTARY NUMERICAL METHODS. Eusebius Doedel

LECTURE NOTES ELEMENTARY NUMERICAL METHODS. Eusebius Doedel LECTURE NOTES on ELEMENTARY NUMERICAL METHODS Eusebius Doedel TABLE OF CONTENTS Vector and Matrix Norms 1 Banach Lemma 20 The Numerical Solution of Linear Systems 25 Gauss Elimination 25 Operation Count

More information

Lecture 1. Finite difference and finite element methods. Partial differential equations (PDEs) Solving the heat equation numerically

Lecture 1. Finite difference and finite element methods. Partial differential equations (PDEs) Solving the heat equation numerically Finite difference and finite element methods Lecture 1 Scope of the course Analysis and implementation of numerical methods for pricing options. Models: Black-Scholes, stochastic volatility, exponential

More information

UNIVERSITY OF MANITOBA

UNIVERSITY OF MANITOBA Question Points Score INSTRUCTIONS TO STUDENTS: This is a 6 hour examination. No extra time will be given. No texts, notes, or other aids are permitted. There are no calculators, cellphones or electronic

More information

Middle East Technical University Department of Mechanical Engineering ME 413 Introduction to Finite Element Analysis. Chapter 2 Introduction to FEM

Middle East Technical University Department of Mechanical Engineering ME 413 Introduction to Finite Element Analysis. Chapter 2 Introduction to FEM Middle East Technical University Department of Mechanical Engineering ME 43 Introction to Finite Element Analysis Chapter 2 Introction to FEM These notes are prepared by Dr. Cüneyt Sert http://www.me.metu.e.tr/people/cuneyt

More information

CIV-E1060 Engineering Computation and Simulation Examination, December 12, 2017 / Niiranen

CIV-E1060 Engineering Computation and Simulation Examination, December 12, 2017 / Niiranen CIV-E16 Engineering Computation and Simulation Examination, December 12, 217 / Niiranen This examination consists of 3 problems rated by the standard scale 1...6. Problem 1 Let us consider a long and tall

More information

Finite Difference Methods for Boundary Value Problems

Finite Difference Methods for Boundary Value Problems Finite Difference Methods for Boundary Value Problems October 2, 2013 () Finite Differences October 2, 2013 1 / 52 Goals Learn steps to approximate BVPs using the Finite Difference Method Start with two-point

More information

Physics 202 Laboratory 5. Linear Algebra 1. Laboratory 5. Physics 202 Laboratory

Physics 202 Laboratory 5. Linear Algebra 1. Laboratory 5. Physics 202 Laboratory Physics 202 Laboratory 5 Linear Algebra Laboratory 5 Physics 202 Laboratory We close our whirlwind tour of numerical methods by advertising some elements of (numerical) linear algebra. There are three

More information

Method of Finite Elements I

Method of Finite Elements I Method of Finite Elements I PhD Candidate - Charilaos Mylonas HIL H33.1 and Boundary Conditions, 26 March, 2018 Institute of Structural Engineering Method of Finite Elements I 1 Outline 1 2 Penalty method

More information

you expect to encounter difficulties when trying to solve A x = b? 4. A composite quadrature rule has error associated with it in the following form

you expect to encounter difficulties when trying to solve A x = b? 4. A composite quadrature rule has error associated with it in the following form Qualifying exam for numerical analysis (Spring 2017) Show your work for full credit. If you are unable to solve some part, attempt the subsequent parts. 1. Consider the following finite difference: f (0)

More information

18.085, PROBLEM SET 1 SOLUTIONS

18.085, PROBLEM SET 1 SOLUTIONS 18.085, PROBLEM SET 1 SOLUTIONS Question 1. (20 pts.) Using odd values of n, the error is on the order of machine precision, about 10 16, for smaller values of n. We expect this because we are doing finite

More information

Introduction to PDEs and Numerical Methods Tutorial 10. Finite Element Analysis

Introduction to PDEs and Numerical Methods Tutorial 10. Finite Element Analysis Patzhater für Bid, Bid auf Titefoie hinter das Logo einsetzen Introduction to PDEs and Numerica Methods Tutoria. Finite Eement Anaysis Dr. Noemi Friedman, 3..2 FROM STRONG FORM TO WEAK FORM inhomogeneous

More information

Poisson Solvers. William McLean. April 21, Return to Math3301/Math5315 Common Material.

Poisson Solvers. William McLean. April 21, Return to Math3301/Math5315 Common Material. Poisson Solvers William McLean April 21, 2004 Return to Math3301/Math5315 Common Material 1 Introduction Many problems in applied mathematics lead to a partial differential equation of the form a 2 u +

More information

Final EXAM Preparation Sheet

Final EXAM Preparation Sheet Final EXAM Preparation Sheet M369 Fall 217 1 Key concepts The following list contains the main concepts and ideas that we have explored this semester. For each concept, make sure that you remember about

More information

Applied Linear Algebra in Geoscience Using MATLAB

Applied Linear Algebra in Geoscience Using MATLAB Applied Linear Algebra in Geoscience Using MATLAB Contents Getting Started Creating Arrays Mathematical Operations with Arrays Using Script Files and Managing Data Two-Dimensional Plots Programming in

More information

Introduction to PDEs and Numerical Methods Tutorial 1: Overview of essential linear algebra and analysis

Introduction to PDEs and Numerical Methods Tutorial 1: Overview of essential linear algebra and analysis Platzhalter für Bild, Bild auf Titelfolie hinter das Logo einsetzen Introduction to PDEs and Numerical Methods Tutorial 1: Overview of essential linear algebra and analysis Dr. Noemi Friedman, 25.10.201.

More information

Formulation of the displacement-based Finite Element Method and General Convergence Results

Formulation of the displacement-based Finite Element Method and General Convergence Results Formulation of the displacement-based Finite Element Method and General Convergence Results z Basics of Elasticity Theory strain e: measure of relative distortions u r r' y for small displacements : x

More information

The Finite Element Method for the Wave Equation

The Finite Element Method for the Wave Equation The Finite Element Method for the Wave Equation 1 The Wave Equation We consider the scalar wave equation modelling acoustic wave propagation in a bounded domain 3, with boundary Γ : 1 2 u c(x) 2 u 0, in

More information

Institute of Structural Engineering Page 1. Method of Finite Elements I. Chapter 2. The Direct Stiffness Method. Method of Finite Elements I

Institute of Structural Engineering Page 1. Method of Finite Elements I. Chapter 2. The Direct Stiffness Method. Method of Finite Elements I Institute of Structural Engineering Page 1 Chapter 2 The Direct Stiffness Method Institute of Structural Engineering Page 2 Direct Stiffness Method (DSM) Computational method for structural analysis Matrix

More information

Linear Algebra, 4th day, Thursday 7/1/04 REU Info:

Linear Algebra, 4th day, Thursday 7/1/04 REU Info: Linear Algebra, 4th day, Thursday 7/1/04 REU 004. Info http//people.cs.uchicago.edu/laci/reu04. Instructor Laszlo Babai Scribe Nick Gurski 1 Linear maps We shall study the notion of maps between vector

More information

4 The matrix approach

4 The matrix approach 4 The matrix approach 4. Introduction It is not a coincidence that the finite element method blossomed at the time when computers were being developed, because it calls for a vast amount of computation

More information

A Hybrid Method for the Wave Equation. beilina

A Hybrid Method for the Wave Equation.   beilina A Hybrid Method for the Wave Equation http://www.math.unibas.ch/ beilina 1 The mathematical model The model problem is the wave equation 2 u t 2 = (a 2 u) + f, x Ω R 3, t > 0, (1) u(x, 0) = 0, x Ω, (2)

More information

1 Discretizing BVP with Finite Element Methods.

1 Discretizing BVP with Finite Element Methods. 1 Discretizing BVP with Finite Element Methods In this section, we will discuss a process for solving boundary value problems numerically, the Finite Element Method (FEM) We note that such method is a

More information

Linear Algebra: Matrix Eigenvalue Problems

Linear Algebra: Matrix Eigenvalue Problems CHAPTER8 Linear Algebra: Matrix Eigenvalue Problems Chapter 8 p1 A matrix eigenvalue problem considers the vector equation (1) Ax = λx. 8.0 Linear Algebra: Matrix Eigenvalue Problems Here A is a given

More information

Sparse Linear Systems. Iterative Methods for Sparse Linear Systems. Motivation for Studying Sparse Linear Systems. Partial Differential Equations

Sparse Linear Systems. Iterative Methods for Sparse Linear Systems. Motivation for Studying Sparse Linear Systems. Partial Differential Equations Sparse Linear Systems Iterative Methods for Sparse Linear Systems Matrix Computations and Applications, Lecture C11 Fredrik Bengzon, Robert Söderlund We consider the problem of solving the linear system

More information

Lecture 9 Approximations of Laplace s Equation, Finite Element Method. Mathématiques appliquées (MATH0504-1) B. Dewals, C.

Lecture 9 Approximations of Laplace s Equation, Finite Element Method. Mathématiques appliquées (MATH0504-1) B. Dewals, C. Lecture 9 Approximations of Laplace s Equation, Finite Element Method Mathématiques appliquées (MATH54-1) B. Dewals, C. Geuzaine V1.2 23/11/218 1 Learning objectives of this lecture Apply the finite difference

More information

Scientific Computing WS 2018/2019. Lecture 15. Jürgen Fuhrmann Lecture 15 Slide 1

Scientific Computing WS 2018/2019. Lecture 15. Jürgen Fuhrmann Lecture 15 Slide 1 Scientific Computing WS 2018/2019 Lecture 15 Jürgen Fuhrmann juergen.fuhrmann@wias-berlin.de Lecture 15 Slide 1 Lecture 15 Slide 2 Problems with strong formulation Writing the PDE with divergence and gradient

More information

Introduction to PDEs and Numerical Methods: Exam 1

Introduction to PDEs and Numerical Methods: Exam 1 Prof Dr Thomas Sonar, Institute of Analysis Winter Semester 2003/4 17122003 Introduction to PDEs and Numerical Methods: Exam 1 To obtain full points explain your solutions thoroughly and self-consistently

More information

MOL410/510 Problem Set 1 - Linear Algebra - Due Friday Sept. 30

MOL410/510 Problem Set 1 - Linear Algebra - Due Friday Sept. 30 MOL40/50 Problem Set - Linear Algebra - Due Friday Sept. 30 Use lab notes to help solve these problems. Problems marked MUST DO are required for full credit. For the remainder of the problems, do as many

More information

Preliminary Examination, Numerical Analysis, August 2016

Preliminary Examination, Numerical Analysis, August 2016 Preliminary Examination, Numerical Analysis, August 2016 Instructions: This exam is closed books and notes. The time allowed is three hours and you need to work on any three out of questions 1-4 and any

More information

Chapter 1 Piecewise Polynomial Approximation in 1D

Chapter 1 Piecewise Polynomial Approximation in 1D Chapter 1 Piecewise Polynomial Approximation in 1D Abstract n this chapter we introduce a type of functions called piecewise polynomials that can be used to approximate other more general functions, and

More information

Math 671: Tensor Train decomposition methods

Math 671: Tensor Train decomposition methods Math 671: Eduardo Corona 1 1 University of Michigan at Ann Arbor December 8, 2016 Table of Contents 1 Preliminaries and goal 2 Unfolding matrices for tensorized arrays The Tensor Train decomposition 3

More information

Math Computer Lab 4 : Fourier Series

Math Computer Lab 4 : Fourier Series Math 227 - Computer Lab 4 : Fourier Series Dylan Zwick Fall 212 This lab should be a pretty quick lab. It s goal is to introduce you to one of the coolest ideas in mathematics, the Fourier series, and

More information

LibMesh Experience and Usage

LibMesh Experience and Usage LibMesh Experience and Usage John W. Peterson peterson@cfdlab.ae.utexas.edu Univ. of Texas at Austin January 12, 2007 1 Introduction 2 Weighted Residuals 3 Poisson Equation 4 Other Examples 5 Essential

More information

Course and Wavelets and Filter Banks

Course and Wavelets and Filter Banks Course 18.327 and 1.130 Wavelets and Filter Bans Numerical solution of PDEs: Galerin approximation; wavelet integrals (projection coefficients, moments and connection coefficients); convergence Numerical

More information

Green s Functions and Distributions

Green s Functions and Distributions CHAPTER 9 Green s Functions and Distributions 9.1. Boundary Value Problems We would like to study, and solve if possible, boundary value problems such as the following: (1.1) u = f in U u = g on U, where

More information

L. Vandenberghe EE133A (Spring 2017) 3. Matrices. notation and terminology. matrix operations. linear and affine functions.

L. Vandenberghe EE133A (Spring 2017) 3. Matrices. notation and terminology. matrix operations. linear and affine functions. L Vandenberghe EE133A (Spring 2017) 3 Matrices notation and terminology matrix operations linear and affine functions complexity 3-1 Matrix a rectangular array of numbers, for example A = 0 1 23 01 13

More information

FEM Convergence for PDEs with Point Sources in 2-D and 3-D

FEM Convergence for PDEs with Point Sources in 2-D and 3-D FEM Convergence for PDEs with Point Sources in 2-D and 3-D Kourosh M. Kalayeh 1, Jonathan S. Graf 2 Matthias K. Gobbert 2 1 Department of Mechanical Engineering 2 Department of Mathematics and Statistics

More information

18.06 Problem Set 10 - Solutions Due Thursday, 29 November 2007 at 4 pm in

18.06 Problem Set 10 - Solutions Due Thursday, 29 November 2007 at 4 pm in 86 Problem Set - Solutions Due Thursday, 29 November 27 at 4 pm in 2-6 Problem : (5=5+5+5) Take any matrix A of the form A = B H CB, where B has full column rank and C is Hermitian and positive-definite

More information

Elementary Linear Algebra

Elementary Linear Algebra Matrices J MUSCAT Elementary Linear Algebra Matrices Definition Dr J Muscat 2002 A matrix is a rectangular array of numbers, arranged in rows and columns a a 2 a 3 a n a 2 a 22 a 23 a 2n A = a m a mn We

More information

Optimal multilevel preconditioning of strongly anisotropic problems.part II: non-conforming FEM. p. 1/36

Optimal multilevel preconditioning of strongly anisotropic problems.part II: non-conforming FEM. p. 1/36 Optimal multilevel preconditioning of strongly anisotropic problems. Part II: non-conforming FEM. Svetozar Margenov margenov@parallel.bas.bg Institute for Parallel Processing, Bulgarian Academy of Sciences,

More information

Notes for CS542G (Iterative Solvers for Linear Systems)

Notes for CS542G (Iterative Solvers for Linear Systems) Notes for CS542G (Iterative Solvers for Linear Systems) Robert Bridson November 20, 2007 1 The Basics We re now looking at efficient ways to solve the linear system of equations Ax = b where in this course,

More information

Linear Systems of n equations for n unknowns

Linear Systems of n equations for n unknowns Linear Systems of n equations for n unknowns In many application problems we want to find n unknowns, and we have n linear equations Example: Find x,x,x such that the following three equations hold: x

More information

Since the determinant of a diagonal matrix is the product of its diagonal elements it is trivial to see that det(a) = α 2. = max. A 1 x.

Since the determinant of a diagonal matrix is the product of its diagonal elements it is trivial to see that det(a) = α 2. = max. A 1 x. APPM 4720/5720 Problem Set 2 Solutions This assignment is due at the start of class on Wednesday, February 9th. Minimal credit will be given for incomplete solutions or solutions that do not provide details

More information

Lecture 26: Putting it all together #5... Galerkin Finite Element Methods for ODE BVPs

Lecture 26: Putting it all together #5... Galerkin Finite Element Methods for ODE BVPs Lecture 26: Putting it all together #5... Galerkin Finite Element Methods for ODE BVPs Outline 1) : Review 2) A specific Example: Piecewise linear elements 3) Computational Issues and Algorithms A) Calculation

More information

6. MESH ANALYSIS 6.1 INTRODUCTION

6. MESH ANALYSIS 6.1 INTRODUCTION 6. MESH ANALYSIS INTRODUCTION PASSIVE SIGN CONVENTION PLANAR CIRCUITS FORMATION OF MESHES ANALYSIS OF A SIMPLE CIRCUIT DETERMINANT OF A MATRIX CRAMER S RULE GAUSSIAN ELIMINATION METHOD EXAMPLES FOR MESH

More information

Linear Algebra and Matrix Inversion

Linear Algebra and Matrix Inversion Jim Lambers MAT 46/56 Spring Semester 29- Lecture 2 Notes These notes correspond to Section 63 in the text Linear Algebra and Matrix Inversion Vector Spaces and Linear Transformations Matrices are much

More information

Mathematics for Engineers. Numerical mathematics

Mathematics for Engineers. Numerical mathematics Mathematics for Engineers Numerical mathematics Integers Determine the largest representable integer with the intmax command. intmax ans = int32 2147483647 2147483647+1 ans = 2.1475e+09 Remark The set

More information

Math 342 Partial Differential Equations «Viktor Grigoryan

Math 342 Partial Differential Equations «Viktor Grigoryan Math 342 Partial Differential Equations «Viktor Grigoryan 15 Heat with a source So far we considered homogeneous wave and heat equations and the associated initial value problems on the whole line, as

More information

Linear Algebra 1 Exam 1 Solutions 6/12/3

Linear Algebra 1 Exam 1 Solutions 6/12/3 Linear Algebra 1 Exam 1 Solutions 6/12/3 Question 1 Consider the linear system in the variables (x, y, z, t, u), given by the following matrix, in echelon form: 1 2 1 3 1 2 0 1 1 3 1 4 0 0 0 1 2 3 Reduce

More information

AMS 529: Finite Element Methods: Fundamentals, Applications, and New Trends

AMS 529: Finite Element Methods: Fundamentals, Applications, and New Trends AMS 529: Finite Element Methods: Fundamentals, Applications, and New Trends Lecture 3: Finite Elements in 2-D Xiangmin Jiao SUNY Stony Brook Xiangmin Jiao Finite Element Methods 1 / 18 Outline 1 Boundary

More information

Solving linear systems (6 lectures)

Solving linear systems (6 lectures) Chapter 2 Solving linear systems (6 lectures) 2.1 Solving linear systems: LU factorization (1 lectures) Reference: [Trefethen, Bau III] Lecture 20, 21 How do you solve Ax = b? (2.1.1) In numerical linear

More information

Review for Exam 2 Ben Wang and Mark Styczynski

Review for Exam 2 Ben Wang and Mark Styczynski Review for Exam Ben Wang and Mark Styczynski This is a rough approximation of what we went over in the review session. This is actually more detailed in portions than what we went over. Also, please note

More information

Problem 1: Toolbox (25 pts) For all of the parts of this problem, you are limited to the following sets of tools:

Problem 1: Toolbox (25 pts) For all of the parts of this problem, you are limited to the following sets of tools: CS 322 Final Exam Friday 18 May 2007 150 minutes Problem 1: Toolbox (25 pts) For all of the parts of this problem, you are limited to the following sets of tools: (A) Runge-Kutta 4/5 Method (B) Condition

More information

MATH 1014 Tutorial Notes 8

MATH 1014 Tutorial Notes 8 MATH4 Calculus II (8 Spring) Topics covered in tutorial 8:. Numerical integration. Approximation integration What you need to know: Midpoint rule & its error Trapezoid rule & its error Simpson s rule &

More information

22m:033 Notes: 3.1 Introduction to Determinants

22m:033 Notes: 3.1 Introduction to Determinants 22m:033 Notes: 3. Introduction to Determinants Dennis Roseman University of Iowa Iowa City, IA http://www.math.uiowa.edu/ roseman October 27, 2009 When does a 2 2 matrix have an inverse? ( ) a a If A =

More information

A Brief Outline of Math 355

A Brief Outline of Math 355 A Brief Outline of Math 355 Lecture 1 The geometry of linear equations; elimination with matrices A system of m linear equations with n unknowns can be thought of geometrically as m hyperplanes intersecting

More information

Orthogonality of hat functions in Sobolev spaces

Orthogonality of hat functions in Sobolev spaces 1 Orthogonality of hat functions in Sobolev spaces Ulrich Reif Technische Universität Darmstadt A Strobl, September 18, 27 2 3 Outline: Recap: quasi interpolation Recap: orthogonality of uniform B-splines

More information

Linear Algebra. The Manga Guide. Supplemental Appendixes. Shin Takahashi, Iroha Inoue, and Trend-Pro Co., Ltd.

Linear Algebra. The Manga Guide. Supplemental Appendixes. Shin Takahashi, Iroha Inoue, and Trend-Pro Co., Ltd. The Manga Guide to Linear Algebra Supplemental Appendixes Shin Takahashi, Iroha Inoue, and Trend-Pro Co., Ltd. Copyright by Shin Takahashi and TREND-PRO Co., Ltd. ISBN-: 978--97--9 Contents A Workbook...

More information

LECTURE # 0 BASIC NOTATIONS AND CONCEPTS IN THE THEORY OF PARTIAL DIFFERENTIAL EQUATIONS (PDES)

LECTURE # 0 BASIC NOTATIONS AND CONCEPTS IN THE THEORY OF PARTIAL DIFFERENTIAL EQUATIONS (PDES) LECTURE # 0 BASIC NOTATIONS AND CONCEPTS IN THE THEORY OF PARTIAL DIFFERENTIAL EQUATIONS (PDES) RAYTCHO LAZAROV 1 Notations and Basic Functional Spaces Scalar function in R d, d 1 will be denoted by u,

More information

ACM106a - Homework 2 Solutions

ACM106a - Homework 2 Solutions ACM06a - Homework 2 Solutions prepared by Svitlana Vyetrenko October 7, 2006. Chapter 2, problem 2.2 (solution adapted from Golub, Van Loan, pp.52-54): For the proof we will use the fact that if A C m

More information

arxiv: v1 [math.co] 3 Nov 2014

arxiv: v1 [math.co] 3 Nov 2014 SPARSE MATRICES DESCRIBING ITERATIONS OF INTEGER-VALUED FUNCTIONS BERND C. KELLNER arxiv:1411.0590v1 [math.co] 3 Nov 014 Abstract. We consider iterations of integer-valued functions φ, which have no fixed

More information

MAE 107 Homework 7 Solutions

MAE 107 Homework 7 Solutions MAE 107 Homework 7 Solutions 1. Tridiagonal system for u xx (x) + u(x) = 1 + sin(πx/4), for x [0, ], where u(0) =, u() = 4, with step size h = 1/. The total number of segments are: n = 0 1/ =. The nodes

More information

Introduction. J.M. Burgers Center Graduate Course CFD I January Least-Squares Spectral Element Methods

Introduction. J.M. Burgers Center Graduate Course CFD I January Least-Squares Spectral Element Methods Introduction In this workshop we will introduce you to the least-squares spectral element method. As you can see from the lecture notes, this method is a combination of the weak formulation derived from

More information

Question 9: PDEs Given the function f(x, y), consider the problem: = f(x, y) 2 y2 for 0 < x < 1 and 0 < x < 1. x 2 u. u(x, 0) = u(x, 1) = 0 for 0 x 1

Question 9: PDEs Given the function f(x, y), consider the problem: = f(x, y) 2 y2 for 0 < x < 1 and 0 < x < 1. x 2 u. u(x, 0) = u(x, 1) = 0 for 0 x 1 Question 9: PDEs Given the function f(x, y), consider the problem: 2 u x 2 u = f(x, y) 2 y2 for 0 < x < 1 and 0 < x < 1 u(x, 0) = u(x, 1) = 0 for 0 x 1 u(0, y) = u(1, y) = 0 for 0 y 1. a. Discuss how you

More information

Lecture 3: QR-Factorization

Lecture 3: QR-Factorization Lecture 3: QR-Factorization This lecture introduces the Gram Schmidt orthonormalization process and the associated QR-factorization of matrices It also outlines some applications of this factorization

More information

Finite Element Methods

Finite Element Methods Solving Operator Equations Via Minimization We start with several definitions. Definition. Let V be an inner product space. A linear operator L: D V V is said to be positive definite if v, Lv > for every

More information

Scientific Computing WS 2017/2018. Lecture 18. Jürgen Fuhrmann Lecture 18 Slide 1

Scientific Computing WS 2017/2018. Lecture 18. Jürgen Fuhrmann Lecture 18 Slide 1 Scientific Computing WS 2017/2018 Lecture 18 Jürgen Fuhrmann juergen.fuhrmann@wias-berlin.de Lecture 18 Slide 1 Lecture 18 Slide 2 Weak formulation of homogeneous Dirichlet problem Search u H0 1 (Ω) (here,

More information

WRT in 2D: Poisson Example

WRT in 2D: Poisson Example WRT in 2D: Poisson Example Consider 2 u f on [, L x [, L y with u. WRT: For all v X N, find u X N a(v, u) such that v u dv v f dv. Follows from strong form plus integration by parts: ( ) 2 u v + 2 u dx

More information

Assignment #10: Diagonalization of Symmetric Matrices, Quadratic Forms, Optimization, Singular Value Decomposition. Name:

Assignment #10: Diagonalization of Symmetric Matrices, Quadratic Forms, Optimization, Singular Value Decomposition. Name: Assignment #10: Diagonalization of Symmetric Matrices, Quadratic Forms, Optimization, Singular Value Decomposition Due date: Friday, May 4, 2018 (1:35pm) Name: Section Number Assignment #10: Diagonalization

More information

Introduction to PDEs and Numerical Methods Tutorial 11. 2D elliptic equations

Introduction to PDEs and Numerical Methods Tutorial 11. 2D elliptic equations Platzalter für Bild, Bild auf Titelfolie inter das Logo einsetzen Introduction to PDEs and Numerical Metods Tutorial 11. 2D elliptic equations Dr. Noemi Friedman, 3. 1. 215. Overview Introduction (classification

More information

MEI solutions to exercise 4 1

MEI solutions to exercise 4 1 MEI-55 solutions to exercise Problem Solve the stationary two-dimensional heat transfer problem shown in the figure below by using linear elements Use symmetry to reduce the problem size The material is

More information

Worst case analysis of mechanical structures by interval methods

Worst case analysis of mechanical structures by interval methods Worst case analysis of mechanical structures by interval methods Arnold Neumaier (University of Vienna, Austria) (joint work with Andrzej Pownuk) Safety Safety studies in structural engineering are supposed

More information

MAT 1302B Mathematical Methods II

MAT 1302B Mathematical Methods II MAT 1302B Mathematical Methods II Alistair Savage Mathematics and Statistics University of Ottawa Winter 2015 Lecture 19 Alistair Savage (uottawa) MAT 1302B Mathematical Methods II Winter 2015 Lecture

More information

Physics 342 Lecture 2. Linear Algebra I. Lecture 2. Physics 342 Quantum Mechanics I

Physics 342 Lecture 2. Linear Algebra I. Lecture 2. Physics 342 Quantum Mechanics I Physics 342 Lecture 2 Linear Algebra I Lecture 2 Physics 342 Quantum Mechanics I Wednesday, January 27th, 21 From separation of variables, we move to linear algebra Roughly speaking, this is the study

More information

LibMesh Experience and Usage

LibMesh Experience and Usage LibMesh Experience and Usage John W. Peterson peterson@cfdlab.ae.utexas.edu and Roy H. Stogner roystgnr@cfdlab.ae.utexas.edu Univ. of Texas at Austin September 9, 2008 1 Introduction 2 Weighted Residuals

More information

ECE 204 Numerical Methods for Computer Engineers MIDTERM EXAMINATION /8:00-9:30

ECE 204 Numerical Methods for Computer Engineers MIDTERM EXAMINATION /8:00-9:30 ECE 204 Numerical Methods for Computer Engineers MIDTERM EXAMINATION 2007-10-23/8:00-9:30 The examination is out of 67 marks. Instructions: No aides. Write your name and student ID number on each booklet.

More information