next up previous contents Next: Analyzing univariate polynomials Up: ALIAS-C++ Previous: Analyzing systems of equations

  • La page de J-P. Merlet
  • J-P. Merlet home page
  • La page Présentation de HEPHAISTOS
  • HEPHAISTOS home page
  • La page "Présentation" de l'INRIA
  • INRIA home page

    Subsections


    Analyzing trigonometric equations

    Introduction

    The purpose of this chapter is to describe tools which can be used to analyze either one trigonometric equation in one variable or a system of trigonometric equations. These tools may be used either to improve the efficiency of the solving algorithm described in the previous chapter or even to avoid calling them if some constraints are imposed on the location of the solution.


    Number of roots of trigonometric equation

    The purpose of this section is to present an algorithm which enable to determine how many roots has an equation $F$ in the unknown $x$ of the form:
    \begin{displaymath}
F= \sum a_k\sin^m(x)\cos^n(x)
\end{displaymath} (4.1)

    with $m$ in $[0,M]$ and $n$ in $[0,N]$, both $m, n$ being integers, and $x$ in $(\underline{x},\overline{x})$.

    Mathematical background

    We use the half angle tangent substitution. If $\theta$ is the unknown we define $T$ as:

    \begin{displaymath}
T=\tan(\frac{\theta}{2})
\end{displaymath}

    Then we have:

    \begin{displaymath}
\sin(\theta)=\frac{2T}{1+T^2}       \cos(\theta)=\frac{1-T^2}{1+T^2}
\end{displaymath}

    Note that the change of variable is not valid if $\theta =\pm \pi$. In that case it will be preferable to define $\alpha = \theta+\pi$ and to transform the initial into an equation in $\alpha$. Then the change of variable may be applied.

    Using the above relation any trigonometric equation can be transformed into a polynomial equation which is analyzed using the tools of chapter 5.

    It remains to define an interval for angles that we will denote an angle interval. The element of an angle interval is usually defined between 0 and $2\pi$ (although in most of the following procedures any value can be used when not specified: internally the element of the angle interval are converted into value within this range). A difference between numbers interval (INTERVAL) and angle interval is that the lower bound of an angle interval may be larger than the upper bound. Indeed the order in an angle interval is important: for example the angle intervals [0,$\pi/4$] and [$\pi/4$,0] are not the same.

    Implementation

    The purpose of the implementation is first to convert the trigonometric equation in sine and cosine of $\theta$:
    \begin{displaymath}
F= \sum a_k\sin^m(\theta)\cos^n(\theta)
\end{displaymath} (4.2)

    into a polynomial in either $\tan(\theta/2)$ or $\tan((\pi+\theta)/2)$. A first procedure return an upper bound of the degree of the resulting polynomial:
     
    int Degree_Max_Convert_Trigo_Interval(int n,VECTOR &A,INTEGER_VECTOR &SSin,INTEGER_VECTOR &CCos);
    int Degree_Max_Convert_Trigo_Interval(int n,INTEGER_VECTOR &A,
                            INTEGER_VECTOR &SSin,INTEGER_VECTOR &CCos);
    
    with: Then we may use a procedure which compute the coefficients of the polynomial equation using the following procedures:
     
    VOID Convert_Trigo_Interval(int n,VECTOR &A,INTEGER_VECTOR &SSin,
                            INTEGER_VECTOR &CCos,VECTOR &Coeff,int *degree);
    VOID Convert_Trigo_Interval(int n,INTEGER_VECTOR &A,INTEGER_VECTOR &SSin,
                            INTEGER_VECTOR &CCos,INTEGER_VECTOR &Coeff,int *degree);
    VOID Convert_Trigo_Interval(int n,INTERVAL_VECTOR &A,INTEGER_VECTOR &SSin,
                            INTEGER_VECTOR &CCos,INTERVAL_VECTOR &Coeff,int *degree);
    
    with: The previous procedures use the substitution $T=\tan(\theta/2)$ which is not valid for $\theta =\pi$. In that case we may use instead the substitution $T=\tan((\pi+\theta)/2)$ and the coefficient of the resulting polynomial may be determined using the following procedures:
     
    VOID Convert_Trigo_Pi_Interval(int n,VECTOR &A,INTEGER_VECTOR &SSin,
                INTEGER_VECTOR &CCos,INTEGER_VECTOR &Coeff,int *degree);
    VOID Convert_Trigo_Pi_Interval(int n,INTEGER_VECTOR &A,INTEGER_VECTOR &SSin,
                INTEGER_VECTOR &CCos,INTEGER_VECTOR &Coeff,int *degree);
    VOID Convert_Trigo_Pi_Interval(int n,INTERVAL_VECTOR &A,INTEGER_VECTOR &SSin,
                INTEGER_VECTOR &CCos,INTEGER_VECTOR &Coeff,int *degree);
    
    Similar procedures exists for interval trigonometric equations i.e. equations where the coefficients A are intervals. In that case degree will no more an integer but an INTERVAL which indicate the lowest and highest degree of the resulting polynomial. In some case the number of roots of the trigonometric equation may exceed the degree of the equivalent polynomial. For example the equation $\sin\theta =0$ has the roots $0,
\pi$ while the degree of the equivalent polynomial is only 1. In all cases the total number of roots of the trigonometric equation will never exceed the degree+2.

    Having determined the equivalent polynomial you my use the tools described in section 5 for determining the number of roots of the trigonometric equation. But you still have to manage the search interval. The following procedure is able to determine this search interval and to determine the number of roots of the trigonometric equation:

     
    int Nb_Root_Trigo_Interval(int n,VECTOR &A,INTEGER_VECTOR &SSin,
                            INTEGER_VECTOR &CCos,REAL Inf,REAL Sup)
    
    with: On success this procedure returns a number greater or equal to 0 and returns -1 if it has failed. Failure occurs either if the equation is equal to 0 or if Sturm method failed to determine the number of roots of the equivalent polynomial equation (this will happen if Inf or Sup are exact root of the equation).

    Example

    Consider the equation:

    \begin{displaymath}
\left (\sin(t)-1/2\right )\left (\sin(t)-1/2 \sqrt {3}\right )\left (
\cos(t)-1/2 \sqrt {2}\right )=0
\end{displaymath}

    which has as roots: $\pi/6 (0.5235)$, $\pi/4 (0.7853)$, $\pi/3 (1.047)$, $2\pi/3 (2.094)$, $5\pi/6 (2.617)$, $7\pi/4 (5.497)$. This equation is equivalent to:

    \begin{displaymath}
\sin^2(t)\cos(t)- 0.707106781 \sin^2(t)- 1.366025404 \sin(...
...s(t)+ 0.9659258263 \sin(t)+
0.4330127 \cos(t)- 0.3061862179
\end{displaymath}

    The A, SSin, CCos vectors have the following values:
    A SSin CCos
    1 2 1
    -0.7071067810 2 0
    -1.366025404 1 1
    0.9659258263 1 0
    0.4330127020 0 1
    -0.3061862179 0 0
    If Inf=0 and Sup=0.8 the procedure indicates that there are two roots corresponding to $\pi/6=0.5235987758$ and $\pi/4=0.7853981635$.


    Bound on the roots of trigonometric equation

    The purpose of this section is to present an algorithm which enable to determine bounds on the roots of an equation $F$ in the unknown $x$ of the form:
    \begin{displaymath}
F= \sum a_k\sin^m(x)\cos^n(x)
\end{displaymath} (4.3)

    with $m$ in $[0,M]$ and $n$ in $[0,N]$ and $x$ in $(\underline{x},\overline{x})$.

    Implementation

    This procedure return angle intervals included in the range $[0,2\pi]$ which contain the roots of the trigonometric equation.
     
    int Bound_Root_Trigo_Interval(int n,VECTOR &A,INTEGER_VECTOR &SSin,
                INTEGER_VECTOR &CCos,int *nbsol,VECTOR &Inf,VECTOR &Sup);
    
    with: Note that the size of Inf, Sup should be 4 at least. In case of failure the procedure return -1, 1 on success.

    Example

    Consider the equation:

    \begin{displaymath}
\left (\sin(t)-1/2\right )\left (\sin(t)-1/2 \sqrt {3}\right )\left (
\cos(t)-1/2 \sqrt {2}\right )=0
\end{displaymath}

    which has as roots: $\pi/6 (0.5235)$, $\pi/4 (0.7853)$, $\pi/3 (1.047)$, $2\pi/3 (2.094)$, $5\pi/6 (2.617)$, $7\pi/4 (5.497)$. The procedure returns 2 angle intervals: [0.517117,2.62532], [5.49664,5.50734].

    Utilities for trigonometric equation


    Inclusion in an angle interval

    The procedure:

     
    int Angle_Ok_Interval(double angle,double b1,double b2);
    
    return 1 if the angle angle belongs to the angle interval [b1,b2], 0 otherwise. The angle angle,b1, b2 should have a value within [0,$2\pi$].


    Distance between two angles

    The procedure:

     
    double Distance_Angle(double a1,double a2)
    
    return the smallest distance in radian between the two angles a1,a2.

    Generalized inverse trigonometric functions

    Assume that we have $\cos(\beta)= U$ where $U$ is an interval and $\beta$ should lie in an arbitrary range. The procedure Filtre_Arc_Cos allows to update the range for $\beta$. It returns -1 is $\beta$ and $U$ are incompatible, 0 otherwise. Its syntax is:

     
    int Filtre_Arc_Cos(INTERVAL &U,INTERVAL &beta)
    
    A similar procedure exist for the inverse sine with

    The procedure Arc_Cos_Multiple allows to determine all possible ranges for $\beta$, assuming that $\beta$ is restricted to a range included in $[-2\pi,2\pi]$::

     
    int Arc_Cos_Multiple(INTERVAL &U,INTERVAL &beta,INTERVAL_VECTOR &BETA)
    
    This procedure returns the number of possible ranges for $\beta$ and their values in BETA.


    next up previous contents Next: Analyzing univariate polynomials Up: ALIAS-C++ Previous: Analyzing systems of equations
  • J-P. Merlet home page
  • La page Présentation de HEPHAISTOS
  • HEPHAISTOS home page
  • La page "Présentation" de l'INRIA
  • INRIA home page

    jean-pierre merlet
    2018-07-25