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

Bug with cosine of an interval #1

Open
haavarn opened this issue Dec 10, 2021 · 0 comments
Open

Bug with cosine of an interval #1

haavarn opened this issue Dec 10, 2021 · 0 comments

Comments

@haavarn
Copy link

haavarn commented Dec 10, 2021

Hi,
There seems to be a bug with the cosine function. Unfortunately, I have not been able to spot the error within the source code myself...

Here is the infimum and supremum of a cosine with an interval +/- 10 degs around the nominal:
image

You can generate the plots using:

angs = -2*pi:0.1:2*pi;
sup = zeros(size(angs));
inf = zeros(size(angs));
 
diff = 10 / 180*pi;
 
for i = 1:length(angs)
    sup(i) = cos(interval( angs(i)-diff, angs(i)+ diff)).supremum;
    inf(i) = cos(interval( angs(i)-diff, angs(i)+ diff)).infimum;
end

plot(angs,inf)
plot(angs,sup)

The sine is fine, so it is possible to use cos(interval) = sin(pi/2 – interval)
image

Cheers,
Håvard

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

1 participant