Serving the Quantitative Finance Community

  • 1
  • 2
  • 3
  • 4
  • 5
  • 36
 
User avatar
Cuchulainn
Posts: 22929
Joined: July 16th, 2004, 7:38 am

Finite difference - CFD technique

January 6th, 2005, 2:21 pm

good answer.RK, certainly at your level of sophistication is not used so much IMO in FE (this is a purely objective remark), possibly because BS is a relatively simple PDE when compared with Navier-Stokes and its specialisations. Actually, many people use Crank Nicolson !! (that's another story)
 
User avatar
sammus
Posts: 9
Joined: November 11th, 2003, 6:21 am

Finite difference - CFD technique

January 6th, 2005, 5:12 pm

How about operator splitting method? How does it sound as compared to the ones you are talking about?
Last edited by sammus on January 5th, 2005, 11:00 pm, edited 1 time in total.
 
User avatar
yomi
Posts: 2
Joined: July 14th, 2002, 3:00 am

Finite difference - CFD technique

January 6th, 2005, 5:17 pm

This might be of interest as an introduction:http://www.bama.ua.edu/~dhand001/cfd
 
User avatar
Cuchulainn
Posts: 22929
Joined: July 16th, 2004, 7:38 am

Finite difference - CFD technique

January 6th, 2005, 8:22 pm

Yomi,A nice overview. Something that user 'blade' could give ideas about.Modern stuff is IMEX schemes as well
 
User avatar
blade
Topic Author
Posts: 0
Joined: June 18th, 2002, 3:28 pm

Finite difference - CFD technique

January 7th, 2005, 8:10 am

Unfortunately I can't see that link. I get some javascript errors when I try and open it. However, if any of you guys have any questions about CFD in general then I'll be happy to try and answer them.
 
User avatar
Cuchulainn
Posts: 22929
Joined: July 16th, 2004, 7:38 am

Finite difference - CFD technique

January 7th, 2005, 8:44 am

Blade,Seeing your espertise in CFD it would be nice if you tell us which of the topics directly applicable to FE (it is a subset of what is needed for Navier-Stokes). We want to get the job done with the minimum of effort.
 
User avatar
mama
Posts: 0
Joined: April 29th, 2003, 6:40 am

Finite difference - CFD technique

January 7th, 2005, 7:02 pm

 
User avatar
sammus
Posts: 9
Joined: November 11th, 2003, 6:21 am

Finite difference - CFD technique

January 8th, 2005, 1:29 am

blade, I ran across the same thing when I tried to open the link by Mozilla Firefox. However, IE does work.
 
User avatar
mama
Posts: 0
Joined: April 29th, 2003, 6:40 am

Finite difference - CFD technique

January 8th, 2005, 12:58 pm

> However, IE does workOf course, Microsoft things work pretty well IMO
 
User avatar
blade
Topic Author
Posts: 0
Joined: June 18th, 2002, 3:28 pm

Finite difference - CFD technique

January 8th, 2005, 4:29 pm

Ok, I've opened the link on an internet explorer ....1) Your best bet to understand the Maccormack technique is part 3 of the link yomi posted http://www.bama.ua.edu/~dhand001/cfd Equations 4 and 5 show the technique. One very important thing to note is that in the predictor the space discretisation is forward, but is rearward in the corrector. I must say that the way it is written in most of this stuff online looks very complicated. Both predictor and corrector can be separated into two sub-steps, which I think makes it much easier to understand. I've got the exact scheme in my Anderson book at work. I know the gist of it, but I'll post the exact thing on monday ( Work allowing !! ) I think the MacCormack technique is good because it is fully explicit, hence easily adapted for american exercise without flailing around with SOR techniques or penalty methods, as you would have to with Crank-Nicholson. It easily can be extended to two or three dimensions ( eg for Heston models, convertible bond models ) and is second order accurate in time and space. Of course you have the time constraint, so solving for a very fine grid will take longer, but as you can see the results are pretty good on a coarse grid anyway. 2) In order to understand conservative versus non-conservative formulations look at the difference in these two wave equations du / dt + A du / dx = 0 - non conservativeand du / dt + d ( Au ) / dx = 0 - conservative If A is constant, then no problem but if A is a function of space, when we discretise the two schemes we get du /dt = - A i ( u i + 1 - u i ) / dx and du / dt = (Au i + 1 - Au i ) / dx In scheme one A is the value at point i whereas in the second conservative scheme, it is calculated at both points. With Black-Scholes and constant volatility S is different at i and i + 1, but we use the value of S at i. With large dS values this will cause some inaccuracy. Also once we start to get non-constant volatilities, interest rates, etc then the conservative formulation comes into its own. The trade-off is that the non-conservative formulation will tend to require more calculations and hence more solve time. If someone can point me to a website showing me how to write equations in latex, then I'll post the conservative formulation of Black-Scholes. 3) Everything we've seen so far has only really been finite difference. There are two other main classes of techniques used for solving pde's in engineering. Finite elements, which tend to be popular with structural analysis guys and finite volume which is by far the leading technique in CFD ( which is actually special form of finite element ) Have a look at this linkhttp://www.mie.utoronto.ca/labs/MUSSL/cfd20.pdfChapter 3, pages 9 - 16, give a good discussion as to what these techniques are and what they are used for. One point that always seems to be ignored when talking about the finite volume method, is that it doesn't necessarily assume continuity of the solution. This makes it very good for things with sharp discontinuities such as the payoff or delta of a digital option or barrier. Section 4.3 of the link (p.26) talks a little bit about shock capturing. ( Shocks are discontinuities in a fluid solution ). This is where TVD schemes and Van Leer limiters are used to produce second order accuracy with zero oscillations. Godunov schemes and approximate riemann solvers go a step further and actually solve a discontinuity analytically at each cell face, and then integrate the exact analytic solution to produce the new cell mid-point values. In finance this would probably be the equivalent of solving a digital call or put analytically between each cell, and producing a final overall discrete solution from these. These methods produce accurate results on very coarse meshes. I'm planned to have a go at a) Heston with Maccormackb) Black-Scholes et Al with Godunov schemesI'll keep you posted on my progress, however since most of my day to day work at most only involves vanilla options, it may be a while !! Please feel free to ask me any questions about what I've written. Blade
 
User avatar
Cuchulainn
Posts: 22929
Joined: July 16th, 2004, 7:38 am

Finite difference - CFD technique

January 8th, 2005, 6:12 pm

sorry to nit pick but it is Crank Nicolson, not Crank-Nicholson!!You should have a look at Meshless as well ....
 
User avatar
Cuchulainn
Posts: 22929
Joined: July 16th, 2004, 7:38 am

Finite difference - CFD technique

January 8th, 2005, 6:14 pm

I'll keep you posted on my progress, however since most of my day to day work at most only involves vanilla options, it may be a while Weekends are for exotic options
 
User avatar
sammus
Posts: 9
Joined: November 11th, 2003, 6:21 am

Finite difference - CFD technique

January 8th, 2005, 9:37 pm

Hmm it seems doable. That will be awesome if you can give us a robustness check on those schemes.
 
User avatar
yomi
Posts: 2
Joined: July 14th, 2002, 3:00 am

Finite difference - CFD technique

January 9th, 2005, 6:59 am

To help blade along the way, check the url below:http://www.geocities.com/andrei_chernou ... ecfd.htmIt has c implementation of the schemes you mentioned.
 
User avatar
Cuchulainn
Posts: 22929
Joined: July 16th, 2004, 7:38 am

Finite difference - CFD technique

January 9th, 2005, 9:56 am

An interesting 'next step' (espec. with Heston) is to determine 1) how good the approximations to the Greeks are and 2) how oscilaltions are avoided. For 1) I am thinking ofdeltagammavegaVolga? d2C/dSDsigma Alll of these can be approcximated by FDM divided differencesOne major challenge for FDM/McCormack is the aplicability to n-factor, n>= 3(in 1-factor I have shown van Leer is best followed by fitting)