1

In a typical $\cos(x)$ or $\sin(x)$ function, each successive crest or trough is equidistant from the next.

How can I represent a function where as $x$ increases, the next crest or trough may not be equidistant (slightly more or less than what it should)?

I want to plot this on a graph, so I would prefer it if it is the form $y=\cos(x)$ or something else easy to calculate when I feed it into the computer.

EDIT: Is it possible for this the crests to neither get closer or further as $x$ tends to infinity? (the distance between crests and trough should keep varying, but neither get successively closer or further).

flonk
  • 2,434
  • 1
    Try $y=\cos(f(x))$, where $f(x)$ is an increasing function. – David Mitra Feb 20 '14 at 13:14
  • You need to choose an argument whose derivative w.r.t. $x$ is not constant, that is, $y = \cos(f(x))$, where $f'(x) \neq c$, with $c$ some constant. An linearly frequency modulated signal is a common example: $y = \cos( \pi\gamma x^2 )$, then the frequency is given by $2\pi\gamma x$, which is a linear function of $x$. – AnonSubmitter85 Feb 20 '14 at 13:20
  • @DavidMitra Do you mean $f'(x)$ is increasing? Because $f(x) = 2\pi f x$ is an increasing function of $x$ but will give constant crest/trough distances. – AnonSubmitter85 Feb 20 '14 at 13:22
  • For a wavelength difference that varies periodically, try something like $y = \sin(10x + \sin(x))$ – r3mainer Feb 20 '14 at 13:26
  • You could try $f(x)=\cos (k\ln(x))$ or if you want a little variability $f(x)=\cos(x+k\sin(x))$ – Mark Bennet Feb 20 '14 at 13:29
  • The answer below from @flonk gives a good example. In general, I'd mention that you can make the spacing of $y=\cos(f(x))$ do (almost) whatever you want by first defining $f'(x)$ and then integrating to get $f(x)$. In this case, you want an oscillating frequency, so $f'(x)= \gamma + \beta \cos(\alpha x)$, then $f(x) = \int f'(x) = \gamma x + \beta/\alpha \sin( \alpha x)$. – AnonSubmitter85 Feb 20 '14 at 14:04

3 Answers3

4

In this example, every two maxima have a unique distance, but the average distance stays constant:

$$f(x)=\cos(g_\epsilon (x)), \qquad g_\epsilon (x)=x+\epsilon \sin(\sqrt{2}\cdot x), \qquad \epsilon=0.4$$

Edit: To understand the idea, first draw the unperturbed inner function $g_0(x)=x$ on a sheet of paper. Whenever this diagonal line crosses the equidistant lines $y=n\pi$, the $\cos(\cdot)$ has a maximum. If we perturb $g_0$ by the small $\sin(\cdot)$-term, it will never be in sync with the lines $y=n\pi$, due to the irrational frequency $\sqrt{2}$. So that should be exactly what you want.

enter image description here

flonk
  • 2,434
1

For the function $f:(0,\infty) \rightarrow \Bbb R$ ,$f(x)=sin(1/x)$ the successive minimas and maximas keep on going far apart.

  • The last maximum is at $\frac 2 {\pi}$ – Mark Bennet Feb 20 '14 at 13:20
  • Changed it ,they keep coming closer as we go back on the real line. – viplov_jain Feb 20 '14 at 13:23
  • 1
    I would suggest the variation $$\cos\left(\frac1{x^2+\frac1{2\pi}}\right)$$ and friends to remove the singularity. But anyways, I think that @DavidMitra's suggestion is a little closer to what the op want's( slightly more or less than it should do) so that you can fine-tune your crests and they don't run to infinity. – chubakueno Feb 20 '14 at 13:35
1

The instantaneous period (what you call the "trough spacing") at $x$ is the reciprocal of the cyclic frequency at $x$. The frequency of $y = \cos( f(x) )$ is defined to be $f'(x)/(2\pi)$, so all you need to do is choose $f(x)$ such that $f'(x)$ is not a constant. A common example would be

$$ y = \cos( \pi \gamma x^2), $$

such that $f'(x) = 2\pi \gamma x$. The instantaneous period at any point $x$ is then give by $1/(\gamma x)$, which will be closer and closer as $x$ becomes larger.