2
$\begingroup$

I'm looking for a particular curve algorithm that is similar to to a bell curve/distribution, but instead of approaching zero at its ends, it stops at its length/limit. You specify the length of the curve of the curve and its maximum peak, and the plot will approach its peak at the midpoint of length(the middle) and then it curves downward to its end. As a math noob, I may not be making any sense. Here's an image of the curve I'm looking for:

my curve

$\endgroup$
6
  • 1
    $\begingroup$ Can you describe what the intended application is? $\endgroup$ May 16 '11 at 19:28
  • $\begingroup$ Sure, I'm interested in creating a curved duty cycle signal for some software that will send a signal to various electronics. Normally duty cycles use a square wave for HI/LO state over a period of time. Instead, I'd like the approach to the peak value to be curved/interpolated instead of an immediate jump(as performed in a square wave). I can make a graphic of the intended curve/signal if this explanation isn't clear. $\endgroup$
    – dhulihan
    May 16 '11 at 21:30
  • $\begingroup$ Wouldn't the crest of a sinusoid be appropriate? $\endgroup$ May 16 '11 at 23:35
  • $\begingroup$ @J.M. - As in a Crest Factor? $\endgroup$
    – dhulihan
    May 17 '11 at 1:54
  • $\begingroup$ If you plot $\sin x$, the part in the interval $[0,\pi]$ is a "crest". $\endgroup$ May 17 '11 at 2:36
4
$\begingroup$

Thanks to J.M.'s help, I was able to create the appropriate curve using sine wave and length of $\pi$(since $\pi$ is the point at which the curve approaches zero in a positive phase). I graphed this example using javascript and flot:

var d1 = [];
for (var x = 0; x < Math.PI; x += 0.1)
    d1.push([x, Math.sin(x)]);  

This means you can also adjust the length of the wave/curve by adding a multiplier to x:

var d2 = [];
var wavelength = 2
for (var x = 0; x < Math.PI; x += 0.1){
    var y =  Math.sin(x * wavelength)
        d2.push([x, y]);  
}

Here's an image of the result:

$\endgroup$
3
$\begingroup$

The curve which you are looking for is a parabola. When I plugged in the equation $$f(x) = -(x-3.9)^{2} + 4$$ I got this figure, which some what resembles what you are looking for.

enter image description here

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.