Results 1 to 5 of 5

Math Help - I need someone to create a function with certain features

  1. #1
    Newbie
    Joined
    Sep 2010
    Posts
    2

    I need someone to create a function with certain features

    I need a function f(x), that uses a as a constant.

    -1<a<1

    I need:
    f(-1)=0
    f(1)=1
    f(a)=.5

    The function must always have a positive (or zero) slope, and I would like it to be as smooth as possible.
    I would also like the slope to be highest near a.

    It must be continuous and differentiable everywhere from x=-1 to 1. Thanks

    The function will be used in a computer program, so the most simple solution is best.
    Follow Math Help Forum on Facebook and Google+

  2. #2
    A Plied Mathematician
    Joined
    Jun 2010
    From
    CT, USA
    Posts
    6,318
    Thanks
    4
    Awards
    2
    Very interesting problem, nathanf534! It took me a very long time to find even one solution. A simple cubic won't work, even if you use y as the independent variable. Neither will a straight-forward arctangent function work. I'm assuming you need x as the independent variable. My solution is a pasting of two functions together at a such that the function values and the function derivatives match up there. Is that an acceptable solution? I also have a vertical tangent at a. I'm not sure if that's acceptable or not. Technically, the function is not differentiable there. I've tried making the solution better behaved there, but for some reason it's balking. Here is my solution so far:

    \displaystyle{f(x)=\begin{cases}<br />
\frac{a+1-\sqrt{a+1}\sqrt{a-x}}{2(1+a)}&\quad x\in[-1,a]\\<br />
\frac{a-1+\sqrt{a-1}\sqrt{a-x}}{2(a-1)}&\quad x\in[a,1]<br />
\end{cases}}.

    Let me know if this works for you. I obtained this solution through a rather circuitous route. First I solved the same problem, but with x\in[0,1]. The conditions turn out nicer and were easier to work with. I then transformed the solution into the proper domain by a linear transformation on x. The ansatz was two quadratics in y that I pieced together at the required point, matching up both function values and derivatives. I also forced the concavities in order to assure that the derivative was maximized at a.
    Follow Math Help Forum on Facebook and Google+

  3. #3
    A Plied Mathematician
    Joined
    Jun 2010
    From
    CT, USA
    Posts
    6,318
    Thanks
    4
    Awards
    2
    After further computations, I have discovered that, using this approach, the solution found above is the only solution. Now, a different ansatz may give better answers. However, this is what you get with this approach.
    Follow Math Help Forum on Facebook and Google+

  4. #4
    Newbie
    Joined
    Sep 2010
    Posts
    2
    Thank you for taking time to solve this. I was hoping there was a more simple solution, but I will try out what you gave me and see what I can do with it.
    Follow Math Help Forum on Facebook and Google+

  5. #5
    A Plied Mathematician
    Joined
    Jun 2010
    From
    CT, USA
    Posts
    6,318
    Thanks
    4
    Awards
    2
    There's another solution that my father produced. The only difficulty is that there is one parameter for which it is difficult to solve. Here is the solution:

    \displaystyle{y=\frac{\tan^{-1}\left(\frac{x-a}{b}\right)-\tan^{-1}\left(\frac{-1-a}{b}\right)}{\tan^{-1}\left(\frac{1-a}{b}\right)-\tan^{-1}\left(\frac{-1-a}{b}\right)}}.

    This satisfies f(-1)=0,\;f(1)=1, monotone increasing, and the slope is maximized at a. However, you must solve for b such that f(a)=1/2. For all the cases I've tried, this is possible to do. However, I don't know how easy it would be to do numerically in whatever programming language you're using. You might try different methods, as well, depending on how many different a's for which you must produce the curve.

    If you simply write out the equation f(a)=1/2, you obtain

    \displaystyle{\frac{-\tan^{-1}\left(\frac{-1-a}{b}\right)}{\tan^{-1}\left(\frac{1-a}{b}\right)-\tan^{-1}\left(\frac{-1-a}{b}\right)}=\frac{1}{2}}.

    It is possible to eliminate all the arctangents. However, the resulting algebraic equation is quite messy. If you can solve for b numerically quickly enough for your application, I'd recommend that instead.
    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. Create a special function
    Posted in the Advanced Applied Math Forum
    Replies: 0
    Last Post: November 23rd 2010, 09:15 AM
  2. features of a polynomial function
    Posted in the Calculus Forum
    Replies: 5
    Last Post: March 23rd 2010, 02:12 PM
  3. Replies: 6
    Last Post: October 20th 2009, 02:26 AM
  4. create function
    Posted in the Discrete Math Forum
    Replies: 2
    Last Post: July 5th 2009, 05:29 PM
  5. Create function w/ data
    Posted in the Math Software Forum
    Replies: 11
    Last Post: March 3rd 2008, 08:12 PM

Search Tags


/mathhelpforum @mathhelpforum