I encountered the following question in my studies: Let $f:\mathbb{R} \rightarrow \mathbb{R}$ be a [Bohr almost periodic function](https://en.wikipedia.org/wiki/Almost_periodic_function#Uniform_or_Bohr_or_Bochner_almost_periodic_functions) such that $\inf\_{\mathbb{R}} f = 0$ but $f(x) > 0$ for all $x\in \mathbb{R}$. An example is
$$ f(x) = 2-\sin(2\pi x) - \sin(2\pi \sqrt{2}x).$$
If $\eta(\cdot)$ is the solution to the following ODE 
$$ \dot{\eta}(s) = f(\eta(s)), \qquad \eta(0) = 0.$$
Is there any tools that allow us to say something about the limit
$$ \lim\_{s\rightarrow +\infty} \frac{\eta(s)}{s}$$
and if the limit exists (I guess, by numerical implementations) can we say anything about the rate of convergence of $\frac{\eta(s)}{s}$ to that limit?



Long time average of solution to ODE with almost periodic structure
For the funciton you gave, the limit is 0, but my proof below only gives convergence as $1/\log s$. If $f=2-\sin(2\pi x)-\sin(2\pi Lx)$ where $L$ is Louiville's constant (or some appropriately chosen irrational number well-approximable by rationals), it's possible the convergence will be much faster if $f$ is close to $0$ frequently. Thus things depend delicately on approximation properties of ratios of the periods. Also, if we take $f=3-\sin(2\pi x)-\sin(2\pi\sqrt{2} x)-\sin(2\pi\sqrt{3} x)$, the proof below fails, so general behavior is unclear.


Proof:


By the [equidistribution theorem](https://en.wikipedia.org/wiki/Equidistribution_theorem), we have that multiples of $\sqrt{2}$ mod $1$ are equidistributed in the interval $[0,1]$. Thus if we take the interval $[0,N]$, then letting $$A\_\epsilon=\left\{x\in [0,N]\,\bigg\vert\,\epsilon/2<x-\lfloor x\rfloor-\frac{1}{4}<\epsilon, \epsilon/2<\frac{x}{\sqrt{2}}-\left\lfloor \frac{x}{\sqrt{2}}\right\rfloor-\frac{1}{4}<\epsilon\right\}$$
we have that the measure of $A\_\epsilon$ is $|A\_\epsilon|=\theta(\epsilon^2N)$ (here we are thinking of $\epsilon$ as fixed and taking $N\to\infty$. On the set $A$, the we have $f=\theta(\epsilon^2)$, so the time required to traverse $A\_\epsilon$ is $\theta(N)$. Then, since the sets $A\_{1/2^j}$ are disjoint, the total time to traverse the interval $[0,N]$ is at least
$$
\sum\_{j=1}^a A\_{1/2^j}\ge aN
$$
where we can take $a\to\infty$ as $N\to\infty$. Actually, I believe we can take $a=\theta(\log N)$, which would give convergence rate $1/\log s$, but that would require using quantitative bounds on how fast equidistribution happens and I haven't worked it our carefully.


