5

I have number x=[0,n], where n>0. I want to construct a function y=f(x) such that the value increase slowly from 0 and increase very fast when approaching n, and when reach n, y is infinity. What is a good function to model this?

william007
  • 17,375
  • 25
  • 118
  • 194

1 Answers1

2

1/(n-x) - 1/n will work.

There are plenty of other functions log, atan, x^(-k),... that goes to infinity at some point.

a^y is another set of functions with fast grows - maybe more suitable for coding as it can reach arbitrary large (but finite) values.

Alexei Levenkov
  • 98,904
  • 14
  • 127
  • 179
  • 3
    at x=0, you get 1/n which is why I subtracted 1/n in my comment above. Here's a graph, too: http://www.wolframalpha.com/input/?i=y%3D1%2F%285-x%29-1%2F5 – sinelaw Oct 11 '12 at 02:05