Skip to content
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

logkernel sometimes throws domain error due to acos #104

Open
dlfivefifty opened this issue Dec 1, 2017 · 4 comments
Open

logkernel sometimes throws domain error due to acos #104

dlfivefifty opened this issue Dec 1, 2017 · 4 comments

Comments

@dlfivefifty
Copy link
Member

y = r*exp(im*acos(x/r))

logkernel(1/sqrt(1-x^2),-5.0)

@dlfivefifty
Copy link
Member Author

I think the code needs to be redesigned anyways using the OP point of view.

Annoyingly, you can't work around this by perturbing -5.0.

@MikaelSlevinsky
Copy link
Member

The problem is a rounding error is causing the real part of the Joukowsky inverse to be larger in magnitude than the absolute value by one bit.

Since x and y are both needed, a fix would use reim(joukowskyinverse(...)), though this might be less efficient.

@dlfivefifty
Copy link
Member Author

Hmm, why don't we just simplify r*exp(im*acos(x/r)) as r + im*sqrt(r^2-x^2) or similar?

@dlfivefifty
Copy link
Member Author

PS Realized it's very easy to calculate equilibrium measures in the complex plane:

ε = 0.1
    x = real(Fun(Segment(0,1))) ; y = imag(Fun(Segment*im,im)))
    w(a,b) = x^a*(1-x)^b + (y-ε)^b*(1-y)^a
    μ = SingularIntegral(space(w(-0.5,-0.5)),0) \ ones(domain(w(-0.5,-0.5)))

Unfortunately it doesn't have the nice property that real-line EMs do that logkernel(μ*x^k) is a degree k-1 polynomial...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants