Português

🔥 Heat Equation Lab, from diffusion to Black-Scholes

Pick a payoff, drag time to expiry and watch the heat equation price the option in front of you. The green line is the closed-form Black-Scholes value, there so you can check that diffusion lands on the same number.

Payoff
Time 0.00 y
Volatility 30%
Show
S / K
1.00
Price
Delta Δ
Gamma Γ
payoff at expiry (τ = 0) PDE solution now closed-form Black-Scholes

Hover over the chart to read price, delta and gamma at any point.

What you are looking at

The Black-Scholes equation looks like one thing and the heat equation looks like another. A change of variables shows they are the same equation. With zero interest rates, writing the price in log-moneyness z = ln(S/K) − ½σ²τ, where τ = Tt is the time remaining to expiry, everything collapses into this.

∂u/∂τ = ½ σ² · ∂²u/∂z²

Pure heat. And the initial condition of that diffusion is the payoff at expiry. Pricing an option is taking the payoff and letting it diffuse backwards in time. The more time remains, the more the profile spreads out and the smoother it gets.

This page actually solves the PDE, by finite differences, in your browser, on a 601 point grid with an explicit scheme. The green line is the closed-form Black-Scholes value computed independently. They agree because they are the same mathematics reached by two routes.

Want the algebra behind this? The full change of variables is written out step by step, including the case with non-zero interest rates. It is in Portuguese, and the equations read in any language. Read the derivation

The melting kink is your optionality

At expiry the call has a kink at S = K, where delta jumps from 0 to 1 at once and gamma is a point mass at infinity. Drag time backwards and watch the kink melt into a smooth curve. That smoothing is the time value of the option. The vertical gap between the blue curve and the gold one is exactly what you pay for not yet knowing what will happen.

Why digitals are a nightmare near expiry

Switch the payoff to Digital and take time close to zero. The profile becomes a step and delta blows up. Paying 1 if S > K and nothing otherwise forces the hedge to buy and sell enormous quantities around the strike. Far from expiry, diffusion turns that step into a well-behaved sigmoid. This is why no desk enjoys carrying a large digital with two days left.

The butterfly is the probability density

Pick Butterfly. The payoff is a narrow triangle around the middle strike, close to an indicator for "the price finishes here". The value of that structure, divided by its width, is approximately the risk-neutral density at that point. This is the Breeden-Litzenberger result, that the options market quotes the entire distribution of the asset without ever saying so out loud. Watch the triangle turn into a bell as time increases, and that bell is the lognormal of the model.

High frequencies die first

In Draw mode, make a profile full of fine ripples and then advance time. Short waves vanish almost immediately while wide ones persist. The reason is that the frequency mode k decays like e−σ²k²τ/2, with the square in the exponent. Diffusion is a low-pass filter, and that is why the price of a long-dated option is nearly insensitive to the fine detail of its payoff.

Try this. Set volatility to 10%, time to 1.2 years, and look at the call. Now raise vol to 80% without touching time. The price rises everywhere and the curve almost reaches the diagonal, because with enough vol an option is worth nearly the asset itself. Notice that only the product σ²τ matters. Vol of 20% over 4 years gives exactly the same curve as vol of 40% over 1 year. What drives it is total variance, not time or vol on their own.

Both simulators on this site are open source, MIT licensed, together with the Python scripts that verify the numbers against closed-form solutions.

View the repository →