Skip to content
All library documents

Boundary Conditions for Finite-Difference Black–Scholes Call Pricing

Article Quant Q&A · Author: rawsh

Summary

The document discusses numerical solution of the Black–Scholes partial differential equation for a European call using finite differences. The original question describes an inaccurate left edge in the computed price curve and asks which boundary conditions would correct it. A response gives simple boundary-condition guidance for calls and puts, with the payoff at maturity as the terminal condition. It also notes that reversing time and changing variables to the logarithm of the underlying can transform the equation into a heat-equation form.

A follow-up reports that the main error came from using a forward derivative at the left boundary. The suggested practical approach is to keep the left-side value near zero through padding, use suitable boundary conditions, and use a Neumann condition or one-sided backward derivative at the right edge. The material offers implementation advice but does not provide a full derivation, error analysis, or a complete specification of the boundary formulas.

Key ideas

  • A European option’s terminal condition is its payoff at maturity.
  • Finite-difference Black–Scholes solutions need boundary conditions at both ends of the underlying-price grid.
  • A forward derivative at the left edge can produce an inaccurate call-price curve.
  • A logarithmic change of the underlying variable can convert Black–Scholes into a heat-equation form.

Tags

Full text
# Black Scholes PDE boundary conditions


# Black Scholes PDE boundary conditions












So I'm trying to solve the black scholes equation using a finite difference model, but I'm getting a answer that's off and I'm having trouble understanding why.

This is the result for a option with K = 100.0, r = 0.12, and sigma = 0.10

The left side is higher than it should be, and should start flat, but the right side is fairly close. This is the equation I'm solving:

$$ - \frac{\partial}{\partial t} V(t,s) + r\ s\ \frac{\partial}{\partial s} V(t,s) + \frac{1}{2}\ \sigma^2\ s^2\ \frac{\partial^2}{\partial s^2} V(t,s) - r\ V(t,s) = 0 $$

Here is a graph comparing the solution to a graph of values from the discretized formula, blue line is the correct values, and the yellow line is what I'm getting. This is at expiration with t=1

```
def euro_call_sym(S, K, T, r, sigma):
    N = Normal('x', 0.0, 1.0)
    d1 = (sympy.ln(S / K) + (r + 0.5 * sigma ** 2) * T) / (sigma * sympy.sqrt(T))
    d2 = (sympy.ln(S / K) + (r - 0.5 * sigma ** 2) * T) / (sigma * sympy.sqrt(T))

    call = (S * cdf(N)(d1) - K * sympy.exp(-r * T) * cdf(N)(d2))
    return call
```

To generate my result I'm not using any boundary conditions, with one sided left derivatives on one point on the right edge and centered derivatives on the rest.

Does anyone know what boundary conditions would fix the behavior on the left side of the graph?

## Answer by Magic is in the chain (score 2)

https://quant.stackexchange.com/a/53974

Not sure if the problem is down to boundary conditions - could be a lot of other things, but the boundary conditions in the simplest form for call options are:





For put option, the equivalent boundary conditions are:





The initial condition for each is just the option payoff at maturity.

As an aside, you can also reverse time, and in this case it is also easy to get rid of the variable coefficient by setting $x=\ln S$, and one can then transform the equation to the heat equation, which is relatively easy to handle with finite difference.

## Answer by rawsh (score 0)

https://quant.stackexchange.com/a/54103

I fixed this later, the issue was the forward derivative I was using on the left. For other people trying to do something similar, the key to success for me was the following:

- neumann boundary condition on the right (or a one sided backward derivative on a single point)

- pad the left side so that V starts at 0

- boundary conditions from Magic's answer

Here are my results (K=100, r=12%, sigma=10%)

Shown in full with attribution under the source's licence. Licence: CC BY-SA 4.0 (Stack Exchange)

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.