-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversion from ZernikeAnnulus to Bubble #4
Comments
If we drop just the first column we get something reasonable: julia> n = 1000; cond(L₁₁[2:n+1,1:n])
2361.354956062211 This is equivalent to adding a single hat function, i.e., inverting Note The difference: in julia> n = 1000; A = [[[[1; zeros(m)] L₁₁[1:m+1,1:m-1] [zeros(m); 1]]; zeros(n-m+1,m+1)] L₁₁[1:n+2,m:n]]
1002×1002 Matrix{Float64}:
1.0 0.0313853 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 … 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
0.0 0.0261561 0.0390535 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
0.0 -0.00360819 0.0303656 0.0425396 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
0.0 0.0 -0.00674966 0.0306521 0.0440552 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
0.0 0.0 0.0 -0.00984693 0.0291571 0.0444601 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
0.0 0.0 0.0 0.0 -0.0128444 0.0266986 0.0441655 0.0 0.0 0.0 0.0 0.0 … 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
0.0 0.0 0.0 0.0 0.0 -0.0157356 0.0236496 0.0433874 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
0.0 0.0 0.0 0.0 0.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.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 -0.0332006 2.13674e-7 0.033234 0.0 0.0
0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 -0.0332006 2.5704e-7 0.033234 0.0
0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 -0.0332006 2.55978e-7 0.0332339
0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 … 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 -0.0332007 2.6622e-7
0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 -0.0332007
julia> norm(inv(A), Inf)
938.5268517143461 But this is weird when thinking about hat functions.... |
A similar thing happens when julia> L₁₁ = Weighted(Jacobi(m,0)) \ Weighted(Jacobi(m+1,1))
(ℵ₀×ℵ₀ LazyBandedMatrices.Bidiagonal{Float64, LazyArrays.BroadcastVector{Float64, typeof(/), Tuple{InfiniteArrays.InfStepRange{Float64, Float64}, InfiniteArrays.InfStepRange{Float64, Float64}}}, LazyArrays.BroadcastVector{Float64, typeof(/), Tuple{InfiniteArrays.InfStepRange{Int64, Int64}, InfiniteArrays.InfStepRange{Float64, Float64}}}} with indices OneToInf()×OneToInf()) * (ℵ₀×ℵ₀ LazyBandedMatrices.Bidiagonal{Float64, LazyArrays.BroadcastVector{Float64, typeof(/), Tuple{InfiniteArrays.InfStepRange{Float64, Float64}, InfiniteArrays.InfStepRange{Float64, Float64}}}, LazyArrays.BroadcastVector{Float64, typeof(/), Tuple{InfiniteArrays.InfStepRange{Int64, Int64}, InfiniteArrays.InfStepRange{Float64, Float64}}}} with indices OneToInf()×OneToInf()) with indices OneToInf()×OneToInf():
0.17316 ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ …
0.15735 0.304348 ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ ⋅
-0.0158103 0.264348 0.406154 ⋅ ⋅ ⋅ ⋅ ⋅ ⋅
⋅ -0.04 0.337778 0.486772 ⋅ ⋅ ⋅ ⋅ ⋅
⋅ ⋅ -0.0683761 0.38825 0.551724 ⋅ ⋅ ⋅ ⋅
⋅ ⋅ ⋅ -0.0985222 0.422692 0.604839 ⋅ ⋅ ⋅ …
⋅ ⋅ ⋅ ⋅ -0.129032 0.445748 0.648841 ⋅ ⋅
⋅ ⋅ ⋅ ⋅ ⋅ -0.159091 0.460606 0.685714 ⋅
⋅ ⋅ ⋅ ⋅ ⋅ ⋅ -0.188235 0.469498 0.716927
⋅ ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ -0.216216 0.474012
⋅ ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ -0.242915 …
⋅ ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ ⋅
⋅ ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ ⋅
⋅ ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ ⋅
⋅ ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ ⋅
⋅ ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ …
⋅ ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ ⋅
⋮ ⋮ ⋱ |
Note when the RHS is a bubble function the two "hat function" coefficients give zero: c = L₁₁[1:n+2,1:n] * randn(n); # lies in the span of L₁₁, i.e., coefficients of a bubble function
julia> (A\c)[1]
1.016547956922409e-15
julia> (A\c)[m+1]
-6.158268339717665e-17 So at the very least we have a stable way of projecting on to the bubble functions (invert I have a feeling when we think more about it we will realise that the hat function corresponding to the inner radius should be degree Check out https://github.com/dlfivefifty/LegoBrickFEMGrant/blob/main/sparsemass.pdf for a general way of writing this (quick, before I kick you off that repos) |
@dlfivefifty The conversion from ZernikeAnnulus to the hats+bubble on one element becomes increasingly ill-conditioned as m (the Fourier mode) gets larger. This is true for either of the ZernikeAnnulus(0,0) or ZernikeAnnulus(1,1) routes.
This is alleviated is we instead do a least squares solve to find the coefficients in hats+bubble (include an extra 2 columns in the ZernikeAnnulus(0,0) case or 4 columns in the ZernikeAnnulus(1,1) case).
Do you see an easy way around this? Should we just do least square solves for the coefficients for now? I've attached a snippet to show the difference in the ZernikeAnnulus(0,0) route.
The text was updated successfully, but these errors were encountered: