How to Write This Function

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • serdar
    New Member
    • Nov 2008
    • 88

    How to Write This Function

    Hi,

    I have a function y=1/x but I need it to return values like:

    y=1.0 --> x=1.0
    y=0.5 --> x=1.5

    I guess I need a logarithmic function but how?

    Thanks.
  • JosAH
    Recognized Expert MVP
    • Mar 2007
    • 11453

    #2
    Originally posted by serdar
    Hi,

    I have a function y=1/x but I need it to return values like:

    y=1.0 --> x=1.0
    y=0.5 --> x=1.5

    I guess I need a logarithmic function but how?
    Any function that goes through those two points (1.0,1.1.0) and (1.5, 0.5) will do, even a simple linear function f(x) == 2-x would do fine. What exactly do you want?

    kind regards,

    Jos

    Comment

    • serdar
      New Member
      • Nov 2008
      • 88

      #3
      I have a multiplier variable that changes based on a percentage value. With my current function (y=1/x) when we have 50% the multiplier is 2, which is too high for me.

      Comment

      • JosAH
        Recognized Expert MVP
        • Mar 2007
        • 11453

        #4
        Originally posted by serdar
        I have a multiplier variable that changes based on a percentage value. With my current function (y=1/x) when we have 50% the multiplier is 2, which is too high for me.
        What would the values f(0) and f(infinity) be for your function?

        kind regards,

        Jos

        Comment

        • serdar
          New Member
          • Nov 2008
          • 88

          #5
          Well the multiplier is actually a 'gain' value depends on the volume. So if the volume is 0 there is no need to calculate the gain.

          gain=1/volume; (where volume>0 and volume<=1)

          Comment

          • jkmyoung
            Recognized Expert Top Contributor
            • Mar 2006
            • 2057

            #6
            x = - log(y) + 1 ??
            y = 1 -> x = 1
            y = .5 -> x = 1.30
            y = .2 -> x = 1.70

            or
            x = -ln(y) + 1 ??
            y = 1 -> x = 1
            y = .5 -> x = 1.69
            y = .2 -> x = 2.61

            Comment

            • serdar
              New Member
              • Nov 2008
              • 88

              #7
              Thanks jkmyoung, I'll look deeper into that when I'm back working on the project.

              Comment

              • wbgxx
                New Member
                • Jan 2010
                • 6

                #8
                can someone give a detail??

                Comment

                Working...