2

How do you model a sine wave that begins to shift over asymmetrically (like a ocean swell approaching a beach)? Is sine even the right function for this model, or is some other type of function better?

thecat
  • 1,838
  • I think it would depend on the level of detail you're modeling and what you want to do with the model. A first approximation of the effect of the beach would just be to increase the amplitude and decrease the period of the wave, which I wouldn't describe as asymmetrical but rather as aperiodic. – David K May 10 '16 at 18:38
  • I'm pretty sure he wants a smooth curve which is steeper on one side of the apex than the other. I got here because I'm trying to work out a suitable range formula for weapons which have an 'ideal' range below which their accuracy drops rapidly, and above which the accuracy drops more slowly. – PeteB May 11 '16 at 03:40

2 Answers2

2

Perhaps you could try something like

$$f(x) = - (1 + e^{-cx}) \arctan \left( \frac{\sin(x)}{1 + e^{-cx} - \cos(x)} \right) $$

where $c > 0$.

Robert Israel
  • 448,999
  • Wow! However you came up with that, it's right on the mark. – thecat May 11 '16 at 00:15
  • yes, this looks like what I needed... here's an online grapher tool with that equation (c = 0.5): http://fooplot.com/#W3sidHlwZSI6MCwiZXEiOiItKDErZV4oLTAuNSp4KSkqYXRhbihzaW4oeCkvKDErZV4oLTAuNSp4KS1jb3MoeCkpKSIsImNvbG9yIjoiIzAwMDAwMCJ9LHsidHlwZSI6MTAwMCwid2luZG93IjpbIjAiLCIxMCIsIi0wIiwiMiJdfV0- – PeteB May 11 '16 at 03:46
  • how can I scale this to max at 1.0 (it currently climbs a little beyond 1.0)? http://fooplot.com/#W3sidHlwZSI6MCwiZXEiOiItKDErZV4oLTAuMSp4KSkqYXRhbihzaW4oeCtwaSkvKDErZV4oLTAuMSp4KStjb3MoeCtwaSkpKSIsImNvbG9yIjoiIzAwMDAwMCJ9LHsidHlwZSI6MTAwMCwid2luZG93IjpbIjAiLCJwaSIsIi0wIiwiMiJdfV0- – PeteB May 11 '16 at 03:53
  • that link was from the browser but I just noticed there's a "permalink" button on the page (I tried to edit prior comment but can't after 5 minutes)... this one should be permanent: http://fooplot.com/plot/6wqxru2cxq – PeteB May 11 '16 at 04:01
0

It's hard to tell exactly what you're asking, but you can try something like $ \frac{10}{\sqrt{x}}\sin(2\pi x)$, which starts with high amplitude then decreases. Or you could do the same thing with frequency, with $ \sin(2\pi \frac{10}{\sqrt{x}})$, which starts with a high frequency then slows down.

a52
  • 351
  • Perhaps "asymmetrical" is vague. What I am actually looking for is a robust version of the following flawed model: $(e^(sin(asin(-x)-x)))(sin(asin(-x)-x))(1+.1a)$ where the wave "steepens" as "a" increases from zero. – thecat May 10 '16 at 18:55
  • Sorry for the bad formatting, I am just learning. The first sin(asin(-x)-x) is all in the exponent above the e, however the second one is a factor rather than exponent. The 1+.1a is also a factor. @a52 – thecat May 10 '16 at 18:59
  • I see. I see what you want to do, but I don't know how to implement it myself. I've put that equation in the OP so other users can see what you are trying to do. – a52 May 10 '16 at 19:52