0% found this document useful (0 votes)
312 views

Basic of Finite Difference Method

The finite difference method is a numerical method for solving differential equations by approximating them with difference equations. It works by discretizing the domain into a grid and using Taylor series expansions to approximate derivatives as finite differences. The accuracy and stability of solutions depend on the choice of discretization. Common examples include explicit and implicit methods for heat equations.

Uploaded by

poliskarma
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
312 views

Basic of Finite Difference Method

The finite difference method is a numerical method for solving differential equations by approximating them with difference equations. It works by discretizing the domain into a grid and using Taylor series expansions to approximate derivatives as finite differences. The accuracy and stability of solutions depend on the choice of discretization. Common examples include explicit and implicit methods for heat equations.

Uploaded by

poliskarma
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

8/1/2015

FinitedifferencemethodWikipedia,thefreeencyclopedia

Finitedifferencemethod
FromWikipedia,thefreeencyclopedia

Inmathematics,finitedifferencemethods(FDM)arenumericalmethodsforsolvingdifferential
equationsbyapproximatingthemwithdifferenceequations,inwhichfinitedifferencesapproximatethe
derivatives.FDMsarethusdiscretizationmethods.
Today,FDMsarethedominantapproachtonumericalsolutionsofpartialdifferentialequations.[1]

Contents
1DerivationfromTaylor'spolynomial
2Accuracyandorder
3Example:ordinarydifferentialequation
4Example:Theheatequation
4.1Explicitmethod
4.2Implicitmethod
4.3CrankNicolsonmethod
5Seealso
6References
7Externallinks
7.1Variouslecturesandlecturenotes

DerivationfromTaylor'spolynomial
First,assumingthefunctionwhosederivativesaretobeapproximatedisproperlybehaved,byTaylor's
theorem,wecancreateaTaylorSeriesexpansion

wheren!denotesthefactorialofn,andRn(x)isaremainderterm,denotingthedifferencebetweenthe
Taylorpolynomialofdegreenandtheoriginalfunction.Wewillderiveanapproximationforthefirst
derivativeofthefunction"f"byfirsttruncatingtheTaylorpolynomial:

Setting,x0=awehave,

Dividingacrossbyhgives:

Solvingforf'(a):
https://en.wikipedia.org/wiki/Finite_difference_method

1/7

8/1/2015

Assumingthat

FinitedifferencemethodWikipedia,thefreeencyclopedia

issufficientlysmall,theapproximationofthefirstderivativeof"f"is:

Accuracyandorder
Theerrorinamethod'ssolutionisdefinedasthedifferencebetweenitsapproximationandtheexact
analyticalsolution.Thetwosourcesoferrorinfinitedifferencemethodsareroundofferror,thelossof
precisionduetocomputerroundingofdecimalquantities,andtruncationerrorordiscretizationerror,the
differencebetweentheexactsolutionofthefinitedifferenceequationandtheexactquantityassuming
perfectarithmetic(thatis,assumingnoroundoff).
Touseafinitedifferencemethodtoapproximatethesolutiontoa
problem,onemustfirstdiscretizetheproblem'sdomain.Thisis
usuallydonebydividingthedomainintoauniformgrid(see
imagetotheright).Notethatthismeansthatfinitedifference
methodsproducesetsofdiscretenumericalapproximationstothe
derivative,oftenina"timestepping"manner.
Anexpressionofgeneralinterestisthelocaltruncationerrorofa
method.TypicallyexpressedusingBigOnotation,local
truncationerrorreferstotheerrorfromasingleapplicationofa
method.Thatis,itisthequantity
if
refers
totheexactvalueand tothenumericalapproximation.The
remaindertermofaTaylorpolynomialisconvenientfor
analyzingthelocaltruncationerror.UsingtheLagrangeformof
theremainderfromtheTaylorpolynomialfor
,
whichis

Thefinitedifferencemethodrelieson
discretizingafunctiononagrid.

,where
,
thedominanttermofthelocaltruncationerrorcanbediscovered.Forexample,againusingtheforward
differenceformulaforthefirstderivative,knowingthat
,

andwithsomealgebraicmanipulation,thisleadsto

https://en.wikipedia.org/wiki/Finite_difference_method

2/7

8/1/2015

FinitedifferencemethodWikipedia,thefreeencyclopedia

andfurthernotingthatthequantityontheleftistheapproximationfromthefinitedifferencemethodand
thatthequantityontherightistheexactquantityofinterestplusaremainder,clearlythatremainderis
thelocaltruncationerror.Afinalexpressionofthisexampleanditsorderis:

Thismeansthat,inthiscase,thelocaltruncationerrorisproportionaltothestepsizes.Thequalityand
durationofsimulatedFDMsolutiondependsonthediscretizationequationselectionandthestepsizes
(timeandspacesteps).Thedataqualityandsimulationdurationincreasesignificantlywithsmallerstep
size.[2]Therefore,areasonablebalancebetweendataqualityandsimulationdurationisnecessaryfor
practicalusage.Largetimestepsarefavourabletoincreasesimulationspeedinmanypractice,however
toolargetimestepsmaycreateinstabilitiesandaffectingthedataquality.[3][4][5]
ThevonNeumannmethod(Fourierstabilityanalysis)usuallyappliedtodeterminethenumericalmodel
stability.[3][4][5][6][7]

Example:ordinarydifferentialequation
Forexample,considertheordinarydifferentialequation

TheEulermethodforsolvingthisequationusesthefinitedifferencequotient

toapproximatethedifferentialequationbyfirstsubstitutinginforu'(x)thenapplyingalittlealgebra
(multiplyingbothsidesbyh,andthenaddingu(x)tobothsides)toget

Thelastequationisafinitedifferenceequation,andsolvingthisequationgivesanapproximatesolution
tothedifferentialequation.

Example:Theheatequation
Considerthenormalizedheatequationinonedimension,withhomogeneousDirichletboundary
conditions
(boundarycondition)
(initialcondition)
Onewaytonumericallysolvethisequationistoapproximateallthederivativesbyfinitedifferences.
Wepartitionthedomaininspaceusingamesh
andintimeusingamesh
.We
assumeauniformpartitionbothinspaceandintime,sothedifferencebetweentwoconsecutivespace
pointswillbehandbetweentwoconsecutivetimepointswillbek.Thepoints
https://en.wikipedia.org/wiki/Finite_difference_method

3/7

8/1/2015

FinitedifferencemethodWikipedia,thefreeencyclopedia

willrepresentthenumericalapproximationof

Explicitmethod
Usingaforwarddifferenceattime andasecondordercentral
differenceforthespacederivativeatposition (FTCS)weget
therecurrenceequation:

Thisisanexplicitmethodforsolvingtheonedimensionalheat
equation.
Wecanobtain

Thestencilforthemostcommon
explicitmethodfortheheatequation.

fromtheothervaluesthisway:

where
So,withthisrecurrencerelation,andknowingthevaluesattimen,onecanobtainthecorresponding
valuesattimen+1. and mustbereplacedbytheboundaryconditions,inthisexampletheyare
both0.
Thisexplicitmethodisknowntobenumericallystableandconvergentwhenever
numericalerrorsareproportionaltothetimestepandthesquareofthespacestep:

.[8]The

Implicitmethod
Ifweusethebackwarddifferenceattime
andasecond
ordercentraldifferenceforthespacederivativeatposition
(TheBackwardTime,CenteredSpaceMethod"BTCS")weget
therecurrenceequation:

Thisisanimplicitmethodforsolvingtheonedimensionalheat
equation.
Wecanobtain

Theimplicitmethodstencil.

fromsolvingasystemoflinearequations:

https://en.wikipedia.org/wiki/Finite_difference_method

4/7

8/1/2015

FinitedifferencemethodWikipedia,thefreeencyclopedia

Theschemeisalwaysnumericallystableandconvergentbutusuallymorenumericallyintensivethanthe
explicitmethodasitrequiressolvingasystemofnumericalequationsoneachtimestep.Theerrorsare
linearoverthetimestepandquadraticoverthespacestep:

CrankNicolsonmethod
Finallyifweusethecentraldifferenceattime
andasecondordercentraldifferenceforthe
spacederivativeatposition ("CTCS")wegettherecurrenceequation:

ThisformulaisknownastheCrankNicolsonmethod.
Wecanobtain

fromsolvingasystemoflinearequations:

TheCrankNicolsonstencil.

Theschemeisalwaysnumericallystableandconvergentbutusuallymorenumericallyintensiveasit
requiressolvingasystemofnumericalequationsoneachtimestep.Theerrorsarequadraticoverboth
thetimestepandthespacestep:

UsuallytheCrankNicolsonschemeisthemostaccurateschemeforsmalltimesteps.Theexplicit
schemeistheleastaccurateandcanbeunstable,butisalsotheeasiesttoimplementandtheleast
numericallyintensive.Theimplicitschemeworksthebestforlargetimesteps.

Seealso
Finiteelementmethod
Finitedifference
Finitedifferencetimedomain
Stencil(numericalanalysis)
Finitedifferencecoefficients
Fivepointstencil
LaxRichtmyertheorem
Finitedifferencemethodsforoptionpricing
Upwinddifferencingschemeforconvection
Centraldifferencingscheme
https://en.wikipedia.org/wiki/Finite_difference_method

5/7

8/1/2015

FinitedifferencemethodWikipedia,thefreeencyclopedia

References
1. ChristianGrossmannHansG.RoosMartinStynes(2007).NumericalTreatmentofPartialDifferential
Equations.SpringerScience&BusinessMedia.p.23.ISBN9783540715849.
2. AriehIserlas(2008).Afirstcourseinthenumericalanalysisofdifferentialequations.CambridgeUniversity
Press.p.23.ISBN9780521734905.
3. HoffmanJDFrankelS(2001).Numericalmethodsforengineersandscientists.CRCPress,BocaRaton.
4. JaluriaYAtluriS(1994)."Computationalheattransfer".ComputationalMechanics14:385386.
doi:10.1007/BF00377593(https://dx.doi.org/10.1007%2FBF00377593).
5. JMohdJaniSHuangMLearyASubic(2015)."Numericalmodelingofshapememoryalloylinear
actuator".ComputationalMechanics:119.doi:10.1007/s004660151180z
(https://dx.doi.org/10.1007%2Fs004660151180z).
6. MajumdarP(2005).Computationalmethodsforheatandmasstransfer(1sted.).TaylorandFrancis,New
York.
7. SmithGD(1985).Numericalsolutionofpartialdifferentialequations:finitedifferencemethods(3rded.).
OxfordUniversityPress.
8. Crank,J.TheMathematicsofDiffusion.2ndEdition,Oxford,1975,p.143.

K.W.MortonandD.F.Mayers,NumericalSolutionofPartialDifferentialEquations,An
Introduction.CambridgeUniversityPress,2005.
AutarKawandE.EricKalu,NumericalMethodswithApplications,(2008)[1]
(http://www.autarkaw.com/books/numericalmethods/index.html).Containsabrief,engineering
orientedintroductiontoFDM(forODEs)inChapter08.07
(http://numericalmethods.eng.usf.edu/topics/finite_difference_method.html).
JohnStrikwerda(2004).FiniteDifferenceSchemesandPartialDifferentialEquations(2nded.).
SIAM.ISBN9780898716399.
Smith,G.D.(1985),NumericalSolutionofPartialDifferentialEquations:FiniteDifference
Methods,3rded.,OxfordUniversityPress
PeterOlver(2013).IntroductiontoPartialDifferentialEquations
(http://www.math.umn.edu/~olver/pde.html).Springer.Chapter5:Finitedifferences.ISBN9783
319020990..
RandallJ.LeVeque,FiniteDifferenceMethodsforOrdinaryandPartialDifferentialEquations
(http://faculty.washington.edu/rjl/fdmbook/),SIAM,2007.

Externallinks
ListofInternetResourcesfortheFiniteDifferenceMethodforPDEs
(http://math.fullerton.edu/mathews/n2003/finitediffpde/FiniteDifferencePDEBib/Links/FiniteDiffe
rencePDEBib_lnk_1.html)

Variouslecturesandlecturenotes
FiniteDifferenceMethodinElectromagnetics(seeandlistentolecture9)
(http://emlab.utep.edu/ee5390cem.htm)
LectureNotes
(http://ltl.iams.sinica.edu.tw/document/training_lectures/2006/SH_Chen/Finite_Difference_Metho
ds.pdf)ShihHungChen,NationalCentralUniversity
FiniteDifferenceMethodforBoundaryValueProblems
(http://math.fullerton.edu/mathews/n2003/FiniteDifferenceMod.html)
NumericalMethodsfortimedependentPartialDifferentialEquations
(http://jwhaverkort.net23.net/documents/NumMethPDEs.pdf)

https://en.wikipedia.org/wiki/Finite_difference_method

6/7

8/1/2015

FinitedifferencemethodWikipedia,thefreeencyclopedia

Retrievedfrom"https://en.wikipedia.org/w/index.php?
title=Finite_difference_method&oldid=673732214"
Categories: Finitedifferences Numericaldifferentialequations
Thispagewaslastmodifiedon30July2015,at03:23.
TextisavailableundertheCreativeCommonsAttributionShareAlikeLicenseadditionalterms
mayapply.Byusingthissite,youagreetotheTermsofUseandPrivacyPolicy.Wikipediaisa
registeredtrademarkoftheWikimediaFoundation,Inc.,anonprofitorganization.

https://en.wikipedia.org/wiki/Finite_difference_method

7/7

You might also like