Take the 2-minute tour ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

sorry if this is a fool question but i use math mainly for playing and i'm not a math guru.

i want to understand how get a camel hump with trigonometry, with some parameters. changing parameters i would like to set one hump more higher than the other.

enter image description here

i have tried with wolfram alpha some plot but haven't find a good function.. some advice?

and how to get the min, the max and the period? (without wolfram i mean ;)

share|improve this question

2 Answers 2

You may be better off without using trig. For a function having bumps near $a,b$ with their heights controlled by $k1,k2$, I found that $$f(x)=\frac{k1(x-a)^2+k2(x-b)^2}{x^4+1}$$ works well. For my test case I used values of $a,b$ which were negatives of each other, which you can do by using the average of where you want the bumps, and shifting the inputs. And the larger value of $k1,k2$ went with the shorter hump.

When one puts this function into a derivative formula in order to find the exact location of local maxes, one has to solve a fifth degree equation to get the $x$ coordinates where the maxes actually occur. Seems these are only "near" the points $a,b$ used in making up the function. And of course this function is not periodic, since it dies off away from zero.

If you want a trig version, it looks like you can use $$f(x)=a \sin^2{x}+b \sin^2{2x}+c \sin^2{4x}-2a/\pi$$ but only graph it from $0$ to $\pi/2$. Outside that range it gets wierd, not looking like a double hump. For this one I don't know how to fiddle around with $a,b,c$ to control the hump sizes, but at least in the few cases I tried I got humps of different sizes.

share|improve this answer

I agree with coffeemath; I would recommend not using trig functions. You aren't exactly asking for a curve that is periodic; any trig function will be periodic.

I would try two bell curves, summed together. A bell curve is essentially zero not too far from it's peak, so each bump would maintain itself after summing them together.

$$A_1e^{-k_1(x-b_1)^2}+A_2e^{-k_2(x-b_2)^2}$$

where $A_i$ is the height of bump $i$, $\sqrt{k_i}$ is a measure of how wide bump $i$ is, and $b_i$ is the $x$-value of the center of bump $i$.

If this produces bumps that are too pointy, you can raise the power of the binomial in the exponent to flatten it out. You need to put absolute value around that binomial though.

$$A_1e^{-k_1|x-b_1|^{2.5}}+A_2e^{-k_2|x-b_2|^{2.5}}$$

share|improve this answer
    
Looks like here also (as in mine) one doesn't have exact control over where the bumps end up, in terms of $b_1,b_2$. I think when the two curves get added, their "bump locations" get shifted a bit. –  coffeemath Nov 5 '12 at 19:22
    
@coffeemath Yep, but I think in both cases that the aberration will be very small. –  alex.jordan Nov 5 '12 at 19:24

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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