# Limit generating an error

SageMath return a strange error in evaluating the following limit.

var('x a b γ')
U_5 = lambda x, a, b, γ: ((1-γ)/γ)*(((a*x)/(1-γ))+b)^γ
U_5(x, a, b, γ)
limU=lim(U_5(x, a, b, γ), γ=1)
show(LatexExpr(r"\lim_{\gama\rigtharrow 1}U_5(x, a, b, γ) = "),limU)


Incidently it's not a problem linked to unicode variables since I have the same result in substituting c for γ.

Here is the error message

ECL says: BINDING-STACK overflow at size 10240. Stack can probably be resized. Proceed with caution.

Incidently the result is well known (a linear function of x) and in one of my numerous essays I have had this result but changing the display I loose it and again I have the same error message..

edit retag close merge delete

Sort by » oldest newest most voted

Hey, @Cyrille!

I found it useful to pass the taylor=True option to the limit (or lim) function:

U_5(x,a,b,γ) = ((1-γ)/γ)*(((a*x)/(1-γ))+b)^γ
show(U_5(x, a, b, γ))
print('Computing')
limU = lim(U_5, γ=1, taylor=True)
print('Finished')
show(LatexExpr(r"\lim_{\gama\rigtharrow 1}U_5(x, a, b, γ) = "),limU)


I believe that this option must be used carefully, due to some known bugs in Maxima, but in this case it works like a charm!

Hope this helps!

more

One more time Thanks dsejas. Incidently you can have a look at https://www.educandgames.org/ all start from your suggestion two years ago. It's a hard work not yet finished.

( 2023-05-11 22:14:31 +0200 )edit

Hello, @Cyrille! I am glad I could help.

I took a look at your website and I really enjoyed it, although some parts I had to translate from French to English using deepl.com in order to understand them. I should really thank you for including my name in your "Remerciements" ("Acknowledgments") section; I feel honoured.

( 2023-11-27 04:34:58 +0200 )edit