Make this function continuous/numerically stable.

  • Context: Undergrad 
  • Thread starter Thread starter Unrest
  • Start date Start date
  • Tags Tags
    Function Stable
Click For Summary

Discussion Overview

The discussion revolves around modifying a mathematical function to ensure it remains continuous and numerically stable, particularly as the parameter A approaches 0. The function in question is y = [exp(Ax) - 1] / [exp(A) - 1], and participants explore alternative formulations or approximations to address issues near A=0.

Discussion Character

  • Exploratory, Technical explanation, Debate/contested

Main Points Raised

  • One participant suggests using a power series expansion for the function when A is close to 0, proposing the form y = x(1 + Ax/2! + (Ax)^2/3! + ...)/(1 + A/2! + A^2/3! + ...).
  • Another participant challenges the power series approach, arguing that the denominator still approaches 0 as A approaches 0, which could lead to instability.
  • A participant mentions the possibility of finding the limit of the function as A approaches a different value, B, and suggests replacing the original function with this limit function, although they express uncertainty about how to compute the limit.
  • There is a correction regarding the omission of the -1 in the original function, with one participant asserting that it was accounted for in the proposed power series.
  • Another participant agrees with the correctness of the power series expression and expresses optimism about its effectiveness for small values of A.

Areas of Agreement / Disagreement

Participants express differing views on the effectiveness of the power series approach, with some supporting it and others questioning its stability. The discussion remains unresolved regarding the best method to ensure continuity and numerical stability as A approaches 0.

Contextual Notes

There are limitations in the discussion regarding the assumptions made about the behavior of the function near A=0, and the methods proposed for finding limits may not be universally applicable.

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
When A is close to 0, you could evaluate it as a power series instead of using the built-in exp() function.

y = x(1 + Ax/2! + (Ax)^2/3! + ...)/(1 + A/2! + A^2/3! + ...)
 
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.
 

Similar threads

  • · Replies 3 ·
Replies
3
Views
3K
Replies
3
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 2 ·
Replies
2
Views
4K
  • · Replies 8 ·
Replies
8
Views
2K
  • · Replies 11 ·
Replies
11
Views
3K
  • · Replies 3 ·
Replies
3
Views
4K
  • · Replies 3 ·
Replies
3
Views
4K
  • · Replies 6 ·
Replies
6
Views
2K