JuliaApproximation / JuliaApproximation/ApproxFun.jl
Discrepancy in number of points and number of values on tensor spaces
Nobody has claimed this yet.
- Dominant language
- Julia
- Stars
- 559
- Forks
- 71
- PR merge metrics
- No merged PRs in 30d
Description
When trying to use ApproxFun to interpolate a function on Chebyshev-points and compute derivatives, I came across the following behaviour:
Define two spaces of Chebyshev and ultraspherical polynomials:
using ApproxFun
C2 = Chebyshev(0..1)^2
U2 = Ultraspherical(1, 0..1)^2
Project a function onto the Chebyshev space:
> fc = Fun((x,y) -> cos(π*x) * cos(π*y), C2)
> (length(points(fc)), length(values(fc)), ncoefficients(fc))
(190, 190, 185)
Transform to ultraspherical space:
> fu = Conversion(C2, U2) * fc
> (length(points(fu)), length(values(fu)), ncoefficients(fu))
(196, 361, 190)
According to the docs, values(f::Fun) returns the f::Fun evaluated on points(f), but that does not seem to be the case as the number of points and values are very different. I am wondering what exactly is happening here.
The result is similar when projecting onto the ultraspherical space right away
> fu2 = Fun((x,y) -> cos(π*x) * cos(π*y), U2)
> (length(points(fu2)), length(values(fu2)), ncoefficients(fu2))
(196, 361, 185)
I am also not quite sure why ncoefficients(f) is smaller than length(points(f)).
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the tensor-space examples with Fun, Chebyshev, Ultraspherical, Conversion, points, values, and ncoefficients. Inspect how these entry points represent points, values, and coefficients for two-dimensional spaces, then establish whether the behavior or the documentation is incorrect. Done means the discrepancy and the relationship among the reported lengths are clearly explained and verified.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- julia
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100