Numerical Solution of Laplace Equation By Gilberto E. Urroz, October 2004

Size: px
Start display at page:

Download "Numerical Solution of Laplace Equation By Gilberto E. Urroz, October 2004"

Transcription

1 Numerical Solution of Laplace Equation By Gilberto E. Urroz, October 004 Laplace equation governs a variety of equilibrium physical phenomena such as temperature distribution in solids, electrostatics, inviscid and irrotational two-dimensional flow (potential flow), and groundwater flow. In order to illustrate the numerical solution of the Laplace equation we consider the distribution of temperature in a two-dimensional, rectangular plate, where the temperature is maintained at given values along the four boundaries to the plate (i.e., Dirichlet-type boundary conditions). he Laplace equation, for this case, is written as 0. [0] x y NOE: While temperature distributions in solids are not of interest to most civil engineering applications, this situation provides a relatively simple physical phenomena that can be analyzed with Laplace s equation. emperature distribution in a rectangular plate he figure below represents a thin rectangular solid body whose temperature distribution is to be determined by the solution of Laplace s equation.. he rectangular body is covered with a computational grid as shown in the figure. Notice that we have arbitrarily divided the domain into 9 sub-domains (e.g., A A B B, etc.) in such a way that each sub-domain contains points on a grid with constant increments x i and y i. Here, the sub-index i describes a given sub-domain, e.g., subdomain A A B B could be identified as i, while sub-domain A A 3 B B 3 would be i, etc. Dirichlet boundary conditions for this case requires us to specify the temperature along the boundaries A A 4, A D, D D 4, and A 4 D 4. Finite difference approximation o produce a numerical solution, we proceed to find the most general finite-difference approximation for the equation on a given interior grid point. We will focus in a point such as B (or B 3, C, C 3 ), which represents the border point of four different sub-domains in the diagram above. he reason for selecting one of these points is that, at that point, the grid has different increments in both x and y, thus, being the most general case possible. his situation is illustrated in the following figure:

2 In order to find an approximation for the derivative xx we use the following equations:, i i, x x A x xx A, i i, x x B x xx B [] [] Subtracting equation [] from equation [], and solving for x / x while neglecting the terms involving xx / x, results in x i, i, x B x A. [3] Adding equations [] and [], and solving for xx / x, after replacing the expression for x, from [3], results in the following expression: xx, ( ) ( x i, i, A x B ) i i, x B x A x A x B i, o simplify the expression we introduce the following definitions: α x x A x B, β x x A x B, r x α x / β x, γ x x A x B. [4]. hus, ( ) i, xx i, i, r x ( ) i, i, Similarly, by using a aylor series expansion in y, we can obtain the following expression for the following derivatives in y: γ x [5].

3 y i, i, [6] y A y B and Where, (, ) yy i i, i, r y ( i, i, ) γ y α y y A y B, β y y A y B, r y α y / β y, γ y y A y B. [8]. [7] If we now replace the results of equations [5] and [7] into the Laplace equation, namely, xx yy 0, results in the following finite-difference approximation:, i i, r x ( ) i, i, i, γ x ( i, i, r y ( i, )) i, 0 γ y [9] Explicit solution to the finite-difference equation An explicit solution for the value of the unknown i at the center of the computational cell can be obtained from equation [9]: i γ y ( i, i, r ( x i, i, )) γ ( ( γ x x γ ) y r ( y )) [0] As indicated earlier, the result in equation [0] represents the most general case for the explicit solution for a node in the computational domain with different increments in both x and y. With reference to the grid shown earlier, this corresponds to one of these points: B, B 3, C, or C 3. Other possibilities to consider are illustrated in the following figure and detailed below: 3

4 Along lines B B, B B 3, B 3 B 4, C C, C C 3, and C 3 C 4 in page (except for the extreme points), where the values of the increment in x remain constant (see case (a) in the figure above): x A x B x, r x α x 0, β x x, γ x x, and i γ y ( i, i, ) x ( ( x γ ) y r ( y )) [] Along lines A B, B C, C D, A 3 B 3, B 3 C 3, and C 3 D 3 in page (except for the extreme points), where the values of the increment in x remain constant, (see case (b) in the figure above): y A y B y, r y α y 0, β y y, γ y y, and i y ( i, i, r ( x ( γ i, x y i, ) )) γ ( x ) [] In the interior points of any of the nine sub-domains shown in the grid diagram above, except for the boundary lines (see case (c) in the figure above): x A x B x, r x α x 0, β x x, γ x x, y A y B y, r y α y 0, β y y, γ y y, and equation [0] simplifies to where, β x/ y. i, i, β ( ) i, [3] ( β ) Explicit solution for uniform grid increments Consider a rectangular domain where the increments in both x and y are uniform. he appropriate equation to use for an explicit solution to the Laplace equation is equation [3]. he solution will start by loading the boundary conditions, and then calculating the values of i in the interior points of the domain. While we are initially tempted to calculate i only once with equation [3], it should be mentioned that these values are only a fist approximation to the solution. In practice, an iterative process must be performed to improve the results until each value i converges to a solution. We should, therefore, add an additional index, k, representing the current iteration, to each solution value. he solution values will now be referred to as k i, and equation [3] will be modified to read: k k k k,, β (,, ) i i i k i. [3-a] ( β ) 4

5 he iterative process should be repeated until convergence is achieved in every interior point of the domain, or until a maximum number of iterations, say, 000, have been performed. Convergence can be achieved, for example, if, given a tolerance value ε, the maximum difference between two consecutive iterations is less than the tolerance, i.e., if k k max,, ε. i Consider, as an example, a rectangular domain of length L 5 cm, and height H 3.5 cm, with increments x cm, and y 0.5 cm, as illustrated in the figure below. i here will be n L/ x sub-intervals in x, and m H/ y sub-intervals in y, with and x i (i-) x, for i,,, n, y (-) y, for,,, m. he boundary conditions are given as follows: i 5 along the left and right sides of the domain, while the temperatures are given by the function b (x) 5 x (-x) for the top and bottom sides of the domain, respectively. Solution is achieved by using function LaplaceExplicit.m in Matlab : function [x,y,] LaplaceExplicit(n,m,Dx,Dy) echo off; numgrid(n,m); R 5.0; R*ones(n,m); % All () includes all boundary conditions x [0:Dx:n*Dx];y[0:Dy:m*Dy]; % x and y vectors for i :n % Boundary conditions at m and 5

6 (m) (m) R*x(i)*(-x(i)); () () R*x(i)*(x(i)-); N ; % N new iteration for solution err N-; % Parameters in the solution beta Dx/Dy; denom *(beta^); % Iterative procedure epsilon e-5; % tolerance for convergence imax 000; % maximum number of iterations allowed k ; % initial index value for iteration % Calculation loop while k< imax for i :n for :m N()((i-,)(i,)beta^*((-)()))/denom; err() abs(n()-()); N; k k ; errmax max(max(err)); if errmax < epsilon [X,Y] meshgrid(x,y); figure();contour(x,y,',0);xlabel('x');ylabel('y'); title('laplace equation solution - Dirichlet boundary conditions - Explicit'); figure(3);surfc(x,y,');xlabel('x');ylabel('y');zlabel('(x,y)'); title('laplace equation solution - Dirichlet boundary conditions - Explicit'); fprintf('convergence achieved after %i iterations.\n',k); fprintf('see the following figures:\n'); fprintf('\n'); fprintf('figure - sketch of computational grid \n'); fprintf('figure - contour plot of temperature \n'); fprintf('figure 3 - surface plot of temperature \n'); return fprintf('\n No convergence after %i iterations.',k); o activate the function for the case illustrated in the figure above we use:» [x,y,] LaplaceExplicit(5,7,,0.5) he solution is returned in the vectors x and y, and in matrix. he function produces three plots: a sketch of the grid (similar to the figure above), the solution as a contours, and the solution as a surface. he last two figures are shown next: 6

7 3.5 Laplace equation solution - Dirichlet boundary conditions - Explicit 3.5 y x Laplace equation solution - Dirichlet boundary conditions - Explicit (x,y) y 0 0 x Successive over-relaxation (SOR) A solution as that provided by equation [3] is referred as a relaxation solution, since the value at each node of the solution domain is slowly relaxed into a convergent solution. A way to accelerate the convergence is by improving the current iteration at point () by using as many values of the current iteration as possible. For example, if we are sweeping the solution grid by rows, ( i.e., by letting the sub-index i vary slower than the sub-index ), at each point i we would already know the value - k. hus, the following version of equation [3] will be used in the solution (notice the different time levels involved k and k): k k k k,, β (,, ) i i i k i. [4] ( β ) 7

8 An approach referred to as successive over-relaxation (SOR) weights the values of the solution at point i at iteration levels k and k by using weighting factors (-ω) and ω, where ω is known as the over-relaxation parameter. hus, the formula to use is: k ϖ k k k k ( ϖ ) (,, (,, )) i i β i i. [5] ( β ) k he following function, LaplaceSOR.m, calculates the solution for temperature distribution in the rectangular domain of page 5 by using successive over-relaxation as indicated by equation [5]. function [x,y,,k] LaplaceSOR(n,m,Dx,Dy,omega) echo off; numgrid(n,m); R 5.0; R*ones(n,m); % All () includes all boundary conditions x [0:Dx:n*Dx];y[0:Dy:m*Dy]; % x and y vectors for i :n % Boundary conditions at m and (m) (m) R*x(i)*(-x(i)); () () R*x(i)*(x(i)-); N ; % N new iteration for solution err N-; % Parameters in the solution beta Dx/Dy; denom *(beta^); % Iterative procedure epsilon e-5; % tolerance for convergence imax 000; % maximum number of iterations allowed k ; % initial index value for iteration % Calculation loop while k< imax for i :n for :m N()(-omega)*()omega*(N(i,)N(i-,)beta^*(()N(-)))/denom; err() abs(n()-()); N; k k ; errmax max(max(err)); if errmax < epsilon [X,Y] meshgrid(x,y); figure();contour(x,y,',0);xlabel('x');ylabel('y'); title('laplace equation solution - Dirichlet boundary conditions - Explicit'); figure(3);surfc(x,y,');xlabel('x');ylabel('y');zlabel('(x,y)'); title('laplace equation solution - Dirichlet boundary conditions - Explicit'); fprintf('convergence achieved after %i iterations.\n',k); fprintf('see the following figures:\n'); fprintf('\n'); 8

9 fprintf('figure - sketch of computational grid \n'); fprintf('figure - contour plot of temperature \n'); fprintf('figure 3 - surface plot of temperature \n'); return fprintf('\n No convergence after %i iterations.',k); An exercise using different values of and different values of ω was attempted to elucidate the effect of ω produce the smallest number of iterations. he results for a rectangular grid with n 0, m 0, and different values of β x/ y, are shown next. he results from this sensitivity analysis for successive over-relaxation in a rectangular domain, indicate that values of ω between.5 and.6 produce the smallest number of iterations for the solution, regardless of the value of β. Number of iterations beta 0. beta 0.5 beta beta beta 5 Successive Over-relaxation omega Alternative-direction successive over-relaxation (ADSOR) his approach tries to improve the solution further by sweeping first by rows, producing intermediate values of the solution that are referred to by the iteration number k/, i.e., k ϖ k ( ) ( / k k ( / k ϖ i,,,,, )) i i β i i, [6] ( β ) k / before, sweeping by columns to calculate: k k / ϖ k k / k k / ( ϖ ) i, (,, (,, )) i i β i i, [7] ( β ) 9

10 While the method indicated by equations [6] and [7] allow for the use of two different SOR parameters, namely, ω and ω, a single value can be used, i.e., ω ω ω. he following function, LaplaceADSOR.m, calculates the solution by using alternatedirection successive over-relaxation as indicated by equations [6] and [7]. function [x,y,,k] LaplaceADSOR(n,m,Dx,Dy,omega,omega) echo off; numgrid(n,m); R 5.0; R*ones(n,m); % All () includes all boundary conditions x [0:Dx:n*Dx];y[0:Dy:m*Dy]; % x and y vectors for i :n % Boundary conditions at m and (m) (m) R*x(i)*(-x(i)); () () R*x(i)*(x(i)-); N ; % N new iteration for solution I ; % I intermediate solution step err N-; % Parameters in the solution beta Dx/Dy; denom *(beta^); % Iterative procedure epsilon e-5; % tolerance for convergence imax 000; % maximum number of iterations allowed k ; % initial index value for iteration % Calculation loop while k< imax for i :n % Sweeping by rows for :m I()(-omega)*()omega*((i,)I(i-,)beta^*(()I(-)))/denom; N I; for :m % Sweeping by columns for i :n N()(-omega)*I()omega*(I(i,)N(i-,)beta^*(()N(-)))/denom; err() abs(n()-()); N; k k ; errmax max(max(err)); if errmax < epsilon [X,Y] meshgrid(x,y); figure();contour(x,y,',0);xlabel('x');ylabel('y'); title('laplace equation solution - Dirichlet boundary conditions - Explicit'); figure(3);surfc(x,y,');xlabel('x');ylabel('y');zlabel('(x,y)'); title('laplace equation solution - Dirichlet boundary conditions - Explicit'); fprintf('convergence achieved after %i iterations.\n',k); fprintf('see the following figures:\n'); 0

11 fprintf('\n'); fprintf('figure - sketch of computational grid \n'); fprintf('figure - contour plot of temperature \n'); fprintf('figure 3 - surface plot of temperature \n'); return fprintf('\n No convergence after %i iterations.',k); An exercise using different values of β and different values of ω ω ω was attempted to figure out the effect of ω in the number of iterations required for convergence. he results for a rectangular grid with n 0, m 0, and different values of β x/ y, are shown next Alternate-direction Successive Over-relaxation - Explicit beta 0. beta 0.5 beta beta beta 5 Number of iterations omega he value of ω that minimizes the number of iterations for convergence is obviously a function of β. he smaller the value of β, the higher the value of w required to minimize the number of iterations. For β 0., for example, ω.6 minimizes the number of iterations for convergence, while for β 5, the value of ω that minimizes the number of iterations is close to.0. An implicit solution Implicit solutions typically consist of solving a number of simultaneous algebraic equations involving the unknown values i in the interior points of the solution domain. For example, for points in the domain not contiguous to a boundary, i.e., for i, 3,, n-, and, 3,, m, the algebraic solutions to solve result from re-writing equation [3] to read:

12 i, i, i ( β ) β ( ) 0. [8] We ll refer to these points as the main domain. here are (n-3)(m-3) points in the main domain, thus, producing (n-3)(m-3) equations. he main domain and other sub-domains of interest are shown in the following figure. For points contiguous to boundaries, the following equations apply: Left bottom corner (L,B):, 3, ( β ), β (,, 3) 0. Left top corner (L,):, m 3, m ( β ), m β (, m, m ) 0. Right bottom corner (R,B): n, n, ( β ) n, β ( n, n, 3) 0. Right top corner (R,): n, m n, m ( β ) n, m β ( n, m n, m ) 0. Along the line i :, 3, ( β ), β (,, ) 0. Along the line i n: n, n, ( β ) n, β ( n, n, ) 0. Along the line : i, i, ( β ) i, β ( i, i, 3) 0. Along the line m: ( β ) β ( ) 0. i, m i, m m m m Notice that in these equations the values of,,,,,m,,m, n,, n,, n,m, n,m,,, n,,, and m are known. he corners, (L,B), (L,), (R,B), and (R,), produce 4 more equations besides the (n-3)(m-3) equations from the main domain. Lines i and i n produce (n-3) equations each, while the lines and m produce (m-3) equations each. hus, the

13 total number of equations produced is (n-3)(m-3) 4 (n-3) (m-3) (n-)(m-), which corresponds to the number of unknowns (n-)(m-) (n-)(m-). herefore, the system of equations should be, at least, in principle, uniquely determined. he system of equations can be cast as a matrix equation where the unknowns are the values i in the interior points of the solution domain. A difficulty that arises at this point is trying to write the matrix equation in terms of unknown variables having a single sub-index. his difficulty can be overcome by replacing the unknown i with the unknown X k where k (-)(n-) i. his way, the variables X k take the place of the variables i so that X,, X,3, etc., resulting in (n-)(m-) variables X k. he implicit solution is implemented in function LaplaceImplicit.m. he function uses sparse matrices, since a large number of elements of the matrix of coefficients for the system of equations are zero. A graph of the solution domain, diagrams of the matrix of coefficients and of the right-hand side vector, as well as graphics of the solution are produced by the function. function [x,y,] LaplaceImplicit(n,m,Dx,Dy) echo off; % he following function calculates index k for X(k) corresponding to % variable (), such that k (-)*(n-)i- k inline('(-)*(n-)i-','i','','n'); numgrid(n,m); % Shows numerical grid R 5.0; R*ones(n,m); % All () includes all boundary conditions x [0:Dx:n*Dx];y[0:Dy:m*Dy]; % x & y points in solution domain for i :n % Boundary conditions at m and (m) (m) R*x(i)*(-x(i)); () () R*x(i)*(x(i)-); beta Dx/Dy; % Parameters of the solution denom -*(beta^); kk (n-)*(m-); A zeros(kk,kk); b zeros(kk,); kvl []; kvr []; kvc []; kvb []; kv []; %main domain for i 3:n- for 3:m- kek(,n);klk(i-,,n);krk(i,,n); kck(,n);kbk(-,n);kk(,n); A(ke,kL) ; A(ke,kR) ; A(ke,kC) denom; A(ke,kB) beta^; A(ke,k)beta^; b(ke) 0; %Left-Bottom corner i;;kek(,n);krk(i,,n);kck(,n);kk(,n);b(ke)-(i-,)-beta^*(-); A(ke,kR) ; A(ke,kC) denom;a(ke,k)beta^; %Left-op corner i;m;kek(,n);krk(i,,n);kck(,n);kbk(-,n);b(ke)-(i-,)-beta^*(); A(ke,kR) ; A(ke,kC) denom;a(ke,kb) beta^; %Right-Bottom corner 3

14 in;;kek(,n);klk(i-,,n);kck(,n);kk(,n);b(ke)- (i,)-beta^*(-); A(ke,kL) ; A(ke,kC) denom;a(ke,k)beta^; %Right-op corner in;m;kek(,n);klk(i-,,n);kck(,n);kbk(-,n);b(ke)- (i,)-beta^*(); A(ke,kL) ; A(ke,kC) denom; A(ke,kB) beta^; %i (left column) i; for 3:m- kek(,n);krk(i,,n);kck(,n);kbk(-,n);kk(,n);b(ke)-(i-,); A(ke,kR) ; A(ke,kC) denom; A(ke,kB) beta^; A(ke,k)beta^; %in (right column) in; for 3:m- kek(,n);klk(i-,,n);kck(,n);kbk(-,n);kk(,n);b(ke)-(i,); A(ke,kL) ; A(ke,kC) denom; A(ke,kB) beta^; A(ke,k)beta^; % (bottom row) ; for i 3:n- kek(,n);klk(i-,,n);krk(i,,n);kck(,n);kk(,n);b(ke)-beta^*(-); A(ke,kL) ; A(ke,kR) ; A(ke,kC) denom; A(ke,k)beta^; %m (top row) m; for i 3:n- kek(,n);klk(i-,,n);krk(i,,n);kck(,n);kbk(-,n);b(ke)-beta^*(); A(ke,kL) ; A(ke,kR) ; A(ke,kC) denom; A(ke,kB) beta^; % Create sparse matrix A and sparse vector b As sparse(a); figure();spy(as);title('matrix of coefficients'); % Picture of sparse matrix A bs sparse(b); figure(3);spy(b);title('right-hand side vector'); % Picture of sparse vector b XX As\bs; % Solve using left division % Convert solution back to (), i.e., () X(k), with k - )*(n-)i- for i :n for :m ke k(,n); () XX(ke); [X,Y] meshgrid(x,y); % Generate grid data for contour plot and surface plot figure(4);contour(x,y,',0);xlabel('x');ylabel('y'); title('laplace equation solution - Dirichlet boundary conditions - Implicit'); figure(5);surfc(x,y,');xlabel('x');ylabel('y');zlabel('(x,y)'); 4

15 title('laplace equation solution - Dirichlet boundary conditions - Implicit'); % Indicate list of figures produced fprintf('see the following figures:\n'); fprintf('\n'); fprintf('figure - sketch of computational grid \n'); fprintf('figure - diagram of matrix of coefficients \n'); fprintf('figure 3 - diagram of right-hand side vector \n'); fprintf('figure 4 - contour plot of temperature \n'); fprintf('figure 5 - surface plot of temperature \n'); An example is calculated by using:» [x,y,] LaplaceImplicit(0,0,,); Results for this case are shown below Figure showing the solution domain. 5

16 0 Matrix of coefficients nz 369 Spy graph of sparse matrix of coefficients. Right-hand side vector nz 3 Spy graph of sparse right-hand side vector. 6

17 0 Laplace equation solution - Dirichlet boundary conditions - Implicit y x Contour plot of temperatures Laplace equation solution - Dirichlet boundary conditions - Implicit (x,y) y x Surface plot of temperatures 7

18 Successive over-relaxation semi-implicit scheme he main difficulty of the implicit approach described earlier is that not all domains produce systems of equations that can be easily re-cast into a sparse matrix equation. In order to simplify the solution, a semi-implicit successive over-relaxation scheme is proposed. his scheme is such that, in each sweep by rows, a tri-diagonal system of equations is produced. his tri-diagonal system can be easily solved using the homas algorithm (described later). he equation to be used in each interior point, sweeping by rows, is: which can be re-cast as k k k k,, β (,, ) i i i k i, ( β ) k i, i, k k k k ( β ) β ( ). [9] For each value of, as we let i, 3,, n, we produce (n-) equations in (n-) unknowns. hese are solved using the homas algorithm. hen, the value of is incremented, so that, 3,, m, and new solutions calculated for each value of. he process is iterative, and convergence should be checked by using, for example, the criteria: k k max ε. [0] Alternate-direction successive over-relaxation semi-implicit scheme In this scheme tri-diagonal systems of equations are produced by first sweeping by rows, to produce intermediate values i k/, and then sweeping by columns to produce the new iteration values i k. he equations to use are: k ϖ k ( ) ( / k k ( / k ϖ i,,,,, )) i i β i i, [] ( β ) k / before, sweeping by columns to calculate: k k / ϖ k k / k k / ( ϖ ) i, (,, (,, )) i i β i i, [] ( β ) homas (or double sweep) algorithm his algorithm is described briefly in Vreughdenhill s Computational Hydraulics, section 7.4 (pages 40 and 4) for the specific case of the implicit Crank-Nicholson method for the diffusion equation. In this section, the homas, or double-sweep, algorithm is described for the numerical solution of Laplace s equation in a rectangular domain. 8

19 he algorithm solves a tri-diagonal system of equations of the form a k h k- b k h k c k h k d k, [3] for k,,, N, with a 0 and c N 0. hus, only the main diagonal of the matrix of coefficients and the two adacent diagonals in this system are non-zero (hence, the name tri-diagonal). he values of the constants a k, b k, c k, and d k are obtained from the implicit equations with the appropriate definitions of the variables h k. For example, if we were to obtain the tridiagonal equations for the implicit equation given in [9], namely, i, i i, ( β ) β ( ), [9] while sweeping by rows (i.e., is constant), make the replacements k N n, h k- i-,, h k, and h k i, in equation [3]. hus, the constants to use in this case would be a k c k, b k -(β ), and d k -β ( - ), [9-b] for k,, N- and a fixed value of. he equations and constants corresponding to ki and k i n, will be determined by the boundary conditions of the problem at x x and x x n, respectively. (NOE: it is assumed that the solution grid has n subintervals in x and m sub-intervals in y). If we were to use homas algorithm to solve the implicit equation in [9] while sweeping by columns (i.e., i remains constant), you can prove that the proper replacement of indices and variables would be k, N m, h k- -, h k, and h k in equation [3]. he corresponding constants in equation [3] for this case would be: a k c k, b k -(β ), and d k -β ( i-, i, ), [8-c] for k,, m- and a fixed value of. he equations and constants corresponding to k and k m, will be determined by the boundary conditions of the problem at y y and y y m, respectively. (NOE: using equations [] and [], the constants in [3] would have a more complicated expression). he algorithm postulates the following relationship for the solution of the system of equations [3]: h k e k f k h k, [4] where dk akek d ek, e [5] b a f b k k k f k b k ck a f k k, f c b [6] 9

20 he algorithm should proceed as follows: Apply upstream boundary condition (i.e., at k ) to calculate e and f. Calculate the coefficients e k, f k for k,, N. Apply downstream boundary condition to calculate h N. Perform a backward sweep calculating the values of h k from equation [4] for k N, N-,. Exercises part I []. (a) Write a function to implement the successive over-relaxation semi-implicit scheme described above. (b) Use the function to solve for the temperature distribution in the rectangular domain described earlier. []. (a) Write a function to implement the alternate-direction successive over-relaxation semi-implicit scheme described above. (b) Use the function to solve for the temperature distribution in the rectangular domain described earlier. (c) Produce a plot showing the effect of the value of ω on the number of iterations required to achieve a solution for different values of β x/ y. NOE: he following figure applies to problems [3] and [4]: [3]. (a) Use an explicit scheme without over-relaxation to solve for the temperature distribution in the domain shown above. (b) Produce a contour plot of the temperature. Let L L 3 5 cm, L 0 cm, x x x 3 x cm, H 3 cm, H 5 cm, y y y 3 y 0.5 cm. Let the boundary conditions for the temperature be such that: 0 o C along BC. decreases linearly from 0 o C at B and C down to 0 o C at A and D, respectively. increases linearly from 0 o C at A and D, to 5 o C at H and E, respectively. increases linearly from 5 o C at H and E to 7.5 o C at G and F, respectively. 0

21 Along GF, increases linearly from 7.5 o C at G and F towards the mid-point of segment GF, where it reaches a maximum value of 0 o C. [4]. (a) Use an explicit scheme without over-relaxation to solve for the temperature distribution in the domain shown above. (b) Produce a contour plot of the temperature. Let L L 3 5 cm, L 0 cm, x cm, x 0.5 cm, x 3.5 cm, H 4 cm, H cm, y cm, y.5 cm, y cm. Use the same boundary conditions as in problem [3]. NOE: he following figure applies to problems [5] and [6]: [5]. (a) Use an explicit scheme without over-relaxation to solve for the temperature distribution in the domain shown above. (b) Produce a contour plot of the temperature. Let L 5 cm, L 4 cm, x x x cm, H 3 cm, H cm, y y y 0.5 cm. Let the boundary conditions for the temperature be such that: 0 o C along BC. decreases linearly from 0 o C at C to 5 o C at D. decreases linearly from 5 o C at D to 0 o C at E. 0 o C along EF and FA. increases linearly from 0 o C at A to 0 o C at B. [6]. (a) Use an explicit scheme without over-relaxation to solve for the temperature distribution in the domain shown above. (b) Produce a contour plot of the temperature.

22 Let L 5 cm, L 4 cm, x.5 cm. x 0.5 cm, H 3 cm, H cm, y cm, y 0.5 cm. Laplace equation solution in simple non-rectangular domains he figure below shows a two-dimensional thin solid body formed by removing the trapezoidal shape B B 3 B 4 B 4 from the rectangular shape A A 4 B B 4. he resulting shape has side B B 3 tilted by an angle θ with respect to the horizontal line B B B 4. he computational grid attached to the irregular shape above is designed so that there are a number of equally spaced grid nodes along the inclined size B B 3. he rectangular grid with increments x and y, that define the grid nodes along the inclined side, are related by tan θ y / x. he figure shows 5 different solution domains with varying size increments in x and y. Expressions for the finite-difference approximation for Laplace s equation in each of the domains, and on their boundaries, can be found, for example, by using equations [0] through [3]. he following Matlab script can be used to produce the plot of the irregularly-shaped body shown above for specific values of the dimensions L, L, L 3, H, and H : % Script for plotting irregularly-shaped body and computational grid % Calculating the geometry Dx 0.50; Dx 0.75; Dx3.00; L 3.00; L 4.50; L3 6.00; n L/Dx; n L/Dx; n3 L3/Dx3; i n; i in; i3 in3; theta 30*pi/80; Dy Dx*tan(theta); Dy 0.5; H L*tan(theta); H.00; m round(h/dy); m round(h/dy); m; mm; % Calculating coordinates x [0:Dx:L,LDx:Dx:LL,LLDx3:Dx3:LLL3]; y [0:Dy:H,HDy:Dy:HH]; % Plot solution domain figure(); plot([x(),x(i)],[y(),y()],'-b');hold on; plot([x(i),x(i)],[y(),y()],'-b');

23 plot([x(i),x(i3)],[y(),y()],'-b'); plot([x(i3),x(i3)],[y(),y()],'-b'); plot([x(),x(i3)],[y(),y()],'-b'); plot([x(),x()],[y(),y()],'-b'); axis([ ]); % Plot solution grid for : plot([x(),x(i)],[y(),y()]); for :- plot([x(),x(i3)],[y(),y()]); for i :i plot([x(i),x(i)],[y(),y()]); for i i:i3- plot([x(i),x(i)],[y(),y()]); ii [i::i]; [::]; for i :n plot([x(i),x(ii(i))],[y((i)),y((i))]); plot([x(ii(i)),x(ii(i))],[y((i)),y()]); hold off; he following figure shows the result:

24 Outline of an explicit solution with Dirichlet boundary conditions For Dirichlet-type boundary conditions, the temperature will be known in every grid point on the boundary. For example, along the inclined boundary B B 3, the values of i, with () (i,),(i,),,( i, ) must be known. he algorithm for an implicit solution would proceed as follows: Load boundary conditions on all grid points on the boundaries. Use equation [0] for point C. Use equation [] for the points on lines C C and C B 3. Use equation [] for points on the lines A C, C B, and A 3 B 3. Finally, use equation [3] for interior points in each of the 5 domains. he solution is iterative, with a convergence criteria such as equation [0] used to determine when a solution has been achieved. hus, the explicit solution approach is very similar to that of a rectangular domain. NOE: Implicit solutions can also be set up following the approach used for rectangular domains after defining a solution grid as the one shown above. Exercises part II [7]. For the irregularly-shaped domain shown below, (a) use an explicit method to solve the Laplace equation for temperature distribution (equation [0]) as specified below. he dimensions of the figure are: L 0 cm, L 5 cm, L 3 8 cm, H 5 cm, H 3 cm, H 3 cm, x cm, x 0.5 cm, x 3 cm, y 0.5 cm, y 0.5 cm, y 3 0. cm. Boundary conditions: 80 o C along A B C D, 60 o along A B C D, varies linearly along A A 3 A 4 A as well as along D D, so that the temperature at the boundaries is continuous. (b) Produce a contour plot of the temperature distribution. Derivation of Laplace s and Poisson s equation in heat transfer in solids he heat flux (per unit area), q x, along the x direction is given by the equation 4

25 q x k, [7] x where k is the thermal conductivity of the material, and is the temperature. Equation [7] indicates that the heat flux q[j/m ] is proportional to the temperature gradient,, and that heat flows in the direction of decreasing temperature. he units of k are J/ o K m. It is possible to define a heat flux vector that accounts for heat fluxes in both the x and y directions for a two-dimensional case. hus, the heat flux vector would be written as: q qxi q y k i k k( i ) k grad( ) k. [8] x y x y In equation [], the differential expression the temperature, i.e., i x y is referred to as the gradient of grad( ) i. [9] x y he differential operator, called the del or nabla operator, is defined by: [ ] [ ] [ ] i. [30] x y When applied to a scalar function, such as temperature (x,y), the del operator produces a gradient (equation [9]). If applied to a vector function, e.g., to the heat flux vector from equation [8], through a dot or scalar product operation, we obtain the divergence of the vector function, e.g., q q x y div( q) q. [3] x y he divergence of a gradient of a scalar function produces the Laplacian of the scalar function, e.g., for the scalar function φ(x,y,z), φ φ φ φ φ φ div( grad( φ)). x x x y x y For the heat flux vector of equation [8], the divergence of that heat flux produces: div( q ) div( k grad( )) ( k ) k. [3] NOE: Equations [8] through [3] can be expanded to three dimensions by adding the corresponding derivatives with respect to z. he development presented here is strictly two-dimensional. 5

26 Poisson s equation Consider a two-dimensional body of thickness z that produces Q Joules of heat per unit volume in every point within the body. his heat is transported by the heat fluxes in both the x and y directions such that the net flux out of a point (measured by the divergence of the flux vector) is equal to the heat produced Q, i.e., div (q) k Q. [33] Re-writing equation [33], we find the following Poisson s equation for heat transfer with net heat production in every point: x y Q. [34] k Laplace s equation If there is no production of heat in the body of interest, then Q 0, and Poisson s equation [34] reduces to Laplace s equation: 0. [35] x y Neumann boundary condition in heat transfer in solids o incorporate a Neumann-type of boundary condition in heat transfer in solids we would need to postulate the heat flux at a given boundary. For example, if in the rectangular domain shown below, we indicate that the heat flux through, say, face BD is q x q o, then the corresponding boundary condition is: x BD qo k. [36] If face BD is thermally insulated, then no heat flux can occur through it, and the proper boundary condition is / x BD 0. he handling of Neumann-type of boundary conditions in the solution of Laplace s equation is presented in detail in a separate document on two-dimensional potential flow solutions. 6

Finite Difference Methods (FDMs) 1

Finite Difference Methods (FDMs) 1 Finite Difference Methods (FDMs) 1 1 st - order Approxima9on Recall Taylor series expansion: Forward difference: Backward difference: Central difference: 2 nd - order Approxima9on Forward difference: Backward

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

Open boundary conditions in numerical simulations of unsteady incompressible flow

Open boundary conditions in numerical simulations of unsteady incompressible flow Open boundary conditions in numerical simulations of unsteady incompressible flow M. P. Kirkpatrick S. W. Armfield Abstract In numerical simulations of unsteady incompressible flow, mass conservation can

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

Numerical Solution Techniques in Mechanical and Aerospace Engineering

Numerical Solution Techniques in Mechanical and Aerospace Engineering Numerical Solution Techniques in Mechanical and Aerospace Engineering Chunlei Liang LECTURE 3 Solvers of linear algebraic equations 3.1. Outline of Lecture Finite-difference method for a 2D elliptic PDE

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

FINITE VOLUME METHOD: BASIC PRINCIPLES AND EXAMPLES

FINITE VOLUME METHOD: BASIC PRINCIPLES AND EXAMPLES FINITE VOLUME METHOD: BASIC PRINCIPLES AND EXAMPLES SHRUTI JAIN B.Tech III Year, Electronics and Communication IIT Roorkee Tutors: Professor G. Biswas Professor S. Chakraborty ACKNOWLEDGMENTS I would like

More information

1 Finite difference example: 1D implicit heat equation

1 Finite difference example: 1D implicit heat equation 1 Finite difference example: 1D implicit heat equation 1.1 Boundary conditions Neumann and Dirichlet We solve the transient heat equation ρc p t = ( k ) (1) on the domain L/2 x L/2 subject to the following

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

Classification of partial differential equations and their solution characteristics

Classification of partial differential equations and their solution characteristics 9 TH INDO GERMAN WINTER ACADEMY 2010 Classification of partial differential equations and their solution characteristics By Ankita Bhutani IIT Roorkee Tutors: Prof. V. Buwa Prof. S. V. R. Rao Prof. U.

More information

Notes for Lecture 10

Notes for Lecture 10 February 2, 26 Notes for Lecture Introduction to grid-based methods for solving Poisson and Laplace Equations Finite difference methods The basis for most grid-based finite difference methods is the Taylor

More information

Introduction to Boundary Value Problems

Introduction to Boundary Value Problems Chapter 5 Introduction to Boundary Value Problems When we studied IVPs we saw that we were given the initial value of a function and a differential equation which governed its behavior for subsequent times.

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 the Generalized Poisson Equation Using the Finite-Difference Method (FDM)

Solving the Generalized Poisson Equation Using the Finite-Difference Method (FDM) Solving the Generalized Poisson Equation Using the Finite-Difference Method (FDM) James R. Nagel September 30, 2009 1 Introduction Numerical simulation is an extremely valuable tool for those who wish

More information

Project 4: Navier-Stokes Solution to Driven Cavity and Channel Flow Conditions

Project 4: Navier-Stokes Solution to Driven Cavity and Channel Flow Conditions Project 4: Navier-Stokes Solution to Driven Cavity and Channel Flow Conditions R. S. Sellers MAE 5440, Computational Fluid Dynamics Utah State University, Department of Mechanical and Aerospace Engineering

More information

Partial Differential Equations (PDEs) and the Finite Difference Method (FDM). An introduction

Partial Differential Equations (PDEs) and the Finite Difference Method (FDM). An introduction Page of 8 Partial Differential Equations (PDEs) and the Finite Difference Method (FDM). An introduction FILE:Chap 3 Partial Differential Equations-V6. Original: May 7, 05 Revised: Dec 9, 06, Feb 0, 07,

More information

Partial Differential Equations

Partial Differential Equations Partial Differential Equations Introduction Deng Li Discretization Methods Chunfang Chen, Danny Thorne, Adam Zornes CS521 Feb.,7, 2006 What do You Stand For? A PDE is a Partial Differential Equation This

More information

Kasetsart University Workshop. Multigrid methods: An introduction

Kasetsart University Workshop. Multigrid methods: An introduction Kasetsart University Workshop Multigrid methods: An introduction Dr. Anand Pardhanani Mathematics Department Earlham College Richmond, Indiana USA pardhan@earlham.edu A copy of these slides is available

More information

8 A pseudo-spectral solution to the Stokes Problem

8 A pseudo-spectral solution to the Stokes Problem 8 A pseudo-spectral solution to the Stokes Problem 8.1 The Method 8.1.1 Generalities We are interested in setting up a pseudo-spectral method for the following Stokes Problem u σu p = f in Ω u = 0 in Ω,

More information

Finite Difference Method for PDE. Y V S S Sanyasiraju Professor, Department of Mathematics IIT Madras, Chennai 36

Finite Difference Method for PDE. Y V S S Sanyasiraju Professor, Department of Mathematics IIT Madras, Chennai 36 Finite Difference Method for PDE Y V S S Sanyasiraju Professor, Department of Mathematics IIT Madras, Chennai 36 1 Classification of the Partial Differential Equations Consider a scalar second order partial

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

Basic Aspects of Discretization

Basic Aspects of Discretization Basic Aspects of Discretization Solution Methods Singularity Methods Panel method and VLM Simple, very powerful, can be used on PC Nonlinear flow effects were excluded Direct numerical Methods (Field Methods)

More information

Chapter 5 HIGH ACCURACY CUBIC SPLINE APPROXIMATION FOR TWO DIMENSIONAL QUASI-LINEAR ELLIPTIC BOUNDARY VALUE PROBLEMS

Chapter 5 HIGH ACCURACY CUBIC SPLINE APPROXIMATION FOR TWO DIMENSIONAL QUASI-LINEAR ELLIPTIC BOUNDARY VALUE PROBLEMS Chapter 5 HIGH ACCURACY CUBIC SPLINE APPROXIMATION FOR TWO DIMENSIONAL QUASI-LINEAR ELLIPTIC BOUNDARY VALUE PROBLEMS 5.1 Introduction When a physical system depends on more than one variable a general

More information

ECE539 - Advanced Theory of Semiconductors and Semiconductor Devices. Numerical Methods and Simulation / Umberto Ravaioli

ECE539 - Advanced Theory of Semiconductors and Semiconductor Devices. Numerical Methods and Simulation / Umberto Ravaioli ECE539 - Advanced Theory of Semiconductors and Semiconductor Devices 1 General concepts Numerical Methods and Simulation / Umberto Ravaioli Introduction to the Numerical Solution of Partial Differential

More information

Laplace's equation: the potential between parallel plates

Laplace's equation: the potential between parallel plates 4/3/01 Electrostatics Laplace Solver 1 Laplace's equation: the potential between parallel plates Laplace's equation describing the electric potential in two dimensions is: ( x, y) 0 At right is the potential

More information

Multiple Integrals and Vector Calculus (Oxford Physics) Synopsis and Problem Sets; Hilary 2015

Multiple Integrals and Vector Calculus (Oxford Physics) Synopsis and Problem Sets; Hilary 2015 Multiple Integrals and Vector Calculus (Oxford Physics) Ramin Golestanian Synopsis and Problem Sets; Hilary 215 The outline of the material, which will be covered in 14 lectures, is as follows: 1. Introduction

More information

Math background. Physics. Simulation. Related phenomena. Frontiers in graphics. Rigid fluids

Math background. Physics. Simulation. Related phenomena. Frontiers in graphics. Rigid fluids Fluid dynamics Math background Physics Simulation Related phenomena Frontiers in graphics Rigid fluids Fields Domain Ω R2 Scalar field f :Ω R Vector field f : Ω R2 Types of derivatives Derivatives measure

More information

Introduction. Finite and Spectral Element Methods Using MATLAB. Second Edition. C. Pozrikidis. University of Massachusetts Amherst, USA

Introduction. Finite and Spectral Element Methods Using MATLAB. Second Edition. C. Pozrikidis. University of Massachusetts Amherst, USA Introduction to Finite and Spectral Element Methods Using MATLAB Second Edition C. Pozrikidis University of Massachusetts Amherst, USA (g) CRC Press Taylor & Francis Group Boca Raton London New York CRC

More information

INTRODUCTION TO PDEs

INTRODUCTION TO PDEs INTRODUCTION TO PDEs In this course we are interested in the numerical approximation of PDEs using finite difference methods (FDM). We will use some simple prototype boundary value problems (BVP) and initial

More information

Numerical Solutions to Partial Differential Equations

Numerical Solutions to Partial Differential Equations Numerical Solutions to Partial Differential Equations Zhiping Li LMAM and School of Mathematical Sciences Peking University Numerical Methods for Partial Differential Equations Finite Difference Methods

More information

PDE Solvers for Fluid Flow

PDE Solvers for Fluid Flow PDE Solvers for Fluid Flow issues and algorithms for the Streaming Supercomputer Eran Guendelman February 5, 2002 Topics Equations for incompressible fluid flow 3 model PDEs: Hyperbolic, Elliptic, Parabolic

More information

DOING PHYSICS WITH MATLAB ELECTRIC FIELD AND ELECTRIC POTENTIAL: POISSON S EQUATION

DOING PHYSICS WITH MATLAB ELECTRIC FIELD AND ELECTRIC POTENTIAL: POISSON S EQUATION DOING PHYSICS WITH MATLAB ELECTRIC FIELD AND ELECTRIC POTENTIAL: POISSON S EQUATION Ian Cooper School of Physics, University of Sydney ian.cooper@sydney.edu.au DOWNLOAD DIRECTORY FOR MATLAB SCRIPTS For

More information

Divergence Theorem and Its Application in Characterizing

Divergence Theorem and Its Application in Characterizing Divergence Theorem and Its Application in Characterizing Fluid Flow Let v be the velocity of flow of a fluid element and ρ(x, y, z, t) be the mass density of fluid at a point (x, y, z) at time t. Thus,

More information

Part I. Discrete Models. Part I: Discrete Models. Scientific Computing I. Motivation: Heat Transfer. A Wiremesh Model (2) A Wiremesh Model

Part I. Discrete Models. Part I: Discrete Models. Scientific Computing I. Motivation: Heat Transfer. A Wiremesh Model (2) A Wiremesh Model Part I: iscrete Models Scientific Computing I Module 5: Heat Transfer iscrete and Continuous Models Tobias Neckel Winter 04/05 Motivation: Heat Transfer Wiremesh Model A Finite Volume Model Time ependent

More information

DOING PHYSICS WITH MATLAB. ELECTRIC FIELD AND ELECTRIC POTENTIAL: POISSON S and LAPLACES S EQUATIONS

DOING PHYSICS WITH MATLAB. ELECTRIC FIELD AND ELECTRIC POTENTIAL: POISSON S and LAPLACES S EQUATIONS DOING PHYSICS WITH MATLAB ELECTRIC FIELD AND ELECTRIC POTENTIAL: POISSON S and LAPLACES S EQUATIONS Ian Cooper School of Physics, University of Sydney ian.cooper@sydney.edu.au DOWNLOAD DIRECTORY FOR MATLAB

More information

Finite Difference Methods (FDMs) 2

Finite Difference Methods (FDMs) 2 Finite Difference Methods (FDMs) 2 Time- dependent PDEs A partial differential equation of the form (15.1) where A, B, and C are constants, is called quasilinear. There are three types of quasilinear equations:

More information

Review of Vector Analysis in Cartesian Coordinates

Review of Vector Analysis in Cartesian Coordinates Review of Vector Analysis in Cartesian Coordinates 1 Scalar: A quantity that has magnitude, but no direction. Examples are mass, temperature, pressure, time, distance, and real numbers. Scalars are usually

More information

9. Iterative Methods for Large Linear Systems

9. Iterative Methods for Large Linear Systems EE507 - Computational Techniques for EE Jitkomut Songsiri 9. Iterative Methods for Large Linear Systems introduction splitting method Jacobi method Gauss-Seidel method successive overrelaxation (SOR) 9-1

More information

An Overly Simplified and Brief Review of Differential Equation Solution Methods. 1. Some Common Exact Solution Methods for Differential Equations

An Overly Simplified and Brief Review of Differential Equation Solution Methods. 1. Some Common Exact Solution Methods for Differential Equations An Overly Simplified and Brief Review of Differential Equation Solution Methods We will be dealing with initial or boundary value problems. A typical initial value problem has the form y y 0 y(0) 1 A typical

More information

AMS526: Numerical Analysis I (Numerical Linear Algebra for Computational and Data Sciences)

AMS526: Numerical Analysis I (Numerical Linear Algebra for Computational and Data Sciences) AMS526: Numerical Analysis I (Numerical Linear Algebra for Computational and Data Sciences) Lecture 19: Computing the SVD; Sparse Linear Systems Xiangmin Jiao Stony Brook University Xiangmin Jiao Numerical

More information

Assignment on iterative solution methods and preconditioning

Assignment on iterative solution methods and preconditioning Division of Scientific Computing, Department of Information Technology, Uppsala University Numerical Linear Algebra October-November, 2018 Assignment on iterative solution methods and preconditioning 1.

More information

Math 302 Outcome Statements Winter 2013

Math 302 Outcome Statements Winter 2013 Math 302 Outcome Statements Winter 2013 1 Rectangular Space Coordinates; Vectors in the Three-Dimensional Space (a) Cartesian coordinates of a point (b) sphere (c) symmetry about a point, a line, and a

More information

Solving PDEs with Multigrid Methods p.1

Solving PDEs with Multigrid Methods p.1 Solving PDEs with Multigrid Methods Scott MacLachlan maclachl@colorado.edu Department of Applied Mathematics, University of Colorado at Boulder Solving PDEs with Multigrid Methods p.1 Support and Collaboration

More information

Scientific Computing with Case Studies SIAM Press, Lecture Notes for Unit VII Sparse Matrix

Scientific Computing with Case Studies SIAM Press, Lecture Notes for Unit VII Sparse Matrix Scientific Computing with Case Studies SIAM Press, 2009 http://www.cs.umd.edu/users/oleary/sccswebpage Lecture Notes for Unit VII Sparse Matrix Computations Part 1: Direct Methods Dianne P. O Leary c 2008

More information

A High-Order Galerkin Solver for the Poisson Problem on the Surface of the Cubed Sphere

A High-Order Galerkin Solver for the Poisson Problem on the Surface of the Cubed Sphere A High-Order Galerkin Solver for the Poisson Problem on the Surface of the Cubed Sphere Michael Levy University of Colorado at Boulder Department of Applied Mathematics August 10, 2007 Outline 1 Background

More information

Harbor Creek School District

Harbor Creek School District Unit 1 Days 1-9 Evaluate one-sided two-sided limits, given the graph of a function. Limits, Evaluate limits using tables calculators. Continuity Evaluate limits using direct substitution. Differentiability

More information

Fundamentals of Transport Processes Prof. Kumaran Indian Institute of Science, Bangalore Chemical Engineering

Fundamentals of Transport Processes Prof. Kumaran Indian Institute of Science, Bangalore Chemical Engineering Fundamentals of Transport Processes Prof. Kumaran Indian Institute of Science, Bangalore Chemical Engineering Module No # 05 Lecture No # 25 Mass and Energy Conservation Cartesian Co-ordinates Welcome

More information

Industrial Applications of Computational Mechanics Extended Civil Engineering Problems. Prof. Dr.-Ing. Casimir Katz SOFiSTiK AG

Industrial Applications of Computational Mechanics Extended Civil Engineering Problems. Prof. Dr.-Ing. Casimir Katz SOFiSTiK AG Industrial Applications of Computational Mechanics Extended Civil Engineering Problems Prof. Dr.-Ing. Casimir Katz SOFiSTiK AG Beyond Structural Analysis Multiphysics» Heat Conduction, Radiation» Potential

More information

Created by T. Madas VECTOR OPERATORS. Created by T. Madas

Created by T. Madas VECTOR OPERATORS. Created by T. Madas VECTOR OPERATORS GRADIENT gradϕ ϕ Question 1 A surface S is given by the Cartesian equation x 2 2 + y = 25. a) Draw a sketch of S, and describe it geometrically. b) Determine an equation of the tangent

More information

Finite-Elements Method 2

Finite-Elements Method 2 Finite-Elements Method 2 January 29, 2014 2 From Applied Numerical Analysis Gerald-Wheatley (2004), Chapter 9. Finite-Elements Method 3 Introduction Finite-element methods (FEM) are based on some mathematical

More information

Additive Manufacturing Module 8

Additive Manufacturing Module 8 Additive Manufacturing Module 8 Spring 2015 Wenchao Zhou zhouw@uark.edu (479) 575-7250 The Department of Mechanical Engineering University of Arkansas, Fayetteville 1 Evaluating design https://www.youtube.com/watch?v=p

More information

Transformed E&M I homework. Laplaceʼs Equation (Griffiths Chapter 3)

Transformed E&M I homework. Laplaceʼs Equation (Griffiths Chapter 3) Transformed E&M I homework Laplaceʼs Equation (Griffiths Chapter 3) Laplace s equation and uniqueness Question 1. Laplace solver Laplace Solver http://plasma.colorado.edu/mathcad/es_laplace.mcd This exercise

More information

Chapter 2: Numeric, Cell, and Structure Arrays

Chapter 2: Numeric, Cell, and Structure Arrays Chapter 2: Numeric, Cell, and Structure Arrays Topics Covered: Vectors Definition Addition Multiplication Scalar, Dot, Cross Matrices Row, Column, Square Transpose Addition Multiplication Scalar-Matrix,

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

Elements of Vector Calculus : Scalar Field & its Gradient

Elements of Vector Calculus : Scalar Field & its Gradient Elements of Vector Calculus : Scalar Field & its Gradient Lecture 1 : Electromagnetic Theory Professor D. K. Ghosh, Physics Department, I.I.T., Bombay Introduction : In this set of approximately 40 lectures

More information

Fluid flow I: The potential function

Fluid flow I: The potential function 5//0 Miscellaneous Exercises Fluid Flow I Fluid flow I: The potential function One of the equations describing the flow of a fluid is the continuity equation: u 0 t where is the fluid density and u is

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

MAT389 Fall 2016, Problem Set 4

MAT389 Fall 2016, Problem Set 4 MAT389 Fall 2016, Problem Set 4 Harmonic conjugates 4.1 Check that each of the functions u(x, y) below is harmonic at every (x, y) R 2, and find the unique harmonic conjugate, v(x, y), satisfying v(0,

More information

TEST CODE: MMA (Objective type) 2015 SYLLABUS

TEST CODE: MMA (Objective type) 2015 SYLLABUS TEST CODE: MMA (Objective type) 2015 SYLLABUS Analytical Reasoning Algebra Arithmetic, geometric and harmonic progression. Continued fractions. Elementary combinatorics: Permutations and combinations,

More information

Math 7824 Spring 2010 Numerical solution of partial differential equations Classroom notes and homework

Math 7824 Spring 2010 Numerical solution of partial differential equations Classroom notes and homework Math 7824 Spring 2010 Numerical solution of partial differential equations Classroom notes and homework Jan Mandel University of Colorado Denver May 12, 2010 1/20/09: Sec. 1.1, 1.2. Hw 1 due 1/27: problems

More information

Finite Difference Methods for

Finite Difference Methods for CE 601: Numerical Methods Lecture 33 Finite Difference Methods for PDEs Course Coordinator: Course Coordinator: Dr. Suresh A. Kartha, Associate Professor, Department of Civil Engineering, IIT Guwahati.

More information

PHYS 410/555 Computational Physics Solution of Non Linear Equations (a.k.a. Root Finding) (Reference Numerical Recipes, 9.0, 9.1, 9.

PHYS 410/555 Computational Physics Solution of Non Linear Equations (a.k.a. Root Finding) (Reference Numerical Recipes, 9.0, 9.1, 9. PHYS 410/555 Computational Physics Solution of Non Linear Equations (a.k.a. Root Finding) (Reference Numerical Recipes, 9.0, 9.1, 9.4) We will consider two cases 1. f(x) = 0 1-dimensional 2. f(x) = 0 d-dimensional

More information

UNDERSTANDING ENGINEERING MATHEMATICS

UNDERSTANDING ENGINEERING MATHEMATICS UNDERSTANDING ENGINEERING MATHEMATICS JOHN BIRD WORKED SOLUTIONS TO EXERCISES 1 INTRODUCTION In Understanding Engineering Mathematic there are over 750 further problems arranged regularly throughout the

More information

Introduction to Vectors

Introduction to Vectors Introduction to Vectors K. Behrend January 31, 008 Abstract An introduction to vectors in R and R 3. Lines and planes in R 3. Linear dependence. 1 Contents Introduction 3 1 Vectors 4 1.1 Plane vectors...............................

More information

FINITE-VOLUME SOLUTION OF DIFFUSION EQUATION AND APPLICATION TO MODEL PROBLEMS

FINITE-VOLUME SOLUTION OF DIFFUSION EQUATION AND APPLICATION TO MODEL PROBLEMS IJRET: International Journal of Research in Engineering and Technology eissn: 39-63 pissn: 3-738 FINITE-VOLUME SOLUTION OF DIFFUSION EQUATION AND APPLICATION TO MODEL PROBLEMS Asish Mitra Reviewer: Heat

More information

Parallel Singular Value Decomposition. Jiaxing Tan

Parallel Singular Value Decomposition. Jiaxing Tan Parallel Singular Value Decomposition Jiaxing Tan Outline What is SVD? How to calculate SVD? How to parallelize SVD? Future Work What is SVD? Matrix Decomposition Eigen Decomposition A (non-zero) vector

More information

Module 7: The Laplace Equation

Module 7: The Laplace Equation Module 7: The Laplace Equation In this module, we shall study one of the most important partial differential equations in physics known as the Laplace equation 2 u = 0 in Ω R n, (1) where 2 u := n i=1

More information

Finite Differences for Differential Equations 28 PART II. Finite Difference Methods for Differential Equations

Finite Differences for Differential Equations 28 PART II. Finite Difference Methods for Differential Equations Finite Differences for Differential Equations 28 PART II Finite Difference Methods for Differential Equations Finite Differences for Differential Equations 29 BOUNDARY VALUE PROBLEMS (I) Solving a TWO

More information

Domain decomposition for the Jacobi-Davidson method: practical strategies

Domain decomposition for the Jacobi-Davidson method: practical strategies Chapter 4 Domain decomposition for the Jacobi-Davidson method: practical strategies Abstract The Jacobi-Davidson method is an iterative method for the computation of solutions of large eigenvalue problems.

More information

Fluid flow II: The stream function

Fluid flow II: The stream function 5//0 Miscellaneous Exercises Fluid Flow II Fluid flow II: The stream function This exercise is a continuation of the Fluid flow I exercise. Read that exercise an introduction. It is possible to obtain

More information

Solution of the Two-Dimensional Steady State Heat Conduction using the Finite Volume Method

Solution of the Two-Dimensional Steady State Heat Conduction using the Finite Volume Method Ninth International Conference on Computational Fluid Dynamics (ICCFD9), Istanbul, Turkey, July 11-15, 2016 ICCFD9-0113 Solution of the Two-Dimensional Steady State Heat Conduction using the Finite Volume

More information

Transmission Lines and E. M. Waves Prof. R. K. Shevgaonkar Department of Electrical Engineering Indian Institute of Technology, Bombay

Transmission Lines and E. M. Waves Prof. R. K. Shevgaonkar Department of Electrical Engineering Indian Institute of Technology, Bombay Transmission Lines and E. M. Waves Prof. R. K. Shevgaonkar Department of Electrical Engineering Indian Institute of Technology, Bombay Lecture 18 Basic Laws of Electromagnetics We saw in the earlier lecture

More information

Study of Forced and Free convection in Lid driven cavity problem

Study of Forced and Free convection in Lid driven cavity problem MIT Study of Forced and Free convection in Lid driven cavity problem 18.086 Project report Divya Panchanathan 5-11-2014 Aim To solve the Navier-stokes momentum equations for a lid driven cavity problem

More information

Motivation: Sparse matrices and numerical PDE's

Motivation: Sparse matrices and numerical PDE's Lecture 20: Numerical Linear Algebra #4 Iterative methods and Eigenproblems Outline 1) Motivation: beyond LU for Ax=b A little PDE's and sparse matrices A) Temperature Equation B) Poisson Equation 2) Splitting

More information

Partial Differential Equations

Partial Differential Equations Next: Using Matlab Up: Numerical Analysis for Chemical Previous: Ordinary Differential Equations Subsections Finite Difference: Elliptic Equations The Laplace Equations Solution Techniques Boundary Conditions

More information

Mathematical Notes for E&M Gradient, Divergence, and Curl

Mathematical Notes for E&M Gradient, Divergence, and Curl Mathematical Notes for E&M Gradient, Divergence, and Curl In these notes I explain the differential operators gradient, divergence, and curl (also known as rotor), the relations between them, the integral

More information

JMBC Computational Fluid Dynamics I Exercises by A.E.P. Veldman

JMBC Computational Fluid Dynamics I Exercises by A.E.P. Veldman JMBC Computational Fluid Dynamics I Exercises by A.E.P. Veldman The exercises will be carried out on PC s in the practicum rooms. Several (Matlab and Fortran) files are required. How these can be obtained

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

Electro Magnetic Field Dr. Harishankar Ramachandran Department of Electrical Engineering Indian Institute of Technology Madras

Electro Magnetic Field Dr. Harishankar Ramachandran Department of Electrical Engineering Indian Institute of Technology Madras Electro Magnetic Field Dr. Harishankar Ramachandran Department of Electrical Engineering Indian Institute of Technology Madras Lecture - 7 Gauss s Law Good morning. Today, I want to discuss two or three

More information

Modeling, Simulating and Rendering Fluids. Thanks to Ron Fediw et al, Jos Stam, Henrik Jensen, Ryan

Modeling, Simulating and Rendering Fluids. Thanks to Ron Fediw et al, Jos Stam, Henrik Jensen, Ryan Modeling, Simulating and Rendering Fluids Thanks to Ron Fediw et al, Jos Stam, Henrik Jensen, Ryan Applications Mostly Hollywood Shrek Antz Terminator 3 Many others Games Engineering Animating Fluids is

More information

ME Computational Fluid Mechanics Lecture 5

ME Computational Fluid Mechanics Lecture 5 ME - 733 Computational Fluid Mechanics Lecture 5 Dr./ Ahmed Nagib Elmekawy Dec. 20, 2018 Elliptic PDEs: Finite Difference Formulation Using central difference formulation, the so called five-point formula

More information

Lecture 28 The Main Sources of Error

Lecture 28 The Main Sources of Error Lecture 28 The Main Sources of Error Truncation Error Truncation error is defined as the error caused directly by an approximation method For instance, all numerical integration methods are approximations

More information

5. FVM discretization and Solution Procedure

5. FVM discretization and Solution Procedure 5. FVM discretization and Solution Procedure 1. The fluid domain is divided into a finite number of control volumes (cells of a computational grid). 2. Integral form of the conservation equations are discretized

More information

The method of lines (MOL) for the diffusion equation

The method of lines (MOL) for the diffusion equation Chapter 1 The method of lines (MOL) for the diffusion equation The method of lines refers to an approximation of one or more partial differential equations with ordinary differential equations in just

More information

Mathematics for Physical Sciences III

Mathematics for Physical Sciences III Mathematics for Physical Sciences III Change of lecturer: First 4 weeks: myself again! Remaining 8 weeks: Dr Stephen O Sullivan Continuous Assessment Test Date to be announced (probably Week 7 or 8) -

More information

AIMS Exercise Set # 1

AIMS Exercise Set # 1 AIMS Exercise Set #. Determine the form of the single precision floating point arithmetic used in the computers at AIMS. What is the largest number that can be accurately represented? What is the smallest

More information

Linear Algebra Using MATLAB

Linear Algebra Using MATLAB Linear Algebra Using MATLAB MATH 5331 1 May 12, 2010 1 Selected material from the text Linear Algebra and Differential Equations Using MATLAB by Martin Golubitsky and Michael Dellnitz Contents 1 Preliminaries

More information

Electrodynamics and Microwaves 3. Gradient, Curl and Divergence

Electrodynamics and Microwaves 3. Gradient, Curl and Divergence 1 Module 3 Gradient, Divergence and Curl 1. Introduction 2. The operators & 2 3. Gradient 4. Divergence 5. Curl 6. Mathematical expressions for gradient, divergence and curl in different coordinate systems.

More information

Numerical Solutions to Partial Differential Equations

Numerical Solutions to Partial Differential Equations Numerical Solutions to Partial Differential Equations Zhiping Li LMAM and School of Mathematical Sciences Peking University The Implicit Schemes for the Model Problem The Crank-Nicolson scheme and θ-scheme

More information

Computational Fluid Dynamics Prof. Dr. SumanChakraborty Department of Mechanical Engineering Indian Institute of Technology, Kharagpur

Computational Fluid Dynamics Prof. Dr. SumanChakraborty Department of Mechanical Engineering Indian Institute of Technology, Kharagpur Computational Fluid Dynamics Prof. Dr. SumanChakraborty Department of Mechanical Engineering Indian Institute of Technology, Kharagpur Lecture No. #11 Fundamentals of Discretization: Finite Difference

More information

Vectors. 1 Basic Definitions. Liming Pang

Vectors. 1 Basic Definitions. Liming Pang Vectors Liming Pang 1 Basic Definitions Definition 1. A vector in a line/plane/space is a quantity which has both magnitude and direction. The magnitude is a nonnegative real number and the direction is

More information

" = ˆ i # #x + ˆ j # #y + ˆ k # #z. "t = D #2 h

 = ˆ i # #x + ˆ j # #y + ˆ k # #z. t = D #2 h del operator " = ˆ i # #x + ˆ j # #y + ˆ k # #z Hydrology Gradient: "h = ˆ i #h #x + ˆ j #h #y + k ˆ #h #z q = - K"h Darcy s Law Divergence: " q = #q 1 #x + #q 2 #y + #q 3 #z Laplacian: " 2 h = #2 h #x

More information

8. Introduction to Computational Fluid Dynamics

8. Introduction to Computational Fluid Dynamics 8. Introduction to Computational Fluid Dynamics We have been using the idea of distributions of singularities on surfaces to study the aerodynamics of airfoils and wings. This approach was very powerful,

More information

Multiple Integrals and Vector Calculus: Synopsis

Multiple Integrals and Vector Calculus: Synopsis Multiple Integrals and Vector Calculus: Synopsis Hilary Term 28: 14 lectures. Steve Rawlings. 1. Vectors - recap of basic principles. Things which are (and are not) vectors. Differentiation and integration

More information

Chapter 4. Two-Dimensional Finite Element Analysis

Chapter 4. Two-Dimensional Finite Element Analysis Chapter 4. Two-Dimensional Finite Element Analysis general two-dimensional boundary-value problems 4.1 The Boundary-Value Problem 2nd-order differential equation to consider α α β φ Ω (4.1) Laplace, Poisson

More information

Numerical methods for the Navier- Stokes equations

Numerical methods for the Navier- Stokes equations Numerical methods for the Navier- Stokes equations Hans Petter Langtangen 1,2 1 Center for Biomedical Computing, Simula Research Laboratory 2 Department of Informatics, University of Oslo Dec 6, 2012 Note:

More information

Finite Element Analysis Prof. Dr. B. N. Rao Department of Civil Engineering Indian Institute of Technology, Madras. Module - 01 Lecture - 11

Finite Element Analysis Prof. Dr. B. N. Rao Department of Civil Engineering Indian Institute of Technology, Madras. Module - 01 Lecture - 11 Finite Element Analysis Prof. Dr. B. N. Rao Department of Civil Engineering Indian Institute of Technology, Madras Module - 01 Lecture - 11 Last class, what we did is, we looked at a method called superposition

More information

Chapter 1W Basic Electromagnetic Concepts

Chapter 1W Basic Electromagnetic Concepts Chapter 1W Basic Electromagnetic Concepts 1W Basic Electromagnetic Concepts 1W.1 Examples and Problems on Electric Circuits 1W.2 Examples on Magnetic Concepts This chapter includes additional examples

More information

Answers to Exercises Computational Fluid Dynamics

Answers to Exercises Computational Fluid Dynamics Answers to Exercises Computational Fluid Dynamics Exercise - Artificial diffusion upwind computations.9 k=. exact.8 k=..7 k=..6 k=..5.4.3.2...2.3.4.5.6.7.8.9 x For k =.,. and., and for N = 2, the discrete

More information