MATH 212 NE 217 Douglas Wilhelm Harder Department of Electrical and Computer Engineering University of Waterloo Waterloo, Ontario, Canada Copyright © 2011.

Slides:



Advertisements
Similar presentations
ECE 250 Algorithms and Data Structures Douglas Wilhelm Harder, M.Math. LEL Department of Electrical and Computer Engineering University of Waterloo Waterloo,
Advertisements

Beginning Programming for Engineers
ECE 250 Algorithms and Data Structures Douglas Wilhelm Harder, M.Math. LEL Department of Electrical and Computer Engineering University of Waterloo Waterloo,
ECE 250 Algorithms and Data Structures Douglas Wilhelm Harder, M.Math. LEL Department of Electrical and Computer Engineering University of Waterloo Waterloo,
ECE 250 Algorithms and Data Structures Douglas Wilhelm Harder, M.Math. LEL Department of Electrical and Computer Engineering University of Waterloo Waterloo,
Laplace Transform Douglas Wilhelm Harder Department of Electrical and Computer Engineering University of Waterloo Copyright © 2008 by Douglas Wilhelm Harder.
Differentiation and Richardson Extrapolation
Topics in Applied Mathematics Douglas Wilhelm Harder Department of Electrical and Computer Engineering University of Waterloo Waterloo, Ontario, Canada.
ECE 250 Algorithms and Data Structures Douglas Wilhelm Harder, M.Math. LEL Department of Electrical and Computer Engineering University of Waterloo Waterloo,
Ch 6.1: Definition of Laplace Transform Many practical engineering problems involve mechanical or electrical systems acted upon by discontinuous or impulsive.
Boundary-value Problems and Finite-difference Equations Douglas Wilhelm Harder, M.Math. LEL Department of Electrical and Computer Engineering University.
Laplace’s Equation in 2 and 3 Dimensions Douglas Wilhelm Harder, M.Math. LEL Department of Electrical and Computer Engineering University of Waterloo Waterloo,
ECE 250 Algorithms and Data Structures Douglas Wilhelm Harder, M.Math. LEL Department of Electrical and Computer Engineering University of Waterloo Waterloo,
ECE 250 Algorithms and Data Structures Douglas Wilhelm Harder, M.Math. LEL Department of Electrical and Computer Engineering University of Waterloo Waterloo,
Scientific Computing Partial Differential Equations Poisson Equation Calculus of Variations.
ECE 250 Algorithms and Data Structures Douglas Wilhelm Harder, M.Math. LEL Department of Electrical and Computer Engineering University of Waterloo Waterloo,
ECE 250 Algorithms and Data Structures Douglas Wilhelm Harder, M.Math. LEL Department of Electrical and Computer Engineering University of Waterloo Waterloo,
ECE 250 Algorithms and Data Structures Douglas Wilhelm Harder, M.Math. LEL Department of Electrical and Computer Engineering University of Waterloo Waterloo,
MATH 212 NE 217 Douglas Wilhelm Harder Department of Electrical and Computer Engineering University of Waterloo Waterloo, Ontario, Canada Copyright © 2011.
The Wave Equation Douglas Wilhelm Harder, M.Math. LEL Department of Electrical and Computer Engineering University of Waterloo Waterloo, Ontario, Canada.
ECE 250 Algorithms and Data Structures Douglas Wilhelm Harder, M.Math. LEL Department of Electrical and Computer Engineering University of Waterloo Waterloo,
The Shooting Method for Boundary-value Problems
Fixed-Point Iteration Douglas Wilhelm Harder Department of Electrical and Computer Engineering University of Waterloo Copyright © 2007 by Douglas Wilhelm.
MATH 212 NE 217 Douglas Wilhelm Harder Department of Electrical and Computer Engineering University of Waterloo Waterloo, Ontario, Canada Copyright © 2011.
ECE 250 Algorithms and Data Structures Douglas Wilhelm Harder, M.Math. LEL Department of Electrical and Computer Engineering University of Waterloo Waterloo,
Welcome to ECE 204 Numerical Methods for Computer Engineers Douglas Wilhelm Harder Department of Electrical and Computer Engineering University of Waterloo.
Proof by Induction.
The Crank-Nicolson Method and Insulated Boundaries
Scientific Computing Partial Differential Equations Poisson Equation.
ECE 250 Algorithms and Data Structures Douglas Wilhelm Harder, M.Math. LEL Department of Electrical and Computer Engineering University of Waterloo Waterloo,
ECE 250 Algorithms and Data Structures Douglas Wilhelm Harder, M.Math. LEL Department of Electrical and Computer Engineering University of Waterloo Waterloo,
Binary Numbers Douglas Wilhelm Harder Department of Electrical and Computer Engineering University of Waterloo Copyright © 2007 by Douglas Wilhelm Harder.
ECE 250 Algorithms and Data Structures Douglas Wilhelm Harder, M.Math. LEL Department of Electrical and Computer Engineering University of Waterloo Waterloo,
ECE 250 Algorithms and Data Structures Douglas Wilhelm Harder, M.Math. LEL Department of Electrical and Computer Engineering University of Waterloo Waterloo,
ECE 250 Algorithms and Data Structures Douglas Wilhelm Harder, M.Math. LEL Department of Electrical and Computer Engineering University of Waterloo Waterloo,
ECE 250 Algorithms and Data Structures Douglas Wilhelm Harder, M.Math. LEL Department of Electrical and Computer Engineering University of Waterloo Waterloo,
MATH 212 NE 217 Douglas Wilhelm Harder Department of Electrical and Computer Engineering University of Waterloo Waterloo, Ontario, Canada Copyright © 2011.
ECE 250 Algorithms and Data Structures Douglas Wilhelm Harder, M.Math. LEL Department of Electrical and Computer Engineering University of Waterloo Waterloo,
Problems with Floating-Point Representations Douglas Wilhelm Harder Department of Electrical and Computer Engineering University of Waterloo Copyright.
ECE 250 Algorithms and Data Structures Douglas Wilhelm Harder, M.Math. LEL Department of Electrical and Computer Engineering University of Waterloo Waterloo,
Decimal Numbers Douglas Wilhelm Harder Department of Electrical and Computer Engineering University of Waterloo Copyright © 2007 by Douglas Wilhelm Harder.
Double-Precision Floating-Point Numbers Douglas Wilhelm Harder Department of Electrical and Computer Engineering University of Waterloo Copyright © 2007.
The Wave Equation Douglas Wilhelm Harder, M.Math. LEL Department of Electrical and Computer Engineering University of Waterloo Waterloo, Ontario, Canada.
MATH 212 NE 217 Douglas Wilhelm Harder Department of Electrical and Computer Engineering University of Waterloo Waterloo, Ontario, Canada Copyright © 2011.
ECE 250 Algorithms and Data Structures Douglas Wilhelm Harder, M.Math. LEL Department of Electrical and Computer Engineering University of Waterloo Waterloo,
Interpolation Search Douglas Wilhelm Harder, M.Math. LEL Department of Electrical and Computer Engineering University of Waterloo Waterloo, Ontario, Canada.
Interpolating Solutions to IVPs Douglas Wilhelm Harder, M.Math. LEL Department of Electrical and Computer Engineering University of Waterloo Waterloo,
ECE 250 Algorithms and Data Structures Douglas Wilhelm Harder, M.Math. LEL Department of Electrical and Computer Engineering University of Waterloo Waterloo,
1 Introduction In this course, we will look at: –Algorithms for solving problems efficiently –Data structures for efficiently storing, accessing, and modifying.
MATH 212 NE 217 Douglas Wilhelm Harder Department of Electrical and Computer Engineering University of Waterloo Waterloo, Ontario, Canada Copyright © 2011.
WATERLOO ELECTRICAL AND COMPUTER ENGINEERING Complaints, Discipline and Enforcement 1 WATERLOO ELECTRICAL AND COMPUTER ENGINEERING Professional Engineers.
ECE 250 Algorithms and Data Structures Douglas Wilhelm Harder, M.Math. LEL Department of Electrical and Computer Engineering University of Waterloo Waterloo,
1 The tree data structure Outline In this topic, we will cover: –Definition of a tree data structure and its components –Concepts of: Root, internal, and.
Boyce/DiPrima 9 th ed, Ch 6.1: Definition of Laplace Transform Elementary Differential Equations and Boundary Value Problems, 9 th edition, by William.
ECE 250 Algorithms and Data Structures Douglas Wilhelm Harder, M.Math. LEL Department of Electrical and Computer Engineering University of Waterloo Waterloo,
Laplace and Earnshaw1 Laplace Potential Distribution and Earnshaw’s Theorem © Frits F.M. de Mul.
ECE 250 Algorithms and Data Structures Douglas Wilhelm Harder, M.Math. LEL Department of Electrical and Computer Engineering University of Waterloo Waterloo,
1 N -ary trees This topic quickly looks at a generalization of a binary tree, where each node has up to N children –Definition –Perfect N -ary trees –Complete.
1 Binary trees Outline In this talk, we will look at the binary tree data structure: –Definition –Properties –A few applications Ropes (strings) Expression.
1 Complete binary trees Outline Introducing complete binary trees –Background –Definitions –Examples –Logarithmic height –Array storage.
Christopher Crawford PHY
Laplace Transforms.
Outline In this topic we will look at:
Open Addressing: Quadratic Probing
Boyce/DiPrima 10th ed, Ch 6.1: Definition of Laplace Transform Elementary Differential Equations and Boundary Value Problems, 10th edition, by William.
AVL Trees.
Outline Introducing perfect binary trees Definitions and examples
Multiway Search Trees.
Boundary-value problems and Finite-difference equations
Laplace’s Equation in 2 and 3 Dimensions
Presentation transcript:

MATH 212 NE 217 Douglas Wilhelm Harder Department of Electrical and Computer Engineering University of Waterloo Waterloo, Ontario, Canada Copyright © 2011 by Douglas Wilhelm Harder. All rights reserved. Advanced Calculus 2 for Electrical Engineering Advanced Calculus 2 for Nanotechnology Engineering 1-D Finite-Element Methods with Poisson’s Equation

1-D Finite-element Methods with Poisson’s Equation 2 Outline This topic discusses an introduction to finite-element methods –Review of Poisson’s equation –Defining a new kernel V(x) –Approximate solutions using uniform test functions

1-D Finite-element Methods with Poisson’s Equation 3 Outcomes Based Learning Objectives By the end of this laboratory, you will: –Understand how to approximate the heat-conduction/diffusion and wave equations in two and three dimensions –You will understand the differences between insulated and Dirichlet boundary conditions

1-D Finite-element Methods with Poisson’s Equation 4 The Target Equation Recall the first of Maxwell’s equations (Gauss’s equation): If we are attempting to solve for the underlying potential function, under the assumption that it is a conservative field, we have This is in the form of Poisson’s equation

1-D Finite-element Methods with Poisson’s Equation 5 The Target Equation In one dimension, this simplifies to: Define: and thus we are solving for

1-D Finite-element Methods with Poisson’s Equation 6 The Integral If, it follows that for any test function  (x) and therefore Substituting the alterative definition of V(x) into this equation, we get

1-D Finite-element Methods with Poisson’s Equation 7 The Integral Consider the first test function  1 (x) :

1-D Finite-element Methods with Poisson’s Equation 8 Integration by Parts Again, take but before we apply integration by parts, expand the integral: Everything in the second integral is known: bring it to the right:

1-D Finite-element Methods with Poisson’s Equation 9 Integration by Parts The left-hand integral is no different from before, and performing integration by parts, we have

1-D Finite-element Methods with Poisson’s Equation 10 Integration by Parts First, substituting in the first test function: which yields 111

1-D Finite-element Methods with Poisson’s Equation 11 The System of Linear Equations Again, recall that we approximated the solution by unknown piecewise linear functions: where we define on

1-D Finite-element Methods with Poisson’s Equation 12 Unequally Spaced Points Recall that we approximated the left-hand integral by substituting the piecewise linear functions to get:

1-D Finite-element Methods with Poisson’s Equation 13 Integration by Parts That is, our linear equations are: This time, let’s take an actual example

1-D Finite-element Methods with Poisson’s Equation 14 Integration by Parts Consider the equation with the boundary conditions u(0) = 0 u(1) = 0

1-D Finite-element Methods with Poisson’s Equation 15 Integration by Parts The solution to the boundary value problem u(0) = 0 u(1) = 0 is the exact function

1-D Finite-element Methods with Poisson’s Equation 16 Integration by Parts We know in one dimension if the right-hand side is close to zero, the solution is a straight line Thus, choose 9 interior points with a focus on the centre: >> x_uneq = [ ];

1-D Finite-element Methods with Poisson’s Equation 17 Integration by Parts We will compare this approximation with the approximation found using 9 equally spaced interior points –The finite difference approximation >> x_eq = 0:0.1:1;

1-D Finite-element Methods with Poisson’s Equation 18 The Test Functions The function to find the approximations is straight-forward: function [ v ] = uniform1d( x, uab, rho ) n = length( x ) - 2; idx = 1./diff(x); M = diag( -(idx( 1:end - 1 ) + idx( 2: end )) ) +... diag( idx( 2:end - 1 ), -1 ) +... diag( idx( 2:end - 1 ), +1 ); b = zeros ( n, 1 ); for k = 1:n b(k) = 0.5*int( rho, x(k), x(k + 2) ); end b(1) = b(1) - idx(1)*uab(1); b(end) = b(end) - idx(end)*uab(end); v = [uab(1); M \ b; uab(2)]; end int( rho, a, b ) approximates

1-D Finite-element Methods with Poisson’s Equation 19 The Test Functions The right-hand function of is also straight-forward: function [ u ] = rho( x ) u = sin( pi*x ).^4; end

1-D Finite-element Methods with Poisson’s Equation 20 The Equations Thus, we can find our two approximations: >> x_eq = (0:0.1:1)'; >> plot( x_eq, uniform1d( x_eq, [0, ), 'b+' ); >> hold on >> x_uneq = [ ]'; >> plot( x_uneq, uniform1d( x_uneq, [0, ), 'rx' );

1-D Finite-element Methods with Poisson’s Equation 21 The Equations It is difficult to see which is the better function, therefore create a function storing the actual solution (as found in Maple): function u = u(x) u = -1/16*(... (cos(pi*x).^4 - 5*cos(pi*x).^2 + 4)/pi^ *x.*(x - 1)... ); end

1-D Finite-element Methods with Poisson’s Equation 22 The Equations Instead, plotting the errors: >> x_eq = 0:0.1:1; >> plot( x_eq, uniform1d( x_eq, [0, ) - u(x_eq), 'b+' ); >> hold on >> xnu = [ ]; >> plot( x_uneq, uniform1d( x_uneq, [0, ) - u(x_uneq), 'rx' );

1-D Finite-element Methods with Poisson’s Equation 23 Integration by Parts Understanding that the right-hand side has a greater influence in the centre, appropriately changing the sample points yielded a significantly better approximation

1-D Finite-element Methods with Poisson’s Equation 24 Summary In this topic, we have generalized Laplace’s equation to Poisson’s equation –Used the same uniform test functions –We looked at a problem for which there is an exact solution Changing the points allowed us to get better approximations

1-D Finite-element Methods with Poisson’s Equation 25 What’s Next? T he impulse function (the derivative of a step function) is difficult to deal with… We will next consider test functions that avoid this… –The test functions will be tents –This generalizes to higher dimensions

1-D Finite-element Methods with Poisson’s Equation 26 References [1]Glyn James, Advanced Modern Engineering Mathematics, 4 th Ed., Prentice Hall, 2011, §§9.2-3.

1-D Finite-element Methods with Poisson’s Equation 27 Usage Notes These slides are made publicly available on the web for anyone to use If you choose to use them, or a part thereof, for a course at another institution, I ask only three things: –that you inform me that you are using the slides, –that you acknowledge my work, and –that you alert me of any mistakes which I made or changes which you make, and allow me the option of incorporating such changes (with an acknowledgment) in my set of slides Sincerely, Douglas Wilhelm Harder, MMath