yacas icon indicating copy to clipboard operation
yacas copied to clipboard

Limit

Open mikldk opened this issue 5 years ago • 3 comments

I tried this limit

In> Limit(k, Infinity) (s11+s12*k)/Sqrt((w^2+s11)*(w^2+s11+k^2*s22+2*k*s12))
Out> (s11+s12*Infinity)/Sqrt((w^2+s11)*(w^2+s11+Infinity*s22+2*Infinity*s12))

I was expecting

s12/Sqrt(s22*(s11 + w^2))

See https://www.wolframalpha.com/input/?i=lim+%28s11%2Bs12*k%29%2FSqrt%28%28w%5E2%2Bs11%29*%28w%5E2%2Bs11%2Bk%5E2*s22%2B2*k*s12%29%29+k+-%3E+Inf.

mikldk avatar Nov 07 '19 22:11 mikldk

A smaller example is this:

In> Limit(k, Infinity) (a+b*k)/k
CommandLine(1) : Max evaluation stack depth reached.
Please use MaxEvalDepth to increase the stack size as needed.
CommandLine(1) : Max evaluation stack depth reached.
Please use MaxEvalDepth to increase the stack size as needed.

mikldk avatar Nov 08 '19 10:11 mikldk

Related may be that I cannot get yacas to divide into brackets:

In> Simplify((a+b*k)/k)
Out> (a+b*k)/k

In> FactorialSimplify((a+b*k)/k)
Out> (a+b*k)/k

In> ExpandFrac((a+b*k)/k)
Out> (a+b*k)/k

In> ExpandBrackets((a+b*k)/k)
Out> (a+b*k)/k

What I hoped for something like

In> FactorialSimplify((a+b*k)/k)
Out> a/k + b

mikldk avatar Nov 08 '19 10:11 mikldk

Hi,

Ok, so the thing is that in the case of pure rational functions, limit in oo depends on the (polynomial) division of numerator by denominator. And exactly this approach is taken, but the division cannot be performed when coefficients are not numerical. Hence, the division returns unevaluated and we attempt to find limit of Div(numerator, denominator), which gets into some weird recursion.

I have to think a bit more what the approach should be in case of general coefficients.

But it's a good catch, thanks!

Grzesiek

grzegorzmazur avatar Nov 19 '19 15:11 grzegorzmazur