Setting up the Lagrangian Multipliers method for spherical coords

In summary: If ##u = a##, then ##u## is on the boundary of the admissible region, and the condition ##\partial F / \partial u \geq 0## means that if we move ##u## a little more to the left, then the function ##F(u,v)## will decrease. Similarly, if ##v## is on the boundary and we have ##\partial F / \partial v \geq 0## (or ##\partial F / \partial v \leq 0## for a maximization problem), then ##F(u,v)## will decrease (or increase) if we move ##v## a little more in the appropriate direction.If we are in the interior of the
  • #1
preet
98
0
This isn't really a homework question, but may be similar to a typical example problem so I posted it here.

Homework Statement


I want to find the max and min dot product of a 3d vector and all points in a sphere constrained by angles in spherical coordinates.

Homework Equations


A point on the sphere can be expressed using spherical parameters (R is constant) as:
[itex]x=R*sin\theta*cos\phi[/itex]
[itex]y=R*sin\theta*sin\phi[/itex]
[itex]z=R*cos\theta[/itex]

The Attempt at a Solution


The dot product between any point on the sphere and a vector [A,B,C] can be written as:
[itex] f(\theta,\phi) = A*R*sin\theta*cos\phi + B*R*sin\theta*sin\phi + R*cos\theta [/itex]

We can set some constraint [itex]\theta = \theta_A[/itex] on [itex]f[/itex] and then find the extrema to find the max and min.

From Wikipedia, I can set up Lagrange Multipliers with my function and the constraint using
[itex] \Lambda(x,y,\lambda) = f(x,y) + \lambda \cdot \Big(g(x,y)-c\Big), [/itex]
and solve
[itex] \nabla_{x,y,\lambda} \Lambda(x , y, \lambda)=0. [/itex]

The problem is I'm not sure how to set up the gradient. I know that the gradient has a slightly different definition in spherical coordinates. Which definition of the gradient should I be using here?
 
Physics news on Phys.org
  • #2
preet said:
This isn't really a homework question, but may be similar to a typical example problem so I posted it here.

Homework Statement


I want to find the max and min dot product of a 3d vector and all points in a sphere constrained by angles in spherical coordinates.

Homework Equations


A point on the sphere can be expressed using spherical parameters (R is constant) as:
[itex]x=R*sin\theta*cos\phi[/itex]
[itex]y=R*sin\theta*sin\phi[/itex]
[itex]z=R*cos\theta[/itex]

The Attempt at a Solution


The dot product between any point on the sphere and a vector [A,B,C] can be written as:
[itex] f(\theta,\phi) = A*R*sin\theta*cos\phi + B*R*sin\theta*sin\phi + R*cos\theta [/itex]

I believe this should be
[tex]
f(\theta, \phi) = AR\sin\theta \cos \phi + BR\sin\theta \sin\phi + CR\cos\theta
[/tex]

We can set some constraint [itex]\theta = \theta_A[/itex] on [itex]f[/itex] and then find the extrema to find the max and min.

From Wikipedia, I can set up Lagrange Multipliers with my function and the constraint using
[itex] \Lambda(x,y,\lambda) = f(x,y) + \lambda \cdot \Big(g(x,y)-c\Big), [/itex]
and solve
[itex] \nabla_{x,y,\lambda} \Lambda(x , y, \lambda)=0. [/itex]

The problem is I'm not sure how to set up the gradient. I know that the gradient has a slightly different definition in spherical coordinates. Which definition of the gradient should I be using here?

You don't need a Lagrange multiplier here; you can just maximize [itex]f(\theta,\phi)[/itex] subject to the limits on [itex]\theta[/itex] and [itex]\phi[/itex]. It is possible that extrema will occur on the boundary.

If you had kept the dot product in terms of cartesian coordinates then you would need a Lagrange multiplier to enforce the constraint [itex]x^2 + y^2 + z^2 = R^2[/itex], but when working in spherical coordinates that constraint is automatically enforced.

The form of the gradient here is [tex]
\frac1R \frac{\partial f}{\partial \theta}\mathbf{e}_\theta + \frac{1}{R \sin \theta} \frac{\partial f}{\partial \phi}\mathbf{e}_\phi[/tex]
 
  • #3
Thanks for the reply.

You don't need a Lagrange multiplier here; you can just maximize [itex]f(θ,ϕ)[/itex] subject to the limits on [itex]θ[/itex] and [itex]ϕ[/itex]. It is possible that extrema will occur on the boundary.

I misstated my original constraint. Its an inequality constraint of the form [itex]\theta_K \leq \theta \leq \theta_L[/itex] (and [itex]\phi_M \leq \phi \leq \phi_N[/itex] as well). I can take the partial derivates:

[itex]\frac{\partial f}{\partial \theta}[/itex] and [itex]\frac{\partial f}{\partial \phi}[/itex]

And set them = 0 to find critical points. Not really sure how to proceed with the inequality constraints I mentioned though. If the critical point lies within the range, that's fine... but it likely won't. What do I do in the general case (sorry if its obvious)?
 
  • #4
If there aren't any critical points in the region, then it follows that the extreme values should lie on the boundary of the region (assuming it's a nice function).
 
  • #5
preet said:
This isn't really a homework question, but may be similar to a typical example problem so I posted it here.

Homework Statement


I want to find the max and min dot product of a 3d vector and all points in a sphere constrained by angles in spherical coordinates.

Homework Equations


A point on the sphere can be expressed using spherical parameters (R is constant) as:
[itex]x=R*sin\theta*cos\phi[/itex]
[itex]y=R*sin\theta*sin\phi[/itex]
[itex]z=R*cos\theta[/itex]

The Attempt at a Solution


The dot product between any point on the sphere and a vector [A,B,C] can be written as:
[itex] f(\theta,\phi) = A*R*sin\theta*cos\phi + B*R*sin\theta*sin\phi + R*cos\theta [/itex]

We can set some constraint [itex]\theta = \theta_A[/itex] on [itex]f[/itex] and then find the extrema to find the max and min.

From Wikipedia, I can set up Lagrange Multipliers with my function and the constraint using
[itex] \Lambda(x,y,\lambda) = f(x,y) + \lambda \cdot \Big(g(x,y)-c\Big), [/itex]
and solve
[itex] \nabla_{x,y,\lambda} \Lambda(x , y, \lambda)=0. [/itex]

The problem is I'm not sure how to set up the gradient. I know that the gradient has a slightly different definition in spherical coordinates. Which definition of the gradient should I be using here?

The "gradient" referred to in that article is not the "gradient vector" as understood in physics; it is just the collection of partial derivatives. Therefore, in any coordinate system ##(u,v)##, with ##x = \xi(u,v)## and ##y = \eta(u,v)## and with new Lagrangian ##M(u,v,\lambda) = F(u,v) + \lambda G(u,v)## (where ##F(u,v) = f(\xi(u,v),\eta(u,v))##, etc) we just have
[tex] \frac{\partial M}{\partial u} = 0, \: \frac{\partial M}{\partial v} = 0.[/tex]

However, these conditions do not hold in general in inequality-constrained problems; if fact, you need the so-called Karush-Kuhn-Tucker condtions. For a problem of the form
[tex] \min F(u,v)\\
\text{subject to } \: G(u,v) = 0\\
\text{and } \: a \leq u \leq b, \: c \leq v \leq d \\
a,b,c,d \:\text{= constants}
[/tex]
we have the following. Setting ##M = F + \lambda G##, the necessary conditions for ##(u,v)## to be a (local) constrained minimum are:
[tex]
\begin{array}{l}
\partial M/ \partial u \geq 0 \text{ if } u = a\\
\partial M/ \partial u \leq 0 \text{ if } u = b\\
\partial M/ \partial u = 0 \text{ if } a < u < b\\
\\
\partial M/ \partial v \geq 0 \text{ if } v = c\\
\partial M/ \partial v \leq 0 \text{ if } v = d\\
\partial M/ \partial v = 0 \text{ if } c < v < d
\end{array}[/tex]

For a maximization problem the inequalities should be swapped in the above.

To understand those conditions intuitively (and to help you to remember them) just think of minimizing a 1-variable function ##f(x)## on an interval ##[a,b]##. If the minimum occurs at the left-hand endpoint ##x = a## the function ##f## must be going up (increasing) near ##x = a##---or at least, not be strictly decreasing there. So, we need ##f'(a) \geq 0##. Similarly you need ##f'(b) \leq 0## at the right-hand endpoint ##x = b##. The inequalities should be opposite if you are maximizing instead of minimizing. The conditions given previously just apply these ideas to the multivariate version and use the Lagrangian instead of the function ##F## itself.
 
Last edited:

Related to Setting up the Lagrangian Multipliers method for spherical coords

1. What is the Lagrangian Multipliers method for spherical coordinates?

The Lagrangian Multipliers method for spherical coordinates is a mathematical technique used to optimize a function subject to one or more constraints. It involves finding the stationary points of the Lagrangian function, which is a combination of the original function and one or more constraint equations.

2. How do you set up the Lagrangian Multipliers method for spherical coordinates?

To set up the Lagrangian Multipliers method for spherical coordinates, you will need to first identify the function you want to optimize and the constraints that must be satisfied. Then, you will need to define the Lagrangian function by combining the original function and constraint equations. Finally, you will need to take the partial derivatives of the Lagrangian function with respect to each variable and set them equal to zero to find the stationary points.

3. Why is the Lagrangian Multipliers method useful for spherical coordinates?

The Lagrangian Multipliers method is useful for spherical coordinates because it allows you to optimize a function while taking into account any constraints that may exist. This is particularly helpful in situations where the constraints are difficult to incorporate directly into the original function.

4. What are some applications of the Lagrangian Multipliers method for spherical coordinates?

The Lagrangian Multipliers method for spherical coordinates has many applications in physics, engineering, and mathematics. It can be used to optimize physical systems such as satellites orbiting around a planet, to solve optimization problems in economics and finance, and to find the extrema of multivariable functions in calculus.

5. Are there any limitations to using the Lagrangian Multipliers method for spherical coordinates?

Like any mathematical technique, the Lagrangian Multipliers method for spherical coordinates has its limitations. It may not always be possible to find a closed-form solution, and the method can become computationally intensive for complex functions and constraints. Additionally, the method assumes that the constraints are independent, which may not always be the case.

Similar threads

Back
Top