Skip to content

Bug with cosine of an interval #1

@haavarn

Description

@haavarn

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions