This is what the target function looks like:
Properties
From very far away, this function looks somwhat similar to a Gaussian bell curve in that it features one maximum and falls off symmetrically to both sides. But it has a few properties, that make it very useful in constructing mathematical models. Most importantly, and this is the main difference from the Gaussian curve, the function reaches 0 on both sides of the bell. More specifically, it has:- a value of 0 for x ≤ -0.5.
- a value of 0 for x ≥ 0.5.
- a maximum at x = 0 with a value of 1.
- an inflection point at x = -0.25.
- an inflection point at x = 0.25.
Solution
Disclaimer: I'm a proponent of τ (= 2 π), so I will use it in my definitions.
The basis for my suggestion is the cosine function with some modifications to stretch it into the target area and a cut-off to the left and right as to break the periodic behaviour. In Mathematica terms, it can be defined as follows:
Extensions
1. Amplitude
It can easily be scaled to reach any amplitude at the maximum by multiplying it with that maximum value like this:In the simple version this parameter effectively defaults to 1. Here are two examples for a = 1.8 and a = -2.5 respectively:
2. Width
It is also possible to widen or narrow the curve using a width argument. The width is given between the two points where the bell curve reaches zero and defaults to 1 in the simple version:Here are two examples for w = 4.8 and w = 0.6, respectively:
3. Offset
To move the function to the left or right, you can use an offset argument. The value of the offset specifies the position of the maximum and therefore defaults to 0 in the simple version.Here are two examples for o = -2 and o = 0.2, respectively:
General Combination
Of course, the three extensions mentioned above are orthogonal and can be combined any way you like. This is the definition of the general function supporting all three ways to modify the bell curve:Here are two examples. One has an amplitude of 0.1, a width of 6 and an offset of 1.5. The other one has an amplitude of -1.2, a width of 0.4 and an offset of -0.8.
No comments:
Post a Comment