A Solution of Partial Differential Equations by Finite-Difference Approximations

41
Solution of Partial Differential Equations by Finite-Difference Approximations Aeronautical Engineering (MEng) Tuesday, 21 June 2022 Elliot Newman @00320195

Transcript of A Solution of Partial Differential Equations by Finite-Difference Approximations

Page 1: A Solution of Partial Differential Equations by Finite-Difference Approximations

Solution of Partial Differential Equations by Finite-Difference Approximations

Aeronautical Engineering (MEng)

Tuesday, 02 May 2023

Elliot Newman

@00320195

Word Count: 0

Contents

Page 2: A Solution of Partial Differential Equations by Finite-Difference Approximations

P a g e | 2

Contents................................................................................................................................................. iTables.................................................................................................................................................... iiFigures................................................................................................................................................... iiIntroduction...........................................................................................................................................1

Objectives..........................................................................................................................................1

Theory...................................................................................................................................................3Partial Differentials............................................................................................................................3

Discretisation Schemes......................................................................................................................4

Finite-Difference Approximation.......................................................................................................4

Forward-Time, Backward-Space Scheme.......................................................................................5

Lax Scheme....................................................................................................................................5

Lax-Wendroff Scheme...................................................................................................................5

Taylor Series......................................................................................................................................6

Procedure..............................................................................................................................................7Forward-Time, Backward-Space Scheme...........................................................................................7

Lax Scheme........................................................................................................................................7

Lax-Wendroff Scheme.......................................................................................................................8

Results...................................................................................................................................................9Forward-Time, Backward Space Scheme...........................................................................................9

Lax Scheme......................................................................................................................................12

Lax-Wendroff Scheme.....................................................................................................................15

Analysis................................................................................................................................................19Discussion............................................................................................................................................21

Forward-Time, Backward-Space Taylor Series Expansion................................................................21

FT-BS Truncation Error.................................................................................................................21

Lax Scheme Taylor Series Expansion................................................................................................21

Lax Truncation Error....................................................................................................................22

Lax-Wendroff Scheme Taylor Series Expansion...............................................................................22

Lax-Wendroff Truncation Error....................................................................................................22

Conclusion...........................................................................................................................................26References...........................................................................................................................................27

Tables

Table 1: Forward-Time, Backward-Space computational grid (v=0 .5)................................................9

Page 3: A Solution of Partial Differential Equations by Finite-Difference Approximations

P a g e | 3

Table 2: Forward-Time, Backward-Space Scheme computational grid. (v=0 .51).............................11Table 3: Forward-Time, Backward-Space Scheme computational grid. (v=0)...................................11Table 4: Forward-Time, Backward-Space Scheme computational grid. (v=−0 .01)..........................11Table 5: Lax Scheme computational grid (v=0 .5)..............................................................................12Table 6: Lax Scheme computational grid (v=0 .51)...........................................................................13Table 7: Lax Scheme computational grid (v=−0 .5)..........................................................................14Table 8: Lax Scheme computational grid (v=−0 .51)........................................................................14Table 9: Lax Scheme computational grid (v=0)..................................................................................15Table 10: Lax-Wendroff Scheme computational grid (v=0 .5)...........................................................15Table 11: Lax-Wendroff Scheme computational grid (v=0 .51).........................................................16Table 12: Lax-Wendroff Scheme computational grid (v=−0 .50)......................................................17Table 13: Lax-Wendroff Scheme computational grid (v=−0 .51)......................................................17Table 14: Lax-Wendroff Scheme computational grid (v=0)...............................................................18Table 15: Time step variation FT-BS.....................................................................................................23

Figures

Figure 1: Initial Conditions temperature step graph..............................................................................2Figure 2: Transport example of PDE function (University of Alaska, n.d.).............................................3Figure 3: Forward-Time, Backward-Space Scheme step graphs. (v=0 .5)..........................................10Figure 4: Forward-Time, Backward-Space Scheme step graphs. (v=0 .51)........................................10Figure 5: Forward-Time, Backward-Space Scheme step graphs. (v=0)..............................................11Figure 6: Forward-Time, Backward-Space Scheme step graphs. (v=−0 .01)....................................11Figure 7: Lax Scheme step graphs (v=0 .5)........................................................................................13Figure 8: Lax Scheme step graphs (v=0 .51)......................................................................................13Figure 9: Lax Scheme step graphs (v=−0 .5).....................................................................................14Figure 10: Lax Scheme step graphs (v=−0 .51).................................................................................14Figure 11: Lax Scheme step graphs (v=0)..........................................................................................14Figure 12: Lax-Wendroff Scheme step graphs (v=0 .5)......................................................................16Figure 13: Lax-Wendroff Scheme step graphs (v=0 .51)....................................................................16Figure 14: Lax-Wendroff Scheme step graphs (v=−0 .50)................................................................17Figure 15: Lax-Wendroff Scheme step graphs (v=−0 .51)................................................................17Figure 16: Lax-Wendroff Scheme step graphs (v=0)..........................................................................17Figure 17: Percentage error of Lax Method (v=0).............................................................................24Figure 18: Relative overshoot error percentage (v=0 .51)................................................................24

Page 4: A Solution of Partial Differential Equations by Finite-Difference Approximations

P a g e | 1

Introduction

Aerodynamics, being a multi-faceted subject, manifests itself in many forms, most notably in understanding the complex motions the air transcends through whilst under the influence of an applied device. Yielded knowledge can then be imparted into the design processes to stimulate the next generation of more efficient aerodynamic devices. This can be achieved through a multitude of techniques, although this paper shall focus on strictly numerical approaches, solving the differentials through finite-difference approximations. These methods allow for complex differentials that are either unsolvable or very difficult to do so, to be alluded to numerically, with these systems providing suitable levels of accuracy that these results can then be carried forward to further calculations of the aerodynamic behaviours under investigation, whether that be, flow velocity, drag levels or in this case linear convection.

Objectives

Over the course of this assignment, finite difference approximations shall be investigated and their relevant theory collated before focusing on three methods in particular:

Forward Time, Backward Space Scheme, a backward system deriving the next data set of the previously neighbouring geometric nodes (page 5).

Lax Scheme, a centralised method, using points above and below in the previous time step (page 5).

Lax Wendroff Scheme, a symmetric practice combining the previous two and therefore using three points to calculate the next step (page 5).

These three approximation methods shall then be tested and implemented on to the computational domain for partial differential equation for linear convection:

∂T∂ t

+U ∂T∂ x

=0

Where T is the Temperature changing with time, t and U equates to the Constant Convection Velocity in the x-direction, varying with x.

The final results can then be compared to allude to which system is the most accurate and effective. Achieving this directive requires further investigations into their consistency and stability, which in

turn have an effect on convergence, through the variance of a key parameter, v=U ∆t2∆x , with ∆t∆ x

corresponding to the stability coefficient, where in-between the boundary values the prediction is stable. The instability of a system becomes noticeable when the extrapolating values oscillate violently and extrude away from the previous step. Moving through the time steps is also on the agenda and another area of comparison, viewing the equations as they transcends over time periods. Through this process of testing, each schemes advantages and disadvantages can also be alluded to and help to differentiate between whether a system is superior to another or simply better suited to the situation, valuable and applicable information moving forwards.

A set of initial conditions have been provided and predetermined in order to carry out the investigation:

At time t=0, the temperature at the 21 finite-difference grid points are as follows:

Page 5: A Solution of Partial Differential Equations by Finite-Difference Approximations

P a g e | 2

T 1=0.0, T 2=1.0, T 3=2.0, T 4=2.0, T 5=1.0

T i=0.0, for i=6¿21.

With the final boundary conditions that points, T 1 and T 21 (both end points) remain fixed at 0.0 for all time, t .

An appropriate set of initial and boundary conditions are vital to the user’s ability to solve any partial differential, as if the problem is over constrained then there will be no solutions, yet left suitably undefined, then there will not be any unique solutions to the problem.

With the appropriate conditions set and through collating and implementing the initial conditions the following starting step graph (n) is generated:

0.0 0.2 0.4 0.6 0.8 1.0 1.2 1.4 1.6 1.8 2.00.01.02.03.0

Temperature (n)

Temp

Grid point

Tem

pera

ture

This graph represents the solution to the initial conditions and a perfectly accurate approximation method would continue to predict this step pattern through the entirety of the perceived window.

As well as testing the accuracy of each method, through use of the Taylor Series, a numerical expansion practice to approximate partial differentials which is discussed later, their consistency can be highlighted as through the expansion, a representation of the original differential should be attainable if this is to be satisfied. Also through use of this numerical method, the truncation error associated with each expansion can be demonstrated.

Figure 1: Initial Conditions temperature step graph.

Page 6: A Solution of Partial Differential Equations by Finite-Difference Approximations

P a g e | 3

Theory

As computer capabilities have grown, so have their engineering applications and in aerodynamics, the most notable of these is CFD. The methods rise to prominence has sparked the engineering community to invest in its computing power in order to utilise the benefits on offer. The opportunity to test key model platforms without any outlay for equipment or materials, other than the program itself, have made computational methods a key asset. In design orientated projects this form of simulated testing has become a paramount feature, vastly reducing costs and increasing the accuracy of the initial models created. Parameters such as; flow speeds, pressure stagnation, wake distribution and aerodynamic inefficiencies can be monitored and addressed before production even begins, inherently increasing the likelihood of success of the opening model [1].

Partial Differentials

Partial differential equations (PDE’s) are inherently difficult to solve as they contain more than one variable and instead are used to describe problems involving the parameters in use which can then be solved using a variation of schemes. They describe the rate of change of certain variables in relation to others, which with this assignment being the temperature changing with time (1 st term) and the constant convection velocity in the x-direction, scaled with the change between temperature and steps in the x direction (2nd term):

∂T∂ t

+U ∂T∂ x

=0

This is a linear, one-dimensional PDE as the problem is only first order and contains nothing raised to a higher power and all the functions are transported in one direction, x. With the initial boundary conditions supplied, the solution to this particular partial differential becomes simply a transport of itself along the time steps, demonstrated in the example figure below:

Figure 2: Transport example of PDE function (University of Alaska, n.d.).

The 2nd term in the PDE also bares a certain resemblance to Fourier’s Law of Thermal Conduction:

qx=−k ∂T∂ x , Where k is the materials conductivity.

This illustrates that it is in this term that the convection properties of the model are carried, although in this case not by the, −k , but by U , relating to the Constant Convection Velocity in the x-direction.

Although, this is a simple problem and before the complex simulation programs began to spawn, more complex mathematical formulae had to be solved, with one method being ‘discretisation schemes’, which in itself is an umbrella term containing a multitude of approaches that shall be alluded to in the next section.

Page 7: A Solution of Partial Differential Equations by Finite-Difference Approximations

P a g e | 4

Discretisation Schemes

These methods include; finite volume, approximating the volume around discrete nodes, finite element, the plane is dissected into many small elements that are approximated and many more, but most importantly the ‘finite-difference approximation’ of interest in this paper.

Discretisation is the act of truncating models of continuous equations into their simpler, more finite counterparts, allowing them to be applied to and then be numerically deduced, although they still require significant computing power and thus was seen as an early form of CFD [3]. The process of the truncation introduces an inherent inaccuracy to the model which has to be controlled and monitored through, ‘mesh discretisation’, finding the appropriate mesh density or step size to render the problem grid independent, where increasing the density or reducing the step size has a negligible effect of the accuracy of the yielded answer [4].

Finite-Difference Approximation

Finite-difference approximations are of the most derivative methods for solving differential equations, postulated by Messer Leonhard Euler in the 18th century. When faced with equations either very difficult to solve or is only applicable in very stringent, finite situations, a variant method of solution is required to garner an answer this is where the numerical process of finite-difference approximation is most applicable. The system can approximate the solution with the necessary boundary and initial conditions imposed, providing an accurate solution for the previous unfathomable equation. They are of particular use in aerodynamics as their time and space dependent nature lends itself to computing shock wave propagation or other energy transfer flows.

Their approach uses the act of ‘discretisation’ to approximate the differential, by applying a finite grid, or mesh, of points at which the variables are estimated, with the process continuing as the local points govern their approximation values from the neighbouring nodes. Iterative approximation in this manner produces an obvious error, known as the ‘discretisation or truncation error’, diverging from the true value. The key to the principle is, like anything, minimising this error in the system. Monitoring this error then is something of paramount importance and through the implementation of the ‘Taylor Series’, this can be achieved [5].

In addition to being effectively defined, there are three critical properties that any approximation of a partial differential should maintain, being; consistency, stability and convergence. The consistency alludes to the finite-differences accuracy of approximation of the partial differential, when the delta parameters tend to 0, then the approximation should converge towards the true value of the differential. This is where the use of the Taylor Series is most advantageous, expanding each term at the desired point, enabling the computation of the truncation error. If the error approaches 0 as the delta parameters do so too, then it is said to be consistent. Stability confirms that the final solution’s sensitivity is within the accepted range and isn’t too volatile to small perturbations in the data. As the data moves from step to step, the error can be compounded and amplified; if this is the case then the scheme is adduced to be unstable. Finally, convergence describes the approximation solutions ability to iterate towards the original differentials as the mesh density becomes more sophisticated. Convergence demonstrates that if the solution is grid independent, not influenced by the mesh density, then this is the correct solution to the original differential [6][7].

The three methods under scrutiny are all hyperbolic in nature which depicts a ‘time dependent’ situation and therefore all future solutions are based on their previous cohorts within the region.

Page 8: A Solution of Partial Differential Equations by Finite-Difference Approximations

P a g e | 5

Another similarity is their explicit characteristic, this governs that the solution at each grid point is given by a concise formula.

Although, before investigating the finer points of the process, the three most prominent approximation methods shall be eluded to, beginning with the ‘Forward-Time, Backward-Space Method’.

Forward-Time, Backward-Space Scheme

This form of approximation method is a ‘backward’, explicit, hyperbolic system, which is where it derives its name from. This means that the next set of results are only derived from the nodes immediately behind them geometrically in relation to their pervious counterparts, as becomes apparent through inspection of the equation, T i

n−T i−1n :

T in+1−T i

n

∆t+U {T in−T i−1n∆ x }=0

This also gives the system an inherent advantage as this encourages convergence, through the fact that the approximation method has a ‘domain of dependence’ that includes the initial data, shared by the partial differential. The domain of dependence states that the solution to the approximation and the differential at time t=0 only applies on the initial data set.

Further information gathered from the equation itself shows that this is a first order method and most suitable to simple differential approximations. The method has a region of stability of 0≤v ≤0.5, a hypothesis that can be proven during the calculations.

Lax Scheme

Much like the previous is explicit and hyperbolic in nature, yet, unlike its predecessor, it is a ‘central space’ scheme, demonstrated that all T n terms are either side of i and is first order accurate fort , although also encompasses a second order accuracy for x, shown through inspection of the right hand fraction:

T in+1−

T i+1n +T i−1

n

2∆ t

+U {T i+1n −T i−1n

2∆ x }=0

The previous discussed conditions that an approximation method must adhere to in order to be successful are summed up by Lax in the ‘Lax Equivalence Theorem’,

‘For a well-posed linear, initial value problem with a consistent discretisation, stability is the necessary and sufficient condition for convergence of the numerical scheme’ (Strikwerda, 1989).

This states that when a problem is correctly confined with appropriate initial and boundary conditions, as mentioned in the theory, and is consistent and thus now independent of the mesh discretisation, then for a scheme to be convergent, then it must also be stable. This creates an apparent interdependency between the three properties of approximation schemes. The stability region of Lax Method is −0.5≤v ≤0.5.

Page 9: A Solution of Partial Differential Equations by Finite-Difference Approximations

P a g e | 6

Lax-Wendroff Scheme

This is the most complicated scheme of the three and most recent, its derivation as recent as 1960 , yet still has the hallmarks of being hyperbolic and is explicit with times integral and thus the current time step is taken into consideration:

T in+1=T i

n−U ∆t {T i+1n −T i−1n

2∆ x }+U 2 ∆t 2

2 {T i+1n −2T in+T i−1

n

∆ x2 }

The added term, 2T in

, in the final bracket moves this system away from the previous Lax Method being a centralised scheme to a symmetrical method, being second order in both x and t . This is a feature unique to the Lax-Wendroff method, being the only linear advection method that encompasses three nodes into its calculations and also being second order accurate. The stability region this system is the same as the Lax Method previously.

Taylor Series

The Taylor Series is a form of evaluating and representing partial differentials, although not exclusively, as an infinite sum of its terms at a single point, in the form of series expansion. There is a special case of this system, known as the Maclaurin Series, named after the Scottish mathematician Colin Maclaurin who did extensive study in this area, when the expansion is focused around 0. The method was originally proved by James Gregory when he released his book ‘Vera Circuli et Hyperbolae Quadratura’ in 1667.

The use of the series has many applications in engineering, with its main being the approximation of functions through the expansion to the necessary number of terms. Through collating the appropriate number of terms and then ‘truncating’ the series a valid approximation of the function can be made. The act of truncating the series generates an error, although as the expansion continues the effect of each term dwindles, a characteristic that allows the truncation after a certain term number. The truncation error can also be computed and gives an indication as to the validity and performance of the initial approximation made using the series expansion.

Page 10: A Solution of Partial Differential Equations by Finite-Difference Approximations

P a g e | 7

Procedure

Having a detailed overview of the procedural events of the experiment is of paramount importance and can jeopardise the validity of the results if this isn’t upheld. A comprehensive guide enables the conditions to be recreated if necessary and results duplicated, either satisfying their soundness or throwing their claims into disrepute. With this agenda the methods of each approximation method shall be alluded to. The approximation equations first have to be manipulated to make T i

n+1 the subject and then applied to the meshed grid to yield the data spread. The computational grid employed 21 finite-difference grid points and 12 times steps and the excel equations are specific to calculating the cell n+1 , i+2 in the computation grid, which is demonstrated in the results, page 9.

Forward-Time, Backward-Space Scheme

Beginning with the first approximation method the original equation had to first be rearranged to make the temperature the focus:

T in+1−T i

n

∆t+U {T in−T i−1n∆ x }=0

¿>T in+1−T i

n

∆t=−U {T in−T i−1n∆ x }

¿>T in+ 1=T i

n−U ∆ t {T in−T i−1n∆ x }

With the equation now in this form, the temperature at the next geometric node can easily be calculated through inputting the necessary parameters, T i

n represents the step immediately before

the one to be computed in the gird, with T i−1n again in the previous time step, but also back one grid

space also. It is this application pattern that demonstrates the methods title of being a ‘backward system’ as all the grid points referenced are backward. Being in the previous time step is a necessity, its then being i−1 that gives the system its name.

Deploying this equation in excel requires the predetermined parameters to be input into cell blocks ready to be selected in the required location within the equation:

T in+1=C 7−(($C $2∗$ L$ 2)∗((C7−C 6)/$ F $2)) $C $2=U , $ L$2=∆ t , $ F$ 2=∆x.

In the excel equations, $ appears mixed in with the cell definition, employing the symbol in this way fixes the cell location as the equation is dragged and copied across the required cells, easing their creation.

With the spreadsheet created the results can be demonstrated, page 9:

Page 11: A Solution of Partial Differential Equations by Finite-Difference Approximations

P a g e | 8

Lax Scheme

Moving on to the lax scheme, the procedure is identical to that of the previous method and begins with the algebraic manipulation:

T in+1−

T i+1n +T i−1

n

2∆ t

+U {T i+1n −T i−1n

2∆ x }=0

¿>T in+1−

T i+1n +T i−1

n

2∆ t

=−U {T i+1n −T i−1n

2∆ x }

¿>T in+ 1=

T i+1n +T i−1

n

2−U ∆ t {T i+1n −T i−1

n

2∆ x }

The Lax Scheme is a centralised method and therefore, the previous term of T in is not deployed in

this scheme, instead grid points above and below the location being considered are used to calculate its value. T i−1

n corresponds to the same grid location as in the previous system and now the second

term the equation depends on is T i+1n , which relates to the grid point in front of the subject location

in the previous time step. This explains the centralised nature of the scheme, as the subject point is centred between the two that influence it.

The Excel code for this equation is slightly more complicated than its previous counterpart due to the centralised nature of the scheme:

T in+1=((C 8+C6)/2)−(($C $2∗$ L$2)∗((C 8−C 6)/(2∗$ F $2))) $C $2=U , $ L$2=∆ t , $ F$ 2=∆x.

Again, the spreadsheet depicting the computational domain is illustrated on page 12.

Lax-Wendroff Scheme

This scheme had already been set up with T in+1 the subject of the equation and thus needed no

manipulation:

T in+1=T i

n−U ∆t {T i+1n −T i−1n

2∆ x }+U 2 ∆t 2

2 {T i+1n −2T in+T i−1

n

∆ x2 }

The final method, Lax-Wendroff, is a symmetric scheme; the subject term is calculated using the three adjacent grid points in the previous step, a combination of the FT-BS and Lax schemes.

Moving on again to the Excel code and the lax-Wendroff method is the only linear approximation method that encompasses a symmetric system, using 3 nodal positions to compute the next grid point:

T in+1=C 7−(($C $2∗$ L$ 2)∗((C8−C6)/(2∗$ F $ 2)))+((($ C$ 22)∗($ L$22) /2)∗((C 8−(2∗C 7)+C 6)/($ F $22)))

$C $2=U , $ L$2=∆ t , $ F$ 2=∆x.

Domain grid, page 15.

Page 12: A Solution of Partial Differential Equations by Finite-Difference Approximations

P a g e | 9

Results

The three methods, after being input into a Microsoft Excel spreadsheet generated data in both chart and tabular form. Depicting the results in this way allows for further analysis to be conducted with greater ease, identifying either trends or errors in the method. With this in mind, the garnered results from the Forward-Time, Backward-Space Scheme shall be illustrated first.

All results shall be demonstrated with the parameter v=U ∆t2∆x set to 0.5, the theoretical upper limit

of stability, which in turn, through manipulation, sets a value of ∆ t=0.1, with a sample calculation from the initial conditions portrayed. All calculations will be for the grid point n+1 , i+2. Embodying this process, the Forward-Time, Backward-Space Scheme shall be employed first.

Forward-Time, Backward Space Scheme

With the equation already adjusted and ready for input into the grid, the computation simply requires the input of the parameter data:

T in+1=T i

n−U ∆t {T in−T i−1n∆x }

¿>T in+ 1=2−1 (0.1 ) {2−10.1 }=1

Along with a calculus example, the Excel input code is depicted below, with the relating cells highlighted:

T in+1=C 7−(($C $2∗$ L$ 2)∗((C7−C6)/$ F $2)) $C $2=U , $ L$2=∆ t , $ F$ 2=∆x.

n n+1 n+2 n+3 n+4 n+5 n+6 n+7 n+8 N+9 n+10 n+11i 0 0 0 0 0 0 0 0 0 0 0 0

i+1 1 0 0 0 0 0 0 0 0 0 0 0i+2 2 1 0 0 0 0 0 0 0 0 0 0i+3 2 2 1 0 0 0 0 0 0 0 0 0i+4 1 2 2 1 0 0 0 0 0 0 0 0i+5 0 1 2 2 1 0 0 0 0 0 0 0i+6 0 0 1 2 2 1 0 0 0 0 0 0i+7 0 0 0 1 2 2 1 0 0 0 0 0i+8 0 0 0 0 1 2 2 1 0 0 0 0

Page 13: A Solution of Partial Differential Equations by Finite-Difference Approximations

P a g e | 10

i+9 0 0 0 0 0 1 2 2 1 0 0 0i+10 0 0 0 0 0 0 1 2 2 1 0 0i+11 0 0 0 0 0 0 0 1 2 2 1 0i+12 0 0 0 0 0 0 0 0 1 2 2 1i+13 0 0 0 0 0 0 0 0 0 1 2 2i+14 0 0 0 0 0 0 0 0 0 0 1 2i+15 0 0 0 0 0 0 0 0 0 0 0 1i+16 0 0 0 0 0 0 0 0 0 0 0 0i+17 0 0 0 0 0 0 0 0 0 0 0 0i+18 0 0 0 0 0 0 0 0 0 0 0 0i+19 0 0 0 0 0 0 0 0 0 0 0 0i+20 0 0 0 0 0 0 0 0 0 0 0 0

Table 1: Forward-Time, Backward-Space computational grid (v=0.5).

Using the data calculated in the computational grid, graphs at each time step can be plotted illustrating the functions transcendence through each time step:

-0.5

0.5

1.5

2.5

1 3 5 7 9 11 13 15 17 19 21

n

n

-0.5

0.5

1.5

2.5

1 3 5 7 9 11 13 15 17 19 21

n+1

n+1

-0.5

0.5

1.5

2.5

1 3 5 7 9 11 13 15 17 19 21

n+2

n+2

-0.5

0.5

1.5

2.5

1 3 5 7 9 11 13 15 17 19 21

n+3

n+3

-0.5

0.5

1.5

2.5

1 3 5 7 9 11 13 15 17 19 21

n+4

n+4

-0.5

0.5

1.5

2.5

1 3 5 7 9 11 13 15 17 19 21

n+5

n+5

-0.5

0.5

1.5

2.5

1 3 5 7 9 11 13 15 17 19 21

n+6

n+6

-0.5

0.5

1.5

2.5

1 3 5 7 9 11 13 15 17 19 21

n+7

n+7

-0.5

0.5

1.5

2.5

1 3 5 7 9 11 13 15 17 19 21

n+ 8

n+ 8

-0.5

0.5

1.5

2.5

1 3 5 7 9 11 13 15 17 19 21

n+ 9

n+ 9

-0.5

0.5

1.5

2.5

1 3 5 7 9 11 13 15 17 19 21

n + 10

n + 10

-0.5

0.5

1.5

2.5

1 3 5 7 9 11 13 15 17 19 21

n + 11

n + 11

Figure 3: Forward-Time, Backward-Space Scheme step graphs. (v=0.5)

Page 14: A Solution of Partial Differential Equations by Finite-Difference Approximations

P a g e | 11

The results obtained are with v=0.5, in the next simulation this value has been adjusted to v=0.51, which is now above the theoretical stability value and should demonstrate the method becoming unstable, using the steps of n+2, n+6 and n+11 to illustrates the progression through the simulation:

-0.5

0.5

1.5

2.5

1 3 5 7 9 11 13 15 17 19 21

n+2

n+2

-0.5

0.5

1.5

2.5

1 3 5 7 9 11 13 15 17 19 21

n+6

n+6

-0.5

0.5

1.5

2.5

1 3 5 7 9 11 13 15 17 19 21

n + 11

n + 11

Figure 4: Forward-Time, Backward-Space Scheme step graphs. (v=0.51)

n n+1 n+2 n+3 n+4 n+5 n+6 n+7 n+8 n+9 n+10 n+11i 0 0 0 0 0 0 0 0 0 0 0 0

i+1 1 -0.02 0.0004 -8e-6 1.6e-7 -3.2e-9 6.4e-11 -1.3e-12 2.56e-14 -5.1e-16 1.02e-17 -2e-19

i+2 2 0.98 -0.04 0.0012 -3.2e-5 8.1e-7 -1.9e-8 4.54e-10 -1e-11 2.34e-13 -5.2e-15 1.14e-16

i+3 2 2 0.9596 -0.0599 0.0024 -8.2e-5 2.46e-6 -6.9e-8 1.84e-9 -4.7e-11 1.19e-12 -2.9e-14

Table 2: Forward-Time, Backward-Space Scheme computational grid. (v=0.51)

Only certain steps have been depicted as this is a demonstration of the stability boundary. The same procedure of demonstrating the stability limit shall now be conducted on the lower constraint value, using the same step locales of before. The theoretical lower limit is v=0:

-0.5

0.5

1.5

2.5

1 3 5 7 9 11 13 15 17 19 21

n+2

n+2

-0.5

0.5

1.5

2.5

1 3 5 7 9 11 13 15 17 19 21

n+6

n+6

-0.5

0.5

1.5

2.5

1 3 5 7 9 11 13 15 17 19 21

n + 11

n + 11

Figure 5: Forward-Time, Backward-Space Scheme step graphs. (v=0)

n n+1 n+2 n+3 n+4 n+5 n+6 n+7 n+8 n+9 n+10 n+11i 0 0 0 0 0 0 0 0 0 0 0 0

i+1 1 1 1 1 1 1 1 1 1 1 1 1i+2 2 2 2 2 2 2 2 2 2 2 2 2i+3 2 2 2 2 2 2 2 2 2 2 2 2

Table 3: Forward-Time, Backward-Space Scheme computational grid. (v=0)

Then adjusting the parameter to move beyond the limit, v=−0.01, demonstrates the previous examples significance:

Page 15: A Solution of Partial Differential Equations by Finite-Difference Approximations

P a g e | 12

-0.5

0.5

1.5

2.5

1 3 5 7 9 11 13 15 17 19 21

n+2

n+2

-0.5

0.5

1.5

2.5

1 3 5 7 9 11 13 15 17 19 21

n+6

n+6

-0.5

0.5

1.5

2.5

1 3 5 7 9 11 13 15 17 19 21

n + 11

n + 11

Figure 6: Forward-Time, Backward-Space Scheme step graphs. (v=−0.01)

n n+1 n+2 n+3 n+4 n+5 n+6 n+7 n+8 n+9 n+10 n+11i 0 0 0 0 0 0 0 0 0 0 0 0

i+1 1 1.02 1.0404 1.0612 1.0824 1.1041 1.1261 1.1487 1.1717 1.1951 1.2189 1.2434i+2 2 2.02 2.04 2.0599 2.0799 2.0999 2.1198 2.1397 2.1595 2.1793 2.1989 2.2186i+3 2 2 1.9996 1.9987 1.9976 1.9959 1.9938 1.9913 1.9883 1.9849 1.9810 1.9767

Table 4: Forward-Time, Backward-Space Scheme computational grid. (v=−0.01)

Lax Scheme

Again, beginning with the previously manipulated equation and inputting the selected data:

T in+1=

T i+1n +T i−1

n

2−U ∆t {T i+1n −T i−1

n

2∆ x }

¿>T in+ 1=2+1

2−1 (0.1 ) { 2−12 (0.1 ) }=1

The Excel code for this equation again highlights the cells used:

T in+1=((C 8+C6)/2)−(($C $2∗$ L$2)∗((C 8−C 6)/(2∗$ F $2))) $C $2=U , $ L$2=∆ t , $ F$ 2=∆x.

n n+1 n+2 n+3 n+4 n+5 n+6 n+7 n+8 n+9 n+10

n+11

i 0 0 0 0 0 0 0 0 0 0 0 0i+1 1 0 0 0 0 0 0 0 0 0 0 0i+2 2 1 0 0 0 0 0 0 0 0 0 0i+3 2 2 1 0 0 0 0 0 0 0 0 0i+4 1 2 2 1 0 0 0 0 0 0 0 0i+5 0 1 2 2 1 0 0 0 0 0 0 0i+6 0 0 1 2 2 1 0 0 0 0 0 0i+7 0 0 0 1 2 2 1 0 0 0 0 0i+8 0 0 0 0 1 2 2 1 0 0 0 0i+9 0 0 0 0 0 1 2 2 1 0 0 0i+10

0 0 0 0 0 0 1 2 2 1 0 0

i+11

0 0 0 0 0 0 0 1 2 2 1 0

i+12

0 0 0 0 0 0 0 0 1 2 2 1

i+1 0 0 0 0 0 0 0 0 0 1 2 2

Page 16: A Solution of Partial Differential Equations by Finite-Difference Approximations

P a g e | 13

3i+14

0 0 0 0 0 0 0 0 0 0 1 2

i+15

0 0 0 0 0 0 0 0 0 0 0 1

i+16

0 0 0 0 0 0 0 0 0 0 0 0

i+17

0 0 0 0 0 0 0 0 0 0 0 0

i+18

0 0 0 0 0 0 0 0 0 0 0 0

i+19

0 0 0 0 0 0 0 0 0 0 0 0

i+20

0 0 0 0 0 0 0 0 0 0 0 0

Table 5: Lax Scheme computational grid (v=0.5).

This produced step graphs which can be seen below as figure 7:

-0.5

0.5

1.5

2.5

1 3 5 7 9 11 13 15 17 19 21

n

n

-0.5

0.5

1.5

2.5

1 3 5 7 9 11 13 15 17 19 21

n + 1

n + 1

-0.5

0.5

1.5

2.5

1 3 5 7 9 11 13 15 17 19 21

n + 2

n + 2

-0.5

0.5

1.5

2.5

1 3 5 7 9 11 13 15 17 19 21

n + 3

n + 3

-0.5

0.5

1.5

2.5

1 3 5 7 9 11 13 15 17 19 21

n + 4

n + 4

-0.5

0.5

1.5

2.5

1 3 5 7 9 11 13 15 17 19 21

n + 5

n + 5

-0.5

0.5

1.5

2.5

1 3 5 7 9 11 13 15 17 19 21

n + 6

n + 6

-0.5

0.5

1.5

2.5

1 3 5 7 9 11 13 15 17 19 21

n + 7

n + 7

-0.5

0.5

1.5

2.5

1 3 5 7 9 11 13 15 17 19 21

n + 8

n + 8

-0.5

0.5

1.5

2.5

1 3 5 7 9 11 13 15 17 19 21

n + 9

n + 9

-0.5

0.5

1.5

2.5

1 3 5 7 9 11 13 15 17 19 21

n + 10

n + 10

-0.5

0.5

1.5

2.5

1 3 5 7 9 11 13 15 17 19 21

n + 11

n + 11

Figure 7: Lax Scheme step graphs (v=0.5).

Again, demonstrating the upper limit of stability first, v=0.51:

Page 17: A Solution of Partial Differential Equations by Finite-Difference Approximations

P a g e | 14

-0.5

0.5

1.5

2.5

1 3 5 7 9 11 13 15 17 19 21

n + 2

n + 2

-0.5

0.5

1.5

2.5

1 3 5 7 9 11 13 15 17 19 21

n + 6

n + 6

-0.5

0.5

1.5

2.5

1 3 5 7 9 11 13 15 17 19 21

n + 11

n + 11

Figure 8: Lax Scheme step graphs (v=0.51).

n n+1 n+2 n+3 n+4 n+5 n+6 n+7 n+8 n+9 n+10 n+11i 0 0 0 0 0 0 0 0 0 0 0 0

i+1 1 -0.02 -0.0099 0.0004 0.0002 -1e-5 -5e-6 2.87e-7 1.4e-7 -8.7e-9 -4.2e-9 2.76e-10

i+2 2 0.99 -0.0403 -0.0198 0.0010 0.0005 -2.9e-05 -1.4e-5 8.69e-7 4.23e-7 -2.8e-8 -1.3e-8

i+3 2 2.01 0.9797 -0.0609 -0.0297 0.0018 0.0009 -5.8e-5 -2.8e-5 1.88e-6 9.12e-7 -6.3e-8

Table 6: Lax Scheme computational grid (v=0.51).

With now proving the lower boundary point, from the theory, v=−0.5, as the value migrations are so small these figures shall be supported with the first 4 rows of the computational grid to demonstrate the changes clearly:

-0.5

0.5

1.5

2.5

1 3 5 7 9 11 13 15 17 19 21

n + 2

n + 2

-0.5

0.5

1.5

2.5

1 3 5 7 9 11 13 15 17 19 21

n + 6

n + 6

-0.5

0.5

1.5

2.5

1 3 5 7 9 11 13 15 17 19 21

n + 11

n + 11

Figure 9: Lax Scheme step graphs (v=−0.5).

n n+1 n+2 n+3 n+4 n+5 n+6 n+7 n+8 n+9 n+10 n+11i 0 0 0 0 0 0 0 0 0 0 0 0

i+1 1 2 2 1 0 0 0 0 0 0 0 0i+2 2 2 1 0 0 0 0 0 0 0 0 0i+3 2 1 0 0 0 0 0 0 0 0 0 0

Table 7: Lax Scheme computational grid (v=−0.5).

Moving beyond this limit, v=−0.51:

-0.5

0.5

1.5

2.5

1 3 5 7 9 11 13 15 17 19 21

n + 2

n + 2

-0.5

0.5

1.5

2.5

1 3 5 7 9 11 13 15 17 19 21

n + 6

n + 6

-0.5

0.5

1.5

2.5

1 3 5 7 9 11 13 15 17 19 21

n + 11

n + 11

Figure 10: Lax Scheme step graphs (v=−0.51).

Page 18: A Solution of Partial Differential Equations by Finite-Difference Approximations

P a g e | 15

n n+1 n+2 n+3 n+4 n+5 n+6 n+7 n+8 n+9 n+10 n+11i 0 0 0 0 0 0 0 0 0 0 0 0

i+1 1 2.02 2.0301 0.9894 -0.0616 -0.0406 0.0019 0.0014 -5.9e-5 -5e-5 1.91e-6 1.74e-6

i+2 2 2.01 0.9797 -0.061 -0.0402 0.0018 0.0014 -5.8e-5 -5e-5 1.89e-6 1.72e-6 -6.3e-8

i+3 2 0.99 -0.040 -0.03 0.0012 0.0010 -3.9e-5 -3.5e-5 1.29e-6 1.21e-6 -4.3e-8 -4.3e-8

Table 8: Lax Scheme computational grid (v=−0.51).

A final area of interest is when v=0, as this then sets ∆ t=0 too:

-0.5

0.5

1.5

2.5

1 3 5 7 9 11 13 15 17 19 21

n + 2

n + 2

-0.5

0.5

1.5

2.5

1 3 5 7 9 11 13 15 17 19 21

n + 6

n + 6

-0.5

0.5

1.5

2.5

1 3 5 7 9 11 13 15 17 19 21

n + 11

n + 11

Figure 11: Lax Scheme step graphs (v=0).

n n+1 n+2 n+3 n+4 n+5 n+6 n+7 n+8 n+9 n+10 n+11i 0 0 0 0 0 0 0 0 0 0 0 0

i+1 1 1 0.75 0.625 0.5 0.4375 0.3594 0.3281 0.2734 0.2578 0.2168 0.2095i+2 2 1.5 1.25 1 0.875 0.7188 0.6563 0.5469 0.5156 0.4336 0.4189 0.3545i+3 2 1.5 1.25 1.125 0.9375 0.875 0.7344 0.7031 0.5938 0.5801 0.4922 0.4888

Table 9: Lax Scheme computational grid (v=0).

Lax-Wendroff Scheme

The final methods results to display are the Lax-Wendroff method, by far the most complicated pf the three:

T in+1=T i

n−U ∆t {T i+1n −T i−1n

2∆ x }+U 2 ∆t 2

2 {T i+1n −2T in+T i−1

n

∆ x2 }

¿>T in+ 1=2−(1 ) (0.1 ) { 2−12 (0.1 ) }+12 0.1

2

2 {2−2 (1 )+10.12 }=1

Excel code:

T in+1=C 7−(($C $2∗$ L$ 2)∗((C8−C6)/(2∗$ F $ 2)))+((($ C$ 22)∗($ L$22) /2)∗((C 8−(2∗C 7)+C 6)/($ F $22)))

$C $2=U , $ L$2=∆ t , $ F$ 2=∆x.

n n+1 n+2 n+3 n+4 n+5 n+6 n+7 n+8 n+9 n+10

n+11

i 0 0 0 0 0 0 0 0 0 0 0 0i+1 1 0 0 0 0 0 0 0 0 0 0 0i+2 2 1 0 0 0 0 0 0 0 0 0 0i+3 2 2 1 0 0 0 0 0 0 0 0 0i+4 1 2 2 1 0 0 0 0 0 0 0 0i+5 0 1 2 2 1 0 0 0 0 0 0 0

Page 19: A Solution of Partial Differential Equations by Finite-Difference Approximations

P a g e | 16

i+6 0 0 1 2 2 1 0 0 0 0 0 0i+7 0 0 0 1 2 2 1 0 0 0 0 0i+8 0 0 0 0 1 2 2 1 0 0 0 0i+9 0 0 0 0 0 1 2 2 1 0 0 0i+10

0 0 0 0 0 0 1 2 2 1 0 0

i+11

0 0 0 0 0 0 0 1 2 2 1 0

i+12

0 0 0 0 0 0 0 0 1 2 2 1

i+13

0 0 0 0 0 0 0 0 0 1 2 2

i+14

0 0 0 0 0 0 0 0 0 0 1 2

i+15

0 0 0 0 0 0 0 0 0 0 0 1

i+16

0 0 0 0 0 0 0 0 0 0 0 0

i+17

0 0 0 0 0 0 0 0 0 0 0 0

i+18

0 0 0 0 0 0 0 0 0 0 0 0

i+19

0 0 0 0 0 0 0 0 0 0 0 0

i+20

0 0 0 0 0 0 0 0 0 0 0 0

Table 10: Lax-Wendroff Scheme computational grid (v=0.5).

Finally, with the computation grid complete the necessary step graphs of the Lax-Wendroff method can be produced (figure 11):

Page 20: A Solution of Partial Differential Equations by Finite-Difference Approximations

P a g e | 17

-0.5

0.5

1.5

2.5

1 3 5 7 9 11 13 15 17 19 21

n

n

-0.5

0.5

1.5

2.5

1 3 5 7 9 11 13 15 17 19 21

n + 1

n + 1

-0.5

0.5

1.5

2.5

1 3 5 7 9 11 13 15 17 19 21

n + 2

n + 2

-0.5

0.5

1.5

2.5

1 3 5 7 9 11 13 15 17 19 21

n + 3

n + 3

-0.5

0.5

1.5

2.5

1 3 5 7 9 11 13 15 17 19 21

n + 4

n + 4

-0.5

0.5

1.5

2.5

1 3 5 7 9 11 13 15 17 19 21

n + 5

n + 5

-0.5

0.5

1.5

2.5

1 3 5 7 9 11 13 15 17 19 21

n + 6

n + 6

-0.5

0.5

1.5

2.5

1 3 5 7 9 11 13 15 17 19 21

n + 7

n + 7

-0.5

0.5

1.5

2.5

1 3 5 7 9 11 13 15 17 19 21

n + 8

n + 8

-0.5

0.5

1.5

2.5

1 3 5 7 9 11 13 15 17 19 21

n + 9

n + 9

-0.5

0.5

1.5

2.5

1 3 5 7 9 11 13 15 17 19 21

n + 10

n + 10

-0.5

0.5

1.5

2.5

1 3 5 7 9 11 13 15 17 19 21

n + 11

n + 11

Figure 12: Lax-Wendroff Scheme step graphs (v=0.5).

Finally, again proceeding to prove the stability boundaries, which in this system are the same boundary values as the Lax Scheme, therefore beginning with the upper limit,v=0.51:

-0.5

0.5

1.5

2.5

1 3 5 7 9 11 13 15 17 19 21

n + 2

n + 2

-0.5

0.5

1.5

2.5

1 3 5 7 9 11 13 15 17 19 21

n + 6

n + 6

-0.5

0.5

1.5

2.5

1 3 5 7 9 11 13 15 17 19 21

n + 11

n + 11

Figure 13: Lax-Wendroff Scheme step graphs (v=0.51).

n n+1 n+2 n+3 n+4 n+5 n+6 n+7 n+8 n+9 n+10 n+11i 0 0 0 0 0 0 0 0 0 0 0 0

i+1 1 -0.02 0.0107 -0.0008 0.0003 -3.5e-5 8.69e-6 -1.5e-6 3.44e-7 -6.7e-8 1.5e-8 -3.1e-9

i+2 2 0.9698 -0.0395 0.0222 -0.0024 0.0007 -0.0001 2.78e-5 -5.2e-6 1.21e-6 -2.5e-7 5.61e-8

i+3 2 1.9898 0.9393 -0.0584 0.0345 -0.0046 0.0014 -0.0003 6.31e-5 -1.3e-5 3e-06 -6.4e-7

Table 11: Lax-Wendroff Scheme computational grid (v=0.51).

Page 21: A Solution of Partial Differential Equations by Finite-Difference Approximations

P a g e | 18

Finally, again proceeding to prove the lower stability boundary, at v=−0.5:

-0.5

0.5

1.5

2.5

1 3 5 7 9 11 13 15 17 19 21

n + 2

n + 2

-0.5

0.5

1.5

2.5

1 3 5 7 9 11 13 15 17 19 21

n + 6

n + 6

-0.5

0.5

1.5

2.5

1 3 5 7 9 11 13 15 17 19 21

n + 11

n + 11

Figure 14: Lax-Wendroff Scheme step graphs (v=−0.50).

n n+1 n+2 n+3 n+4 n+5 n+6 n+7 n+8 n+9 n+10 n+11i 0 0 0 0 0 0 0 0 0 0 0 0

i+1 1 2 2 1 0 0 0 0 0 0 0 0i+2 2 2 1 0 0 0 0 0 0 0 0 0i+3 2 1 0 0 0 0 0 0 0 0 0 0

Table 12: Lax-Wendroff Scheme computational grid (v=−0.50).

Then exceeding the stability boundary, v=−0.51:

-0.5

0.5

1.5

2.5

1 3 5 7 9 11 13 15 17 19 21

n + 2

n + 2

-0.5

0.5

1.5

2.5

1 3 5 7 9 11 13 15 17 19 21

n + 6

n + 6

-0.5

0.5

1.5

2.5

1 3 5 7 9 11 13 15 17 19 21

n + 11

n + 11

Figure 15: Lax-Wendroff Scheme step graphs (v=−0.51).

n n+1 n+2 n+3 n+4 n+5 n+6 n+7 n+8 n+9 n+10 n+11i 0 0 0 0 0 0 0 0 0 0 0 0

i+1 1 2.02 1.9682 0.8881 -0.0962 0.0507 -0.0090 0.0027 -0.0006 0.0001 -3.1e-5 7.51e-6

i+2 2 1.9898 0.9393 -0.0586 0.0454 -0.0068 0.0023 -0.0004 0.0001 -2.5e-5 6.06e-6 -1.4e-6

i+3 2 0.9698 -0.0395 0.0330 -0.0039 0.0014 -0.0003 6.84e-5 -1.4e-5 3.51e-6 -7.7e-7 1.85e-7

Table 13: Lax-Wendroff Scheme computational grid (v=−0.51).

The finally at when v=0:

-0.5

0.5

1.5

2.5

1 3 5 7 9 11 13 15 17 19 21

n + 2

n + 2

-0.5

0.5

1.5

2.5

1 3 5 7 9 11 13 15 17 19 21

n + 6

n + 6

-0.5

0.5

1.5

2.5

1 3 5 7 9 11 13 15 17 19 21

n + 11

n + 11

Figure 16: Lax-Wendroff Scheme step graphs (v=0).

Page 22: A Solution of Partial Differential Equations by Finite-Difference Approximations

P a g e | 19

n n+1 n+2 n+3 n+4 n+5 n+6 n+7 n+8 n+9 n+10 n+11i 0 0 0 0 0 0 0 0 0 0 0 0

i+1 1 1 1 1 1 1 1 1 1 1 1 1i+2 2 2 2 2 2 2 2 2 2 2 2 2i+3 2 2 2 2 2 2 2 2 2 2 2 2

Table 14: Lax-Wendroff Scheme computational grid (v=0).

Page 23: A Solution of Partial Differential Equations by Finite-Difference Approximations

P a g e | 20

Analysis

Through an in-depth analysis of the data, later judgements on all three methods used can be made, dissecting their strengths and weakness and alluding to how they can be improved moving forwards.

Through the initial data sets of each approximation method it becomes apparent to see that on the upper boundary of stability, when v=0.5, creating a time step, ∆ t=0.1, they all accurately represent the partial differential over the time steps requested. The graphs show no distortion away from the initial differentials solution, they are simply transported along the time steps. This is where the comparative similarities between each method begin to diverge and the differences become more noticeable in each system.

This begins with when v is set to 0, The Forward-Time, Backward-Space system, in which this value is the theoretical lower limit of stability, demonstrates the initial time step graph depicted in the objectives, Figure 1, although, instead of transporting this shape through each time step, as when set to its upper stability boundary, the graph remains stationary repeating itself over the perceived time window. The Lax-Wendroff method behaves the same manner, recycling the step size as the time progresses, although for this methods case, this isn’t the lower stability value for the system. The Lax method differs in this scenario, again this not linked to its stability value limits and is well within the region and the graph again remains stationary and doesn’t transpose through the steps, yet the approximation shows signs of inaccuracies, with the prediction error amplifying through the window as the graph decays, Figure 11. Whilst the other two method remain constant, the Lax exhibits a drop in peak prediction value from 2 in n, to 0.4888 when at n+11, illustrating an error of 75.56% from the true value of the differential at this stage. The decay rate appears to be sub linear and an error analysis shall be conducted to validate this hypothesis.

When then moved to set, v to the lower limit of the following two methods, −0.5, ∆ t=−0.1, they both behave in the same manner. They demonstrate the peak value of the partial differential in the initial steps, until they the systems predicts 0 over the rest of the tested window. When set to the positive limit bound the prediction moves forwards, from the top left to the bottom right of the computational domain, both forwards, in time and in grid points. Yet now in this set up, it becomes apparent in the few perceivable steps before the grid becomes all zeros that now the values are translating perpendicularly to this, e.g. from bottom left to top right.

Thus far, these results have stayed within the theoretical bounds of the methods stability as depicted in the theory. This limit can only be verified by demonstrating the effects of passing through it, which as, when all set to the upper value of, v=0.51, the graphs show early signs of an instability, illustrated through the growing amplitude in the oscillations of the value as it fluctuates between positive and negative signs (FT-BS - Figure 4, Lax - Figure 8, L-W - Figure 13). There is further evidence of this in the computational grids as the magnitude on the value, both positive and negative, is rising as the system moves through the time and grid steps, diagonally down to the right. The pattern of these fluctuations also follows a distinct pattern from method to method, with the FT-BS and Lax-Wendroff Schemes both maintaining a switch in sign after each step, yet the Lax Scheme changes every two steps along the computational grid (FT-BS - Table 2, Lax - Table 6, L-W - Table 11). In addition to the sign volatility, the over prediction level of the each method rises and in line with the v=0 analysis, an error shall be plotted and discussed later to allude to any pattern in the data.

Page 24: A Solution of Partial Differential Equations by Finite-Difference Approximations

P a g e | 21

Moving towards exceeding the negative boundary, v=−0.51, where ∆ t=−0.102 and the data begins to behave in a combination of when at v=0.51, as the data is unstable and following the same trends as before and when at −0.5, as the direction of migration of the results has again moved through 90 ° anti-clockwise, perpendicular to when the value is positive. The values are growing in size as they move through the steps, signs of an unstable method. The major difference between each limit is the magnitude of the values, when at the positive bound they are still in the same order of magnitude to the true answer, yet on the negative bound, they are considerably lower, to the point that their movements can only be witnessed in the data and don’t appear on the standard scale used for the rest of the graphs.

Page 25: A Solution of Partial Differential Equations by Finite-Difference Approximations

P a g e | 22

Discussion

From use of the theory, the measurement of success when deploying a finite-difference approximation method is gauged in three major categories:

Consistency Stability Convergence

Through discussing the various methods in accordance with these classifications, then their relative performance to one another can be yielded and conclusions drawn.

Beginning with the consistency, from the theory:

The consistency alludes to the finite-differences accuracy of approximation of the partial differential, when the delta parameters tend to 0, then the approximation should converge

towards the true value of the differential.

This is also where the use of a Taylor series expansion can help to demonstrate a methods stability, as through its implementation, the original PDE should be attainable if the method is consistent. Therefore taking the systems in turn:

Forward-Time, Backward-Space Taylor Series Expansion

T in+1−T i

n

∆t+U {T in−T i−1n∆ x }=0

Insert Taylor Series and rearrange to give:

∂T∂ t

+U ∂T∂ x

+∆ t2 !∂2T∂ t 2

−U ∆ x2 !∂2T∂ x2

+…=0

When ∆ t →0 and ∆ x→0:

∂T∂ t

+U ∂T∂ x

=0

This satisfies the methods statement of tending the delta parameters to 0 and in doing so the method is proven to be consistent as the final equation mirrors that of the original PDE.

FT-BS Truncation Error

The truncation error relates to the terms that are approximated to zero when attempting to prove consistency, the terms of the most significance are selected, which in itself makes the truncation error value an approximation also:

T . E=∆t2!∂2T∂t 2

−U ∆ x2!∂2T∂x2

+…

Lax Scheme Taylor Series Expansion

T in+1−

T i+1n +T i−1

n

2∆ t

+U {T i+1n −T i−1n

2∆ x }=0

Page 26: A Solution of Partial Differential Equations by Finite-Difference Approximations

P a g e | 23

Insert Taylor Series and rearrange to give:

∂T∂ t

+U ∂T∂ x

+∆ t2 !∂2T∂ t 2

− ∆ x2∆t

∂2T∂ x2

+U ∆x2

3!∂3T∂ x3

…=0

When ∆ t →0 and ∆ x→0:

∂T∂ t

+U ∂T∂ x

−∆ x2

2∆ t∂2T∂x2

=0

In this case again the equation differs from the original and is therefore deemed inconsistent.

Lax Truncation Error

T . E=U ∆x2

3 !∂3T∂ x3

Lax-Wendroff Scheme Taylor Series Expansion

T in+1=T i

n−U ∆t {T i+1n −T i−1n

2∆ x }+U 2 ∆t 2

2 {T i+1n −2T in+T i−1

n

∆ x2 }

Due to the complexity of the final method, a slightly different approach is needed to comprehensively expand the scheme, beginning with an expansion in time truncated after the second derivative:

T in+1≈T i

n+∆ t ∂T∂ t

+∆ t2

2!∂2T∂ t 2

+…

The proceeding forward requires the introduction of the equation to be solved, which replaces the first derivative in time:

∂T∂ t

=−U ∂T∂x

Then through differentiating this equation, the second derivative in the original expansion can also be replaced:

∂2T∂ t 2

=−A ∂∂ t ( ∂T∂x )=−A ∂

∂x ( ∂T∂ t )=A2 ∂2T∂ x2

Yielding Taylor Series in time of:

T in+1=T i

n−A ∆ t ∂T∂ t

+A2 ∆ t2

2!∂2T∂x2

+…

The final task is to approximate the spatial derivatives using the centre-difference formula:

T in+1=T i

n−( A ∆t2∆ x )(T i+1n −T i−1n )+2( A ∆t2 x )

2

(T i+1n −2T in+T i−1

n )

This demonstrates that the Lax-Wendroff, like the Forward-Time, Backward-Space Scheme is consistent with the original PDE.

Page 27: A Solution of Partial Differential Equations by Finite-Difference Approximations

P a g e | 24

Lax-Wendroff Truncation Error

T . E=∆t2

2 !∂2T∂t 2

+∆ x2

2!∂2T∂ x2

+…

With the consistency now established for each method, the stability can be investigated, which was achieved through the variation of the v parameter, which in turn adjusted the time step of the grid. Variation in this manner helps to allude to how the systems react to the computation domain being altered, changing the mesh discretisation of the problem. The stability from the theory dictates:

Stability confirms that the final solution’s sensitivity is within the accepted range and isn’t too volatile to small perturbations in the data.

Through the analysis and the results garnered form performing the methods, it becomes apparent that the Forward-Time, Backward-Space Scheme, although consistent, isn’t stable as small movements in ∆ t , has profound effects on the error of the peak value, demonstrated in the tables below which embody a increment variation of 0.02 :

Δt = 0.08 Δt = 0.06 Δt = 0.04 Δt = 0.02Step Error (%) Step Error (%) Step Error (%) Step Error (%)

n 0 n 0 n 0 n 0n+1 20 n+1 40 n+1 60 n+1 80n+2 29.6 n+2 56.8 n+2 79.2 n+2 94.4n+3 38.56 n+3 69.76 n+3 89.76 n+3 98.56n+4 46.75 n+4 79.26 n+4 95.14 n+4 99.65n+5 54.12 n+5 86.00 n+5 97.75 n+5 99.92n+6 60.68 n+6 90.67 n+6 98.98 n+6 99.98n+7 60.68 n+7 90.67 n+7 98.98 n+7 99.98n+8 66.45 n+8 93.84 n+8 99.54 n+8 99.99n+9 71.48 n+9 95.97 n+9 99.79 n+9 99.99n+10 75.84 n+10 97.38 n+10 99.91 n+10 99.99n+11 79.59 n+11 98.30 n+11 99.96 n+11 99.99

Table 15: Time step variation FT-BS.

This clearly illustrates the instability of this method, showing how sensitive it is to small changes in the time step.

Moving on to the Lax method, The graphs in the results show how much more stable it is in comparison to the FT-BS still demonstrating the convection through the time step throughout the whole range of values for ∆ t . This coupled with it being inconsistent yet alleviates to a method that encompasses the necessary criteria to be a successful approximation method. Further empirical

Page 28: A Solution of Partial Differential Equations by Finite-Difference Approximations

P a g e | 25

evidence of the Lax Methods inconsistency is that when v=0, the graphs should have demonstrated the initial conditions, something the Forward-Time, Backward-Space and Lax-Wendroff schemes both satisfied, whereas the Lax scheme continued to approximate steps moving forwards. The following graph illustrates the percentage error in comparison to if the steps were still taken:

0

10

20

30

40

50

60

70

80

0 5 10 15

Perc

enta

ge E

rror

(%)

Time Step (n + )

Percentage Error of Lax Method (V=0)

% error

Figure 17: Percentage error of Lax Method (v=0).

The graph demonstrates a sub-linear rate of convergence in relation to error as it grows, reinforcing the consistency claim.

Finally the Lax-Wendroff Scheme, the most complex of the three and has already been proven to be constant with the original PDE. This again though the data spread in the results can be seen as stable, within its stability limits it can accurately predict the differential. When all three step over their stability boundary at v=0.51, with a time step of ∆ t=0.102, the Lax-Wendroff is by far the most capable at maintain accuracy as illustrated in figure 18, where all three methods are demonstrated on the same graph to ease direct comparisons to be made:

0

2

4

6

8

10

12

0 5 10 15

Perc

enta

ge E

rror

(%)

Time Step (n+)

Relative Overshoot Error (V=0.51)

FT-BS

Lax

LW

Figure 18: Relative overshoot error percentage (v=0.51).

As the graph shows the other two methods far exceed the error of the Lax-Wendroff Scheme, which shows signs of the error growth rate reducing as more time steps are taken.

The final criterion to satisfy is the convergence:

Page 29: A Solution of Partial Differential Equations by Finite-Difference Approximations

P a g e | 26

The approximation solutions ability to iterate towards the original differentials as the mesh density becomes more sophisticated.

It is also known from Strikwerda that, ‘stability is the necessary and sufficient condition for convergence of the numerical scheme.’ Which immediately denies the Forward-Time, Backward-Space Scheme this accreditation. The Lax-Wendroff certainly achieves this directive, as when the step size is altered, the residual error induces is within an acceptable region compared to the other methods to be described as convergent and the problem becomes grid independent when ∆ t=0.1.

It became clear during the analysis that when the two Lax methods proceeded to values of v that were negative, the patterns in the data altered slightly. This can be adjudged to be the effect of then employing a negative time step, instead of the data migrating diagonally down and right, this change of sign resulted in the migration moving up instead, which is why there are very few non-zero numbers in the computational grid, the grid point being used to calculate the next has been reversed and is therefore taking into account many more zeros.

It was also highlighted that the pattern of sign migration was slightly different for the Lax method, as the sign reverse after every two steps rather than every one for the other two methods. This can be attributed to the primary equation used to calculate the grid point. The Lax doesn’t encompass a T i

n term and as results feels the effect of the sign change a step later than the other two methods, hence the delayed sign change.

Page 30: A Solution of Partial Differential Equations by Finite-Difference Approximations

P a g e | 27

Conclusion

In conclusion, with all the evidence supplied, it is clear to see the Lax-Wendroff is the best scheme in terms of accuracy, yet it is also the most complex and the additional computing time is not always going to be an efficient use of time. The second best would be the Forward-Time, Backward-Space Scheme, as although more crude than the Lax Method, in more situations it mirror the original PDE, yet lost accuracy the most readily under variations in the time step.

The process must be seen as a success as the results mirrored that of the theoretical information highlighted in the early stages of this paper. All the objectives have been satisfied and with the inherent cohesive nature of the data with the theoretical, result validity and reliability claims are refuted. Through variation of the time step the methods were conclusively tested and the three criteria that demonstrate finite-difference approximation methods validity studied. Through use of Taylor Series Expansions the constancy of each was illustrated, before investigating the stability and convergence through varying the time step.

Improving this process if more time was afforded would further enhance the results stature and could be achieved by setting up the spreadsheets again separately to dial out any human error with data input. Also, by applying the approximation schemes to a range of partial differentials would help to further ratify the superiority of a given system.

Page 31: A Solution of Partial Differential Equations by Finite-Difference Approximations

P a g e | 28

References

1. Tu, J., Yeoh, G. H. and Liu, C. (2008). Computational Fluid Dynamics. Amsterdam: Butterworth-Heinemann.

2. University of Alaska, (n.d.). Chapter 9 - Convection Equations. [online] Available at: http://how.gi.alaska.edu/ao/sim/chapters/chap9.pdf [Accessed 16 Dec. 2014].

3. Chi-Tsong C. (1984). Linear System Theory and Design. Philadelphia, PA, USA: Saunders College Publishing

4. Scarborough, J. (1966). Numerical mathematical analysis. Baltimore: Johns Hopkins Press.5. Jussieu, A. (n.d.). Chapter 6: The Finite Difference Method. [online] Available at:

http://www.ann.jussieu.fr/frey/cours/UdC/ma691/ma691_ch6.pdf [Accessed 5 Dec. 2014].6. Mitchell, A.R., Griffiths, D.F. (1980). The finite Difference Method in Partial Differential

Equations. Chichester: John Wiley and Sons. 7. University of Madras, (n.d.). Analysis of Numerical Schemes. [online] Available at:

http://www.che.iitm.ac.in/~sjayanti/cfd2.pdf [Accessed 9 Dec. 2014].8. Strikwerda, J. (1989). Finite difference schemes and partial differential equations. Pacific

Grove, Calif.: Wadsworth & Brooks/Cole Advanced Books & Software.