Setting up the Lagrangian Multipliers method for spherical coords

Click For Summary

Homework Help Overview

The discussion revolves around finding the maximum and minimum dot product of a 3D vector with points constrained on a sphere using spherical coordinates. The original poster expresses uncertainty about setting up the gradient for the Lagrangian multipliers method in this context.

Discussion Character

  • Exploratory, Assumption checking, Mathematical reasoning

Approaches and Questions Raised

  • Participants explore the formulation of the dot product in spherical coordinates and the application of Lagrange multipliers. There is a discussion on whether Lagrange multipliers are necessary given the constraints and the nature of the problem. Questions arise regarding the correct definition of the gradient in spherical coordinates and how to handle inequality constraints.

Discussion Status

Some participants suggest that Lagrange multipliers may not be needed and that extrema could occur on the boundary of the defined region. Others provide insights into the necessary conditions for constrained optimization, particularly in the context of inequality constraints.

Contextual Notes

The original poster clarifies that the constraints are inequalities, which adds complexity to the optimization problem. There is an acknowledgment of the need to consider boundary conditions when critical points do not lie within the specified ranges.

preet
Messages
96
Reaction score
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
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]
 
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)?
 
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).
 
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)\\<br /> \text{subject to } \: G(u,v) = 0\\<br /> \text{and } \: a \leq u \leq b, \: c \leq v \leq d \\<br /> 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}<br /> \partial M/ \partial u \geq 0 \text{ if } u = a\\<br /> \partial M/ \partial u \leq 0 \text{ if } u = b\\<br /> \partial M/ \partial u = 0 \text{ if } a < u < b\\<br /> \\<br /> \partial M/ \partial v \geq 0 \text{ if } v = c\\<br /> \partial M/ \partial v \leq 0 \text{ if } v = d\\<br /> \partial M/ \partial v = 0 \text{ if } c < v < d<br /> \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:

Similar threads

Replies
3
Views
2K
  • · Replies 14 ·
Replies
14
Views
3K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 7 ·
Replies
7
Views
2K
  • · Replies 3 ·
Replies
3
Views
3K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 7 ·
Replies
7
Views
3K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K