1
$\begingroup$

Is there any analytical solution for minimizing $\sum\limits_{n=1}^{N}{\sin {{\theta }_{n}}}$ ?

subject to $\sum\limits_{n=1}^{N}{\cos {{\theta }_{n}}}=A$

&

$0<{{\theta }_{n}}<{\pi/2}$

  • 0
    Have you tried lagrange's multipliers?2017-01-30
  • 0
    By concavity of $x\mapsto \sqrt{1-x^2}$ the maximum is when all angles are equal. The minimum is more delicate: including also the extreme values for the angles, I would guess that you should take as many angles equal to $\pi/2$ as you can, compatibly with the constraint on the sum, and the others equal to $0$, except maybe for the last angle, which is chosen to adjust the sum. If you do not include $0$ and $\pi/2$, then there might be no minimum.2017-01-31
  • 0
    Did not have time to check all the details properly, but the minimum in the extended domain including $0$ and $\pi/2$ seems to be $$\min_{\theta_k\in[0,\pi/2]~\text{s.t.}~\sum\cos\theta_k = A} \sum_{k=1}^N \sin\theta_k = \sin\left(\arccos\left(\{A\}\right)\right) + N - \lfloor A\rfloor - 1$$ for $0\leq A\leq N$ where $\{A\}$ is the fractional part of $A$.2017-01-31
  • 0
    @Winther "The solution to a symmetric problem like this is either symmetric ... or ... on the boundary" Sorry but this is not a theorem, at most a heuristic principle2017-01-31
  • 0
    @Did It's missing a "usual". Yes it's a heuristic not a theorem. I'll remove the comment to avoid confusion.2017-01-31
  • 0
    @Winther I have done a detailed analysis whose result resembles your solution. Not sure if they agree, but they look alike.2017-01-31
  • 0
    @Fimpellizieri It's the same result as $\sin(\arccos(x)) = \sqrt{1-x^2}$ for all $x\in[0,1)$.2017-02-01
  • 0
    @Del Thanks for your comments.2017-02-06
  • 0
    @Winther Thank you for your answers and comments2017-02-06
  • 0
    @Did Thank you for your helpful answer2017-02-06

3 Answers 3

1

This follows a reasoning through Lagrange's multipliers. Observe that $A>0$.

Let $f(\theta_1,\dots,\theta_N)=-\sum_i\sin(\theta_i)$ and let $g(\theta_1,\dots,\theta_N)=\sum_i\cos(\theta_i)$. Then the problem is equivalent to

\begin{align}&\text{maximize }&&f(\theta_1,\dots,\theta_N)\\ &\text{subject to }&&g(\theta_1,\dots,\theta_N)=A\end{align}

We have that $\nabla g=(-\sin(\theta_1),\dots,-\sin(\theta_N))$ and that $\nabla f=(-\cos(\theta_1),\dots,-\cos(\theta_N))$. Hence, the problem is equivalent to solving the following system:

\begin{equation} \left\{\begin{array}{l} \cos(\theta_1)=\lambda\cdot\sin(\theta_1)\\ \dots\\ \cos(\theta_N)=\lambda\cdot\sin(\theta_N)\\ \sum_i\cos(\theta_i)=A\end{array}\right. \end{equation}

We have that $\sin(\theta_i)^2+\cos(\theta_i)^2=(1+\lambda^2)\sin(\theta_i)^2=1$ so that for all $i$ it must be that

$$\sin(\theta_i)=\sqrt{\frac{1}{1+\lambda^2}}\,,\,\,\,\,\, \,\,\,\,\,\,\,\,\,\,\,\,\cos(\theta_i)=\lambda\cdot\sqrt{\frac{1}{1+\lambda^2}}$$

It follows that $A=N\lambda\cdot\sqrt{\frac{1}{1+\lambda^2}}$ must be satisfied. The only solution is hence

$$\lambda=\frac{A}{\sqrt{N^2-A^2}}$$

Now, notice that if the first $n$ equations are satisfied, then

$$\sum_i\cos(\theta_i)=\lambda\sum_i\sin(\theta_i)=-\lambda\cdot f(\theta_1,\dots,\theta_N)$$

Hence, the last equation is equivalent to $f(\theta_1,\dots,\theta_N)=-A/\lambda$ and the value is

$$\sqrt{N^2-A^2}$$


But is this actually the sought minimum? No. Let's try an example.

If we set $A=N-1$, then our value is $\sqrt{2N-1}$. However, if we take $\theta_1=\theta_2=\dots=\theta_{N-1}=0$ and $\theta_N=\pi/2$, the conditions will be satisfied but our value will be $1$, which is less than $\sqrt{2N-1}$ for $N\geq 2$.

Of course, these exact values of $\theta$ are not in the domain. Nonetheless, if we change them slightly -- $\theta_1=\theta_2=\dots=\theta_{N-1}=\epsilon_0>0$ and $\theta_N$ the angle slightly less than $\pi/2$ that makes the constraint true --, the value of $1$ will also change (increase) very slightly.

This should be an indicator that the minimum cannot be attained. Suppose the $\theta_i$'s lie in $[0,\pi/2]$, so that by compacity there is a minimum to $\sum_i\sin(\theta_i)$.

Claim: No minimum lies in $(0,\pi/2)$.

Proof: Indeed, suppose there is some $k$ such that $\theta_k$ is minimal among nonzero $\theta$'s and $j$ such that $\theta_k<\theta_j<\frac{\pi}{2}$. We will show that by making $\theta_j$ larger and $\theta_k$ smaller (respecting the constraint), the sum of sines becomes smaller.

More precisely, there are real functions $\Theta_i,\Theta_k$ defined on $[0,\epsilon)$ with

\begin{equation}\left\{\begin{array}{l} \Theta_j(0)=\theta_j,\,\,\,\, \Theta_j \text{ increasing}\\ \Theta_k(0)=\theta_k,\,\,\, \Theta_k \text{ decreasing}\\ \cos(\Theta_j(t))+\cos(\Theta_k(t))=\text{ constant} \end{array}\right.\end{equation}

We will choose $\Theta_j,\Theta_k$ smooth, so the last equation is equivalent to

\begin{align}\tag{*}\label{eq1}\sin(\Theta_j(t)){\Theta_j}'(t)+\sin(\Theta_k(t)){\Theta_k}'(t)=0\end{align}

Taking, say, $\Theta_j(t)=\theta_j+t$, the existence and uniqueness theorem for ODE's guarantees that there is a uniquely defined $\Theta_k$ with $\Theta_k(0)=\theta_k$ satifying $\eqref{eq1}$ for $t$ near $0$. Since the sines are positive and ${\Theta_j}'>0$, equation $\eqref{eq1}$ also implies ${\Theta_k}'<0$, so the monotonicity conditions are also satisfied.

On the other hand, substituting $\Theta_j(t)=\theta_j+t$ into equation $\eqref{eq1}$ yields

$$\sin(\theta_j+t)+\sin(\Theta_k(t)){\Theta_k}'(t)=0,$$

so that

\begin{align} &\frac{d}{dt}\Big(\sin(\Theta_j(t))+\sin(\Theta_k(t))\Big)=\cos(\theta_j+t)+\cos(\Theta_k(t)){\Theta_k}'(t)<0\\ \iff &{\Theta_k}'(t)<\frac{-\cos(\theta_j+t)}{\cos(\Theta_k(t))} \iff \frac{-\sin(\theta_j+t)}{\sin(\Theta_k(t))}<\frac{-\cos(\theta_j+t)}{\cos(\Theta_k(t))} \\ \iff &-\sin(\Theta_k(t))\cos(\theta_j+t)+\sin(\theta_j+t)\cos(\Theta_k(t))>0\\ \iff &\sin((\theta_j+t)-\Theta_k(t))>0 \end{align}

For $t=0$, $\Theta_k(t)=\theta_k<\theta_j$, so that indeed the inequalities hold and the sum of sines decreases.

This fails only in one of two cases:

$(1):$ There is no such index $k$, meaning all the $\theta$'s are $0$. This is not a problem: it can only happen when $A=0$, and in this case the only possibility is all $\theta$'s equal $0$ anyway.

$(2):$ There is no such index $j$, which implies one of the following:

$\,\,\,\,(2.1):$ All nonzero $\theta$'s coincide (violating $\theta_k<\theta_j$).

$\,\,\,\,(2.2):$ All $\theta$'s greater than $\theta_k$ are equal to $\pi/2$.

Since $(1)$ and $(2.2)$ already do not lie in $(0,\pi/2)$, we need only show that on $(2.1)$ having all $\theta$'s coincide and be nonzero does not achieve a minimum. We will do so via explicit calculations.


Let $m=\lfloor A\rfloor \in \mathbb{Z}$. It's easy to see that at most $m$ of the $\theta$'s may be $0$. For each $k=0,1,\dots,m$, we will calculate the sum $S(k,A)$ of $N$ sines, where $k$ of them are $0$ and the other $N-k$ coincide and are such that the $A$-constraint is satisfied.

We denote the nonzero angle simply by $\theta$. The constraint implies that

$$(N-k)\cos(\theta)=A-k\implies \cos(\theta)=\frac{A-k}{N-k}$$

It follows that that

$$\sin(\theta)=\frac{\sqrt{{(N-k)}^2-{(A-k)}^2}}{N-k}\,,$$

so the sum of sines is

$$S(k,A)=\sqrt{{(N-k)}^2-{(A-k)}^2}=\sqrt{(N^2-A^2)-2k(N-A))}\,.$$

We see readily that $S(k,A)$ is decreasing in $k$, which concludes the proof. $\square$


Now, what is the actual minimum? We see that $S(m,A)$ is the least of the $S(k,A)$'s, but to find the minimum it suffices to check the values of $(2.2)$. Since we've come all the way here, we might as well do it.

In this last case, there are some $k$ angles $0$, some $l$ angles $\pi/2$, and the rest coincide. The $A$ constraint becomes

$$(N-k-l)\cos(\theta)=A-k\implies \cos(\theta)=\frac{A-k}{N-k-l}$$

Then

$$\sin(\theta)=\frac{\sqrt{{(N-k-l)}^2-{(A-k)}^2}}{N-k-l}\,,$$

and the sum of sines is

\begin{align} S(k,l,A)&=l+\sqrt{{(N-k-l)}^2-{(A-k)}^2}\\ %&=l+\sqrt{(N^2-A^2)-2k(N-A))+l^2-2l(N-k)}\,. \end{align}

Well, is this more or less than $S(k,A)=S(k,0,A)$? To answer this, we will consider $g(l)=S(k,l,A)$ as a real function of $l$. We have that

\begin{align} g'(l)&=1-\frac{N-k-l}{\sqrt{{(N-k-l)}^2-{(A-k)}^2}}\\ &=1-\frac{1}{\sin(\theta)}\leq 0 \end{align}

Therefore, for any given, fixed $k$, we're better off with as high an $l$ as we can afford. The constraints that must be satisfied are

$$\left\{\begin{array}{l} k+l\leq N\\ 0 \leq k \leq \lfloor A \rfloor\\ N-l\geq A\implies l \leq N-A \end{array}\right.$$

Notice that the last two imply the first one. Thus, for each $k=0,1,\dots,\lfloor A \rfloor$, the best $l$ is always $\lfloor N - A \rfloor=N-\lceil A \rceil$, and we have that

\begin{align} S_{\min}(k,A)=S(k,N-\lceil A \rceil, A)&=N-\lceil A \rceil + \sqrt{{(\lceil A \rceil-k)}^2-{(A-k)}^2}\\ &=N-\lceil A \rceil+\sqrt{({\lceil A \rceil}^2-A^2)-2k(\lceil A \rceil-A)} \end{align}

which once again decreases in $k$.

Finally, the minimum is hence when $k$ is maximum. In other words, we're better off taking as many $\theta$'s equal to $0$ and as many $\theta$'s equal to $\pi/2$ as we can. This yields that the minimum is

\begin{align} &N-\lceil A \rceil+ \sqrt{({\lceil A \rceil}^2-A^2)-2\lfloor A \rfloor(\lceil A \rceil-A)}\\ =&N-\lceil A \rceil + \sqrt{{(\lceil A \rceil-\lfloor A \rfloor)}^2-{(A-\lfloor A \rfloor)}^2} \end{align}

  • 0
    Thank you for your comprehensive reply2017-02-06
2

Fimpellizieri is right, Lagrange Multipliers is the way forwards. \begin{eqnarray*} \mathcal{L}=\sum_{n=1}^N \sin \theta_n - \lambda \left( \sum_{n=1}^N \cos \theta_n -A\right) \end{eqnarray*} Now partially differentiate this \begin{eqnarray*} \frac{\partial \mathcal{L}}{\partial \theta_n}= \cos \theta_n + \lambda \sin \theta_n \end{eqnarray*} Set this equal to zero and we have \begin{eqnarray*} \lambda = -\tan \theta_n \end{eqnarray*} So Winther is right too, all of the $\theta$ values are equal. The constraint gives \begin{eqnarray*} \cos \theta_n = \frac{A}{N} \end{eqnarray*} and the optimal value is
\begin{eqnarray*} \sum_{n=1}^N \sin \theta_n = \sqrt{N^2-A^2} \end{eqnarray*}

  • 0
    You also need to check the boundary: Lagrange multipliers only give you extremal points in the interior of the domain. For example if $N=3$ and $A=1$ then you get $\sqrt{3^2-1^2} = \sqrt{8}$ as the minimum. However if I pick $\theta_1 = 0$ and $\theta_2 = \theta_3 = \pi/2$ then $\sum \cos\theta_k = A = 1$ while $\sum \sin\theta_k = 2 < \sqrt{8}$.2017-01-31
  • 0
    @Winther Lagrange multipliers give you all extremal points if you include all multipliers for all constraints in the problem. Also, $\theta_{1}=0$ is not admissible in the problem as stated.2017-01-31
  • 1
    @Donald Splutterwit You are picking a maximum.2017-01-31
  • 0
    @Jan (1) The constraint surface here has a boundary and a boundary point can be a extremal point without being a critical point (2) It does not matter for my argument if $0$ is not allowed or not: tune it slightly away from $0$ and you will have a valid counter-example to the claimed minimum here (also the minimum value is not attained if we don't allow values on the boundary). (3) You are correct that this answer acctually computes the maximum.2017-01-31
  • 0
    @Winther 2) completely agree and should have mentioned that in my previous comment. 1) I am not sure here but do not want to get into extended discussion here due to space limitations, but I thought that the Kuhn-tucker theorem says that if $x$ is a local extremum and satisfies complementary slackness, then $x$ solves the first order conditions + complementary slackness etc. In any case, checking the boundaries separately is a good practice anyway.2017-01-31
  • 0
    "Lagrange Multipliers is the way forwards" Well... no.2017-01-31
  • 0
    @Donald Splutterwit, Thanks a lot for your answer2017-02-06
1

In the plot below, $n=2$ and the plot is over $\theta_{1}$, where $\theta_{2}$ is a solution to $\cos\theta_{1}+\cos\theta_{2}=c$, that is $\theta_{2}=\arccos{(c-\cos\theta_{1})}$. The blue line is for $c=\frac{1}{2}$, the magenta line is for $c=1$ and the yellow line is for $c=\frac{3}{2}$. What the plot shows is that your problem probably has no solution.

enter image description here

  • 0
    No **analytical** solution, yes (since there always exists one or several minimizers, by compacity).2017-01-31
  • 0
    @Did the problem is not compact.2017-01-31
  • 1
    Hmmm... The set $[0,\pi/2]^N$ seems pretty compact to me, as well as its intersection with the set of equation $\sum\limits_n\cos\theta_n=A$, for each $A$ in $[0,N]$.2017-01-31
  • 0
    @Did But the question reads $\theta_{n}\in(0,\pi/2)$.2017-01-31
  • 0
    @Jan Thank you so much!2017-02-06