Please scroll down for the English version.
Bevezetés
Ebben a bejegyzésben egy Parciális Differenciálegyenletről (PDE) lesz szó, nevezetesen a Hőegyenlet egydimenziós verziójáról. A célunk találni egy olyan függvényt, amely megadja nekünk a pontos hőmérsékletet tetszőleges időpontban, egy egydimenziós rúd tetszőleges pontjában. Adja magát tehát, hogy egy kétváltozós függvénnyel lesz dolgunk, melynek változói a hely és az idő.
Jogos kérdés, hogy mit keres egy közgazdasági blogban egy látszólag fizikai természetű probléma. A válasz egészen egyszerű és remélhetőleg kielégítő is: pénzügyi termékek árazásakor bizonyos feltételekből kiindulva gyakran jutunk el PDE-khez.
Azonban van egy probléma a PDE-kkel: még ha meg is oldhatók, roppant nehéz megtalálni a megoldásukat. Van néhány, melyet már a múltban néhány nagy matematikus megoldott, ilyen például a Hőegyenlet is. A jó hír, hogy egészen sok PDE áttranszformálható egy – már megoldott – egyenlet alakjára, esetünkben talán az egyik legfontosabb ilyen a Black-Scholes Egyenlet.
Jelölések
\(U\) egy kétváltozós függvényt fog jelölni, \(U(x,t)\)-t, melynek argumentumai az időt \( (t) \) és a teret \( (x) \) reprezentálják.
A parciális deriváltakra a megszokottól eltérő jelölést fogunk használni: a \( \partial \) jel helyett indexeket fogunk használni a következőképpen: \[ U_x := \partial_x U =\frac{\partial U}{\partial x} \] A második deriváltakra: \[ U_{xx}:=\partial_x^2U \] \[ U_{xt}=\left(U_x\right)_t:= \partial_t (\partial_x U) \]
A Hőegyenlet fundamentális megoldása
Felírjuk a Hőegyenletet: \begin{equation} U_t=K \cdot U_{xx}=K\cdot \Delta U \label{ho}\end{equation}Oldjuk is meg! Egy egyszerű feltevéssel jócskán meg tudjuk könnyíteni a feladatunkat:
Tegyük fel, hogy \(U\) a következő alakú: \[ U=\frac{1}{t^\alpha}V \left( \frac{x}{\sqrt{t}} \right) \]
Itt \(\alpha\) egy valós paraméter, melynek értéket később állítjuk be.
Immár átírhatjuk az \( \eqref{ho}\)-es egyenletet: \[ \left( t^{-\alpha}\cdot V\left( x \cdot t^{-0.5}\right) \right)_t=K\left( t^{-\alpha}\cdot V \left( x \cdot t^{-0.5}\right) \right)_{xx} \] \[ -\alpha t^{-\alpha -1} V \left(\frac{x}{\sqrt{t}} \right)+t^{-\alpha} V^{\prime} \left(\frac{x}{\sqrt{t}} \right) x \frac{-1}{2}t^{-3/2} =Kt^{-\alpha}V^{\prime \prime} \left(\frac{x}{\sqrt{t}} \right) t^{-1/2} t^{-1/2} \]
Legyen \(y=x\cdot t^{-0.5} \) és \( V=V(y) \), persze \( V^{\prime}=\frac{dV}{dy} \).
\( t^{-\alpha-1} \)-gyel osztva a következőt kapjuk: \[ -\alpha V – \frac{x}{2\sqrt{t}} V^{\prime}-K\cdot V^{\prime \prime}=0 \] \[ KV^{\prime \prime}+\frac{y}{2}V^{\prime}+\alpha V=0 \]
\(\alpha \)-t állítsuk \(\frac{1}{2} \)-re: \[ KV^{\prime \prime}+\frac{y}{2}V^{\prime}+\frac{1}{2}V=0 \] \[ KV^{\prime \prime}+\frac{1}{2}\left( yV^{\prime}+V\right)=0 \] \[ KV^{\prime \prime}+\frac{1}{2}\left( y\cdot V\right)^{\prime} =0\] \[ \left( KV^{\prime}+\frac{1}{2}yV \right)^{\prime}=0\] \[ KV^{\prime}+\frac{1}{2}yV=C \] \[ C \in \mathbb{R} \Rightarrow C:=0 \]
Megoldhatnánk igazából tetszőleges \(C\)-re is, saját dolgunkat könnyítendő állítottuk \(C\)-t \(0\)-ra. \[ KV^{\prime}+\frac{1}{2}yV=0\] \[ \frac{V}{V^{\prime}}=\frac{-y}{2K} \] \[ \ln|V|=\frac{-y^2}{4K}+C \] \[ V=V(y)=\pm e^C \cdot e^{\frac{y^2}{4K}}=C\cdot e^{\frac{y^2}{4K}} \]
Már meg is van a megoldásunk, már csak vissza kell helyettesíteni \(y\)-ba és \(U\)-ba. \[ U(x,t)=\frac{1}{t^{1/2}}\cdot C \cdot \exp\left( \frac{-\left( \frac{x}{\sqrt{t}}\right)^2}{4K} \right)\] \begin{equation} U(x,t)=\frac{C}{\sqrt{t}} \cdot \exp \left( – \frac{x^2}{4Kt} \right) \end{equation}
Legyen \( C= \frac{1}{\sqrt{4\pi K}} \), ekkor a következőt kapjuk: \begin{equation} U(x,t)= \frac{1}{\sqrt{4 \pi Kt}} \cdot \exp \left( – \frac{x^2}{4Kt} \right) \end{equation}
Meg is volnánk: megvan a formula, mely megadja a rúd hőmérsékletét egy adott pontjában egy adott időben.
A megoldás egyértelműsége
Tegyük fel, hogy adott a Hőegyenlet a következő peremfeltételekkel: \begin{cases} U_t=K\cdot U_{xx} \\ U(0,t)=0 \qquad 0\leq x\leq\ell \\ U(\ell,t)=0 \qquad 0 \leq t \\ U(x,0)=0 \end{cases}
Be akarjuk bizonyítani, hogy ekkor \(U\) azonosan \(0\).
Ezt az úgynevezett Energia-módszerrel tudjuk megtenni: \[ \underset{A}{\underbrace{\int_{0}^{\ell}U_t \cdot U \ dx}}= \underset{B}{\underbrace{\int_{0}^{\ell} K \cdot U_{xx} \cdot U \ dx}}\]
Egyszerűen szoroztunk \(U\)-val és integráltunk \(0\)-tól \(\ell\)-ig \(x\) szerint. \begin{align*} & A: \quad U_t \cdot U=\frac{d}{dt}\left(\frac{1}{2}U^2 \right) \Rightarrow \int_{0}^{\ell}U_t \cdot U \ dx = \int_{0}^{\ell} \frac{1}{2} \frac{d}{dt}U^2 \ dx = \frac{d}{dt} \left[ \frac{1}{2} \int_{0}^{\ell} U^2 \ dx \right] \\ & B: \quad K \cdot \int_{0}^{\ell} U_{xx} \cdot U \ dx = K \cdot \left( \Big[ U_x (x,t) \cdot U(x,t) \Big]_{x=0}^{x=\ell}- \int_{0}^{\ell} U_x U_x \ dx \right) = \\ & = K \cdot \left( U_x(\ell,t)\underset{0}{\underbrace{U(\ell,t)}}-U_x(0,t)\underset{0}{\underbrace{U(0,t)}}-\int_{0}^{\ell}\left(U_x\right)^2 \ dx \right) =-K\cdot \int_{0}^{\ell}\left(U_x\right)^2 \ dx \end{align*}
\[ A=B \iff \frac{d}{dt} \underset{E(t)}{\underbrace{\left[ \frac{1}{2} \int_{0}^{\ell} U^2 \ dx \right]}} = -K \cdot \int_{0}^{\ell}\left(U_x\right)^2 \ dx \] \[E^{\prime}(t)=-K\cdot \int_{0}^{\ell}\left(U_x\right)^2 \ dx \Rightarrow E^{\prime}(t) \leq 0 \Rightarrow E(t) \leq E(0) \Rightarrow \] \[ \Rightarrow \frac{1}{2} \int_0^{\ell} \left( U(x,t) \right)^2 \ dx \leq \frac{1}{2} \int_{0}^{\ell} \left( U(x,0) \right)^2 \ dx=0 \Rightarrow 0 \leq E(t) \leq 0, \ \text{hiszen} \ U^2\geq 0. \Rightarrow \] \[ \Rightarrow \frac{1}{2} \int_{0}^{\ell} U^2 \ dx \equiv 0 \Rightarrow U(x,t) \equiv 0 \]
Most már beláthatjuk a megoldás egyértelműségét:
Tegyük fel, hogy \(U\) és \(V\) egyaránt kielégítik a következő PDE-t: \begin{equation*} (\ast) \begin{cases} U_t=K\cdot U_{xx}+f(x,t) \\ U(0,t)=g(t) \qquad 0\leq x\leq\ell \\ U(\ell,t)=h(t) \qquad 0 \leq t \\ U(x,0)=\varphi(x) \end{cases} \label{uni} \end{equation*}
Ekkor \(W:=U-V\)-nek ki kell elégítenie: \begin{cases} W_t=K\cdot W_{xx} \\ W(0,t)=0 \qquad 0\leq x\leq\ell \\ W(\ell,t)=0 \qquad 0 \leq t \\ W(x,0)=0 \end{cases} \[ \Rightarrow W \equiv 0 \Rightarrow U \equiv V \]
Tehát \( (\ast) \) megoldása egyértelmű.
Introduction
In this post we are going to discuss a partial differential equation (PDE), namely the Heat Diffusion Equation, more precisely its one dimensional version.
Our goal is to find a function, which describes the exact temperature in a one dimensional bar at any time and at any point of the bar. Given this problem, we can conclude that we are going to have to find a function of two dimensions: time and space.
A reasonable question would be, why we are talking about a problem of physics in an economic blog! The answer is rather easy and hopefully satisfactory: when pricing financial products, we often have to derive PDEs from certain assumptions.
One problem with PDEs: even if they are solvable, it’s unexpectedly difficult to find a solution for them. There are a few, which have been solved earlier by great mathematicians, one of which is the Heat Equation. The good news is that it turns out, many PDEs can be transformed into an already solved equation, in our case most importantly the Black-Scholes Equation.
Notation
Let \(U\) denote the function \( U(x, t) \), where the input variables represent time \( (t) \) and space \( (x)\).
We are going to use a special way to denote partial differentials: instead of the usual sign \( (\partial) \) we will use indices as follows: \[ U_x := \partial_x U =\frac{\partial U}{\partial x} \] For second partial derivatives we’ll use \[ U_{xx}:=\partial_x^2U \] \[ U_{xt}=\left(U_x\right)_t:= \partial_t (\partial_x U) \]
Fundamental solution of the Heat Equation
The Heat Equation: \begin{equation} U_t=K \cdot U_{xx}=K\cdot \Delta U \label{hoangol}\end{equation} Let’s solve this PDE! By an assumption we will find it less challenging to find the solution:
Let’s suppose that \( U \) has the following form: \[ U=\frac{1}{t^\alpha}V \left( \frac{x}{\sqrt{t}} \right) \]
Here \(\alpha\) is a parameter which we will set later equal to a real number.
Now we can rewrite Equation \( \eqref{hoangol}\) \[ \left( t^{-\alpha}\cdot V\left( x \cdot t^{-0.5}\right) \right)_t=K\left( t^{-\alpha}\cdot V \left( x \cdot t^{-0.5}\right) \right)_{xx} \] \[ -\alpha t^{-\alpha -1} V \left(\frac{x}{\sqrt{t}} \right)+t^{-\alpha} V^{\prime} \left(\frac{x}{\sqrt{t}} \right) x \frac{-1}{2}t^{-3/2} =Kt^{-\alpha}V^{\prime \prime} \left(\frac{x}{\sqrt{t}} \right) t^{-1/2} t^{-1/2} \]
Let \(y=x\cdot t^{-0.5} \) and \( V=V(y) \) and \( V^{\prime}=\frac{dV}{dy} \).
Dividing by \( t^{-\alpha-1} \) we have \[ -\alpha V – \frac{x}{2\sqrt{t}} V^{\prime}-K\cdot V^{\prime \prime}=0 \] \[ KV^{\prime \prime}+\frac{y}{2}V^{\prime}+\alpha V=0 \]
By setting \(\alpha=\frac{1}{2} \) \[ KV^{\prime \prime}+\frac{y}{2}V^{\prime}+\frac{1}{2}V=0 \] \[ KV^{\prime \prime}+\frac{1}{2}\left( yV^{\prime}+V\right)=0 \] \[ KV^{\prime \prime}+\frac{1}{2}\left( y\cdot V\right)^{\prime} =0\] \[ \left( KV^{\prime}+\frac{1}{2}yV \right)^{\prime}=0\] \[ KV^{\prime}+\frac{1}{2}yV=C \] \[ C \in \mathbb{R} \Rightarrow C:=0 \]
We could solve for any real number \(C\), but we are interested in only one solution, this is why for our own sake we set \(C=0.\) \[ KV^{\prime}+\frac{1}{2}yV=0\] \[ \frac{V}{V^{\prime}}=\frac{-y}{2K} \] \[ ln|V|=\frac{-y^2}{4K}+C \] \[ V=V(y)=\pm e^C \cdot e^{\frac{y^2}{4K}}=C\cdot e^{\frac{y^2}{4K}} \]
And now we have our solution for \(U\), we only need to substitute back into \(y\) and \(U.\) \[ U(x,t)=\frac{1}{t^{1/2}}\cdot C \cdot \exp\left( \frac{-\left( \frac{x}{\sqrt{t}}\right)^2}{4K} \right)\] \begin{equation} U(x,t)=\frac{C}{\sqrt{t}} \cdot \exp \left( – \frac{x^2}{4Kt} \right) \end{equation}
Setting \( C= \frac{1}{\sqrt{4\pi K}} \) we get: \begin{equation} U(x,t)= \frac{1}{\sqrt{4 \pi Kt}} \cdot \exp \left( – \frac{x^2}{4Kt} \right) \end{equation}
Now we have finished the solution, we have our formula for the temperature of a bar at any point \(x\) and time \(t\).
Uniqueness of the solution
Let’s say we have the Heat Equation with the following boundary conditions: \begin{cases} U_t=K\cdot U_{xx} \\ U(0,t)=0 \qquad 0\leq x\leq\ell \\ U(\ell,t)=0 \qquad 0 \leq t \\ U(x,0)=0 \end{cases}
We would like to prove that the only solution is \(U \equiv 0\).
For this proof we will use the so-called Energy Method. \[ \underset{A}{\underbrace{\int_{0}^{\ell}U_t \cdot U \ dx}}= \underset{B}{\underbrace{\int_{0}^{\ell} K \cdot U_{xx} \cdot U \ dx}}\]
All we did is multiply by \(U\) and integrate from \(0\) to \(\ell\). \begin{align*} & A: \quad U_t \cdot U=\frac{d}{dt}\left(\frac{1}{2}U^2 \right) \Rightarrow \int_{0}^{\ell}U_t \cdot U \ dx = \int_{0}^{\ell} \frac{1}{2} \frac{d}{dt}U^2 \ dx = \frac{d}{dt} \left[ \frac{1}{2} \int_{0}^{\ell} U^2 \ dx \right] \\ & B: \quad K \cdot \int_{0}^{\ell} U_{xx} \cdot U \ dx = K \cdot \left( \Big[ U_x (x,t) \cdot U(x,t) \Big]_{x=0}^{x=\ell}- \int_{0}^{\ell} U_x U_x \ dx \right) = \\ & = K \cdot \left( U_x(\ell,t)\underset{0}{\underbrace{U(\ell,t)}}-U_x(0,t)\underset{0}{\underbrace{U(0,t)}}-\int_{0}^{\ell}\left(U_x\right)^2 \ dx \right) =-K\cdot \int_{0}^{\ell}\left(U_x\right)^2 \ dx \end{align*}
\[ A=B \iff \frac{d}{dt} \underset{E(t)}{\underbrace{\left[ \frac{1}{2} \int_{0}^{\ell} U^2 \ dx \right]}} = -K \cdot \int_{0}^{\ell}\left(U_x\right)^2 \ dx \] \[E^{\prime}(t)=-K\cdot \int_{0}^{\ell}\left(U_x\right)^2 \ dx \Rightarrow E^{\prime}(t) \leq 0 \Rightarrow E(t) \leq E(0) \Rightarrow \] \[ \Rightarrow \frac{1}{2} \int_0^{\ell} \left( U(x,t) \right)^2 \ dx \leq \frac{1}{2} \int_{0}^{\ell} \left( U(x,0) \right)^2 \ dx=0 \Rightarrow 0 \leq E(t) \leq 0, \ \text{since} \ U^2\geq 0. \Rightarrow \] \[ \Rightarrow \frac{1}{2} \int_{0}^{\ell} U^2 \ dx \equiv 0 \Rightarrow U(x,t) \equiv 0 \]
Now we can prove the uniqueness of solution for the Heat Equation.
Let’s assume that \(U\) and \(V\) both satisfy the following PDE: \begin{equation*} (\ast) \begin{cases} U_t=K\cdot U_{xx}+f(x,t) \\ U(0,t)=g(t) \qquad 0\leq x\leq\ell \\ U(\ell,t)=h(t) \qquad 0 \leq t \\ U(x,0)=\varphi(x) \end{cases} \end{equation*}
Then \(W:=U-V\) must solve: \begin{cases} W_t=K\cdot W_{xx} \\ W(0,t)=0 \qquad 0\leq x\leq\ell \\ W(\ell,t)=0 \qquad 0 \leq t \\ W(x,0)=0 \end{cases} \[ \Rightarrow W \equiv 0 \Rightarrow U \equiv V \]
Therefore there is only one unique solution of \( (\ast) \).