Deviation of numerical approximation of $\alpha(u) = \frac{1}{L}\frac{{\rm d} L}{{\rm d}u}$

23 Views Asked by At

Description of the problem

I have this equation: $$\alpha(u) = \frac{1}{L}\frac{{\rm d} L}{{\rm d}u}\,,$$

The solution is: $$L_1 = L_0\exp{\left[ \int_{T_0}^{T_1} \alpha(u)\,{\rm d}u\right]}\,.$$

I know $\alpha$, in fact, I can assume for now that it is a linear function given by $\alpha(u)=a*u$. Further, $u$ is a periodic function (of time) $u(t)$. I only know $u$ at certain points $t_i$. In the end, I want to find the integral:

$$L_i = L_0 \exp{\left[\int_{u_0}^{u_i}\alpha(u)\,{\rm d}u\right]}\,,\forall i\,,$$

where $u_i$ denotes $u(t_i)$.

Now, as an approximative approach, I could also do (let's say, I do not want to do this exactly because the computation of the integral is too time consuming and also in the end $\alpha(u)$ is a bit more complicated than just a linear function): $$\Delta L = L \alpha(u) \Delta u\,,$$

assuming that $\alpha(u)$ is constant during $\Delta u$. This leads to a scheme: $$t_{k}:\, \Delta L_{k} = L_{k-1} \,\alpha_{k}\,\Delta u_{k}\,,\\ t_{k}:\, L_{k} = L_{k-1} + \Delta L_{k} \\ = L_{k-1}\left( 1+ \alpha_{k+1}\,\Delta u_{k} \right) $$

where $\alpha_{k} \equiv \alpha( u(t_{k}) )$ and $\Delta u_{k} \equiv u(t_{k})-u(t_{k-1})$. This reciprocal expression leads to:

$$t_{k}:\, L_{k} = L_0 \prod_{m=1}^k (1+\alpha_{k}\,\Delta u_{k})\,,\forall k\ge 1\,.$$

For some reason this approximation is failing and I cannot figure out why.

To provide a numerical example, let $\alpha(u) = \frac{8\times10^{-6}}{300} u$ and let $u(t) = 270 + 80 \cos{(\frac{2 \pi}{10} 8t)}$. Because $u$ is periodic, then I should see $L_i$ also oscillating around $L_0$. While, I get this result for the exact integral expression, for this approximation, I get $L_{i}$ oscillation about a monotonically increasing line. The line's slope is connected to the slope of $\alpha$ in the sense if I invert the slope of $\alpha$, I get $L_i$ oscillating about monotonically decreasing line.

Illustration:

visual comparison

The Question

The problem is probably related to the sampling of the time interval. So I wonder, is there any better approach to the approximation (assuming the one is correct in the first place) - increasing the sampling density can be done only to a certain level as this is a numerical approach. And, why does the deviation follow the slope of $\alpha$?

Subquestion: - Note that even for the integral solution, the oscillation is not about $L_0$ (in the case of the illustration, about 1) which is also strange.

Supplement

The Mathematica code to construct the solutions is (I am using here $temp$ or $T$ instead of $u$):

temp[t_] := 270 + 80*Cos[(2 \[Pi])/10 8 t];
\[Alpha][T_] := 8/300*10^-6 T;
time = Table[i, {i, 0, 100, 0.01}];
tempval = temp /@ time;
dtemp = Differences@tempval;
\[Alpha]temp = \[Alpha] /@ Rest@tempval;
\[Delta]x = \[Alpha]temp*dtemp;
\[Delta] = 1 + \[Delta]x;
\[CapitalDelta] = FoldList[Times, \[Delta]];
len = Exp[
      Integrate[\[Alpha][T], {T, temp[time[[1]]], 
        temp[time[[#]]]}]] & /@ 
    Range[1, Length@time]; // AbsoluteTiming
i\[Alpha]0 = i\[Alpha][temp[time[[1]]]];