>From what I remember, the problem with using finite volume methods to solve >the Black Scholes equation is that the equation is not in conservative form. >To get around this I think people use a change of variable $S=e^u$ to remove >the S^2 and the S terms , and solve the transformed equation, and change back >after?
I recall some papers, some 10 years ago, by Zvan that solved Black Scholes using finite volume. A google search on Zvan finite volume lists a few relevant papers, if anyone is interested. Hope this helps. Glenn ________________________________________ From: [email protected] [[email protected]] On Behalf Of Jonathan Guyer [[email protected]] Sent: Friday, 11 February 2011 2:13 AM To: Multiple recipients of list Subject: Re: PROBLEM IMPLEMENTING BLACK SCHOLES IN FIPY On Feb 9, 2011, at 6:54 PM, Jorge Espinosa wrote: > Hi, im writting my thesis about options and i need to solve numerically a > couple > of non linear black scholes equations, im trying to do it with Fipy, first i > tried with the simplest black scholes equation but the numerical solution is > significant different from analytical. > > Can anyone help me please? > eqX = TransientTerm() + VanLeerConvectionTerm(coeff=c) + > ImplicitDiffusionTerm(coeff=D)-ST I know nothing about Black-Scholes other than what I read on Wikipedia, but what you've written here doesn't correspond with the general PDE at http://en.wikipedia.org/wiki/Black–Scholes. For instance, the coefficients of the convection and diffusion terms depend both on the "spatial" variable S and on the parameter \sigma, but your expression here does not (but your analytical expressions do depend on \sigma). I have some guesses about what might be going wrong, but it would be helpful to know in math (TeX) what equation are you trying to solve. P.S. > x = mesh.getFaceCenters()[0] > > FinCond=x-K*ones(len(x)) > for i in range(len(x)): > if FinCond[i]<0.0: > FinCond[i]=0.0 > > for i in range(len(phi)): > phi[i]=FinCond[i] This is much more efficiently expressed as: x, = mesh.getCellCenters() phi.setValue((x - K) * (x > K)) > Dr Glenn Fulford +61 7 313 85196 QUT Mathematical Sciences, GPO Box 2343 Brisbane, Qld AUSTRALIA 4001. Cricos no. 00213J email: [email protected]; [email protected] calender: http://www.google.com/calendar/embed?src=glenn.fulford%40gmail.com&ctz=Australia/Brisbane&mode=WEEK skype: glenn.fulford msgr chat: [email protected]
