Open MikaelSlevinsky opened 8 years ago
Thanks for the PR.
It would be great to have this functionality, I don't want to get rid of the existing functionality: theregular monomial basis is much more convenient for special functions (which is what I used it for).
Could we do this via dispatch somehow, e.g. have a Chebyshev
type?
Yes, that sounds reasonable.
The monomial basis is also a well-conditioned basis for best approximation on the unit circle (in the complex plane). From this perspective, it would also be good to have them both.
Perhaps just a keyword/arg flag such as basis=:monomial
, or basis=:Chebyshev
would be better for this simple dispatching? Then another flag such as domain=:interval
or domain=:circle
could also be added.
Then another flag such as domain=:interval or domain=:circle could also be added.
What would the domain
arg do?
The sample points for a domain=:interval
would be the Chebyshev nodes.
The sample points for a domain=:circle
would be equi-spaced nodes on the circle.
This would effectively allow for periodic best approximants.
Ah right. I guess it would be nice to have this working via dispatch, but keyword arguments are probably fine for now if you think that's easier.
ApproxFun has types for domains, such as Interval
, PeriodicInterval
, and Circle
, and types for function spaces (bases), such as Chebyshev
and Taylor
.
If ApproxFun were a dependency, then these types would be readily available and avoid code duplication. On the other hand, ApproxFun is under considerable development 😉.
That makes sense: given the significant overlap, I don't think that's an unreasonable dependency.
This PR converts the package to return approximants expressed in the basis of Chebyshev polynomials of the first kind.
Advantage is better conditioning of coefficients, disadvantage is 2x slower:
Originally:
With this PR:
List of changes: