Make this function continuous/numerically stable.

  • Context: Undergrad 
  • Thread starter Thread starter Unrest
  • Start date Start date
  • Tags Tags
    Function Stable
Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
4 replies · 2K views
Unrest
Messages
360
Reaction score
1
Hello. I have a function which doesn't work near A=0. I want to change it to something that a computer can evaluate for any value of A.

y = [exp(Ax) - 1] / [exp(A)-1]

As you can see below, it approaches y=x when A->0.

I was wondering about multiplying the numerator and denominator by something.

[PLAIN]http://dl.dropbox.com/u/21857463/FunctionPlot.png
 
Last edited by a moderator:
Physics news on Phys.org
AlephZero said:
y = x(1 + Ax/2! + (Ax)^2/3! + ...)/(1 + A/2! + A^2/3! + ...)

I think that won't work any better because the denominator still approaches 0 as A approaches 0. (you omitted the -1).

I think if I can find the limit of this as A->B, I can replace the function with the limit function instead. But I don't know any way to find limits except factorizing or dividing by powers of x, neither of which work here.
 
(you omitted the -1)

No he didn't. Look at it again, carefully. He already subtracted the ones (numerator and denominator), factored, and then divided out "A".

AlephZero's expression is correct, and will work for small "A".
 
TheoMcCloskey said:
AlephZero's expression is correct, and will work for small "A".

Oh yes, indeed. This should be a good solution.