Subject: ratinterpol does not reproduce rational function
From: Mario Rodriguez
Date: Fri, 28 Dec 2012 13:28:04 +0100
El vie, 28-12-2012 a las 02:16 +0100, andre maute escribi?:
> On 12/27/2012 04:56 PM, Stavros Macrakis wrote:
> > ratinterpol(float(h),2) gives the correct result (within 1e-8 or so) after
> > you eliminate small coefficients and rationalize the result.
>
> My obviously wrong belief was, that ratinterpol can reproduce
> a rational function, if the degree of the numerator is known,
> and one does have enough interpolation points.
The origin of the problem is that ratinterpol does not calculate the
independent term of the denominator; it is given value 1 by default or
the value given by the user by means of option denterm. This way,
ratinterpol builds a determinate linear system to be solved by
solve_by_lu...
... well, but not always. In your example, the independent term in the
denominator is zero, but ratinterpol forces it to be 1, the system is
incompatible and crashes everything. And writing option denterm = 0 does
not help, since it makes the system homogeneous.
I have commited a new version of ratinterpol.
Option denterm has been removed. And now ratinterpol estimates all the
coefficients calling linsolve instead of solve_by_lu.
Please, try it and let me know how it works.
And thanks for reporting this bug.
--
Mario