1
$\begingroup$

$\newcommand{\expq}[1]{{e^{#1}}}$ $\newcommand{\integral}[4]{\int_{#2}^{#3} {#4} \,d{#1}}$ $\newcommand{\dd}[2]{\frac{d #1}{d #2}}$ $\newcommand{\loss}{L}$ Suppose we want to draw the function $\expq{-kt}$ between 0 and $x$ by approximating it with a polygon. What we want to do is to repeatedly subdivide each section of the function into with a vertex at some point that minimizes the area between the approximation and the true value. The subdivision point we are looking for is $(m, \expq{-km})$ where $0

The loss is the absolute difference of the true value with the polygonal approximation. Since the true value is always below the polygon, the first part of this loss is: \begin{align} f(k, m) &= \integral{t}{0}{m}{1 + \frac{\expq{-km}-1}{m}t - \expq{-kt}} \\ &= m + \frac{\expq{-km}-1}{2m}m^2 - \frac{\expq{-km}-1}{-k} \\ &= m + \frac{\expq{-km}-1}{2}m + \frac{\expq{-km}-1}{k} \\ &= \frac12 m\expq{-km} + \frac1k \expq{-km} + \frac{m}{2} - \frac{1}{k}. \end{align}

The second part is \begin{align} \expq{-km}f(k, x-m) &= \expq{-km}\left(\frac12 (x-m)\expq{-k(x-m)} + \frac1k \expq{-k(x-m)} + \frac{x-m}{2} - \frac{1}{k}\right) \\ &= \frac12 (x-m)\expq{-kx-2km} + \frac1k \expq{-kx-2km} + \frac{x-m}{2}\expq{-km} - \frac{\expq{-km}}{k}. \end{align} The loss is the sum of these terms: \begin{align} \loss &= \frac12 m\expq{-km} + \frac1k \expq{-km} + \frac{m}{2} - \frac{1}{k} + \frac12 (x-m)\expq{-kx-2km} + \frac1k \expq{-kx-2km} + \frac{x-m}{2}\expq{-km} - \frac{\expq{-km}}{k} \\ &= \frac{m}{2} - \frac{1}{k} - \frac{m}2 \expq{-kx-2km} + \left(\frac1k+\frac{x}{2}\right) \expq{-kx-2km} + \frac{x}{2}\expq{-km}. \end{align}

Then \begin{align} 0 &= \dd{\loss}{m} \\ &= \frac{1}{2} - \frac{1}2 \expq{-kx-2km} - \frac{-2km}2 \expq{-kx-2km} -2k\left(\frac1k+\frac{x}{2}\right) \expq{-kx-2km} - \frac{kx}{2}\expq{-km} \\ &\Downarrow \notag \\ &= 1 - \expq{-kx-2km} + 2km \expq{-kx-2km} - 4k\left(\frac1k+\frac{x}{2}\right) \expq{-kx-2km} - {kx}\expq{-km} \\ &= 1 - 5\expq{-kx-2km} + 2km \expq{-kx-2km} - {2kx} \expq{-kx-2km} - {kx}\expq{-km}. \end{align}

I'm having trouble minimizing this w.r.t. $m$. Intuitively, $m = xg(kx)$ where $g$ is some unknown function.

1 Answers 1

2

To implement this minimization at each successive subdivision in a way that generalizes well, it is better to consider the case where we wish to minimize the difference of areas on a general interval $[a,b]$ rather than $[0,x]$. This allows us to consider subdivisions on intervals not beginning at $0$. To this end, let $a < m < b$, and we note that this area difference is given by $$A(m;a,b,k) = \frac{m-a}{2}(e^{-ka} + e^{-km}) + \frac{b-m}{2}(e^{-km} + e^{-kb}) - \int_{x=a}^b e^{-kx} \, dx.$$ This is because the polygonal area is the sum of two trapezoids. The next observation to make is that the area under the curve is independent of the choice of $m$: hence the $m$ that minimizes $A$ is the $m$ that minimizes the polygonal area itself. Differentiating gives $$\begin{align*} \frac{dA}{dm} &= \frac{1}{2} \left( e^{-ka} + e^{-km} - k(m-a) e^{-km} - (e^{-km} + e^{-kb}) - k(b-m)e^{-km} \right) \\ &= \frac{1}{2} \left(e^{-ka} - e^{-kb} + k(a-b) e^{-km} \right).\end{align*}$$ Thus $A$ is minimized at a critical point satisfying $dA/dm = 0$, or $$m = -\frac{1}{k} \log \frac{e^{-ka} - e^{-kb}}{k(b-a)}.$$ It is not difficult to check that this is a minimum. Using this, we can perform successive subdivisions on $[0,x]$. For example, with the choice $k = 1$, $x = 10$, after $5$ successive subdivisions we obtain the partition $$\{0, 0.102581, 0.208793, 0.318899, 0.4332, 0.551977, 0.67565, 0.804632, \\ 0.939408, 1.07969, 1.22686, 1.3816, 1.54475, 1.71706, 1.89987, 2.0945, \\ 2.30263, 2.49421, 2.69887, 2.91843, 3.15533, 3.41144, 3.69146, 4.00003, \\ 4.34396, 4.69367, 5.08949, 5.54427, 6.08019, 6.69443, 7.46628, 8.47866, 10 \}.$$

  • 0
    "The next observation to make is that the area under the curve is **independent** of the choice of $m$" — What a great observation!!2017-01-25
  • 0
    Although, I think you'll find that your solution is independent of $a$ and $b$ given $b-a$ and $e^{-ka}$. $a$ is just a translation and $e^{-ka}$ is just a scale, so they can be ignored.2017-01-25