Gradient and Hessian of the Coulomb/Electrostatic Energy

Click For Summary

Discussion Overview

The discussion centers around the calculation of the gradient and Hessian of the Coulomb potential energy function for a system of charges. Participants explore the mathematical formulation and notation involved in deriving these derivatives, as well as the implications of the potential's divergence when charges approach each other.

Discussion Character

  • Technical explanation
  • Mathematical reasoning
  • Debate/contested

Main Points Raised

  • One participant presents the Coulomb potential energy function and seeks to calculate its gradient and Hessian for optimization purposes, treating the coordinates as independent variables.
  • Another participant corrects the first by stating that the expression for ##r_i## should be a vector and not a scalar, emphasizing the need for the correct distance formula between charge vectors.
  • A later reply expresses confusion about the notation and asks for clarification on how to calculate the gradient and Hessian without the initial notation.
  • Some participants raise concerns about the divergence of the potential energy when charges approach each other, questioning how this affects the optimization process and whether there are boundary conditions to consider.
  • Further clarification is provided regarding the representation of the coordinates and the intention behind the optimization, with a focus on the transformation of coordinates for clarity.

Areas of Agreement / Disagreement

Participants generally agree on the need for clarity in notation and the mathematical formulation of the problem. However, there is disagreement regarding the correct representation of the distance between charge vectors and the implications of potential divergence, leaving the discussion unresolved.

Contextual Notes

Participants express uncertainty regarding the assumptions made in the formulation of the potential energy and its derivatives, particularly in relation to the behavior of the function as charges approach each other.

decerto
Messages
84
Reaction score
2
I have a function

$$\displaystyle V(x)=\frac{1}{2}\sum_i \sum_{j \neq i} q_i q_j \frac{1}{\left|r_i - r_j\right|}$$ where ##r_i=\sqrt{x_i^2+y_i^2+z_i^2}## which is the coulomb potential energy of a system of charges.

I need to calculate ##\frac{\partial V}{\partial x_k}## and ##\frac{\partial^2 V}{\partial x_k \partial x_l}## for an optimization routine.

I guess I want to treat the set ##(x_i , y_i, z_i)## where i runs from 1 to N as independent variables ##(x_j)## where j runs from 1 to 3N (the direct sum of the position vectors).

Would ##r_i = \sqrt{x_{3i-2}+x_{3i-1}+x_{3i}}## then?

I ask because but I am not sure how to calculate the ##\frac{\partial r_i}{\partial x_k}## term

I was also thinking maybe I can just calculate ##\frac{\partial r_i}{\partial x_k}, \frac{\partial r_i}{\partial y_k}, \frac{\partial r_i}{\partial z_k}## separately and then just relabel them as independent variables but I am not sure if this will work.

Any help would be appreciated
 
Last edited by a moderator:
Physics news on Phys.org
Hi,

##r_i## is not ##\sqrt{x_i^2+y_i^2+z_i^2}## !
## r_i ## is simply a vector ##\vec r_i = (x_i, y_i,z_i)## !
You need ##| \vec r_i - \vec r_j | ## which is the square root of ## (\vec r_i - \vec r_j) \cdot (\vec r_i - \vec r_j) ##

In your notation (somewhat awkward) this would be $$
| \vec r_i - \vec r_j | = \sqrt{ ( x_{3i-2} - x_{3j-2} )^2 + ( x_{3i-1} - x_{3j-1} )^2 + ( x_{3i} - x_{3j} )^2 }
$$
 
BvU said:
Hi,

##r_i## is not ##\sqrt{x_i^2+y_i^2+z_i^2}## !
## r_i ## is simply a vector ##\vec r_i = (x_i, y_i,z_i)## !
You need ##| \vec r_i - \vec r_j | ## which is the square root of ## (\vec r_i - \vec r_j) \cdot (\vec r_i - \vec r_j) ##

In your notation (somewhat awkward) this would be $$
| \vec r_i - \vec r_j | = \sqrt{ ( x_{3i-2} - x_{3j-2} )^2 + ( x_{3i-1} - x_{3j-1} )^2 + ( x_{3i} - x_{3j} )^2 }
$$

Thanks for that correction, bit of an oversight!

How would you suggest I calculate the gradient and the hessian analytically without that notation?
 
Your ##V## looks an awful lot like the ##\ \ W\quad (1.51)\ \ ## in my 1974 Jackson 2nd edition, except that ##W## is a scalar and you write ##V(x)##. What does this ##x## stand for ? And how do you intend to optimize if ##V## diverges when ##\vec r_i \rightarrow \vec r_j ## ? Are there any boundary conditions ? In short: could you tell us a little more of your plans :smile: ?
 
BvU said:
Your ##V## looks an awful lot like the ##\ \ W\quad (1.51)\ \ ## in my 1974 Jackson 2nd edition, except that ##W## is a scalar and you write ##V(x)##. What does this ##x## stand for ? And how do you intend to optimize if ##V## diverges when ##\vec r_i \rightarrow \vec r_j ## ? Are there any boundary conditions ? In short: could you tell us a little more of your plans :smile: ?

Sorry V is the coulomb potential for a system of charges each with position ##r_i=(x_i, y_i, z_i)##, it is a scalar function as you say of these positions. I want to create a gradient ##\frac{\partial V}{\partial x_k}## and a hessian ##\frac{\partial^2 V}{\partial x_k \partial x_l}## where the coordinates ##x_k## are the direct sum of the ##(x_i, y_i, z_i)##

So for a system of two charges I would have ##r_1=(x_1, y_1, z_1) \ , \ r_2=(x_2, y_2, z_2)## so ##\textbf{x}=(x_1, y_1, z_1, x_2, y_2, z_2)## and my gradient would look like ##(\frac{\partial V}{\partial x_1}, \frac{\partial V}{\partial y_1}, \frac{\partial V}{\partial z_1}, \frac{\partial V}{\partial x_2}, \frac{\partial V}{\partial y_2}, \frac{\partial V}{\partial z_2})##

I originally thought it would be a good idea to rewrite ##\textbf{x}=(x_1, y_1, z_1, x_2, y_2, z_2)## as ##(x_1, x_2, x_3, x_4, x_5, z_6)## using the coordinate transformations ##x_i \to x_{3i-2}, \ y_i \to x_{3i-1}, \ z_i \to x_{3i}## but as you said the notation is clunky.
 

Similar threads

  • · Replies 5 ·
Replies
5
Views
1K
  • · Replies 12 ·
Replies
12
Views
3K
  • · Replies 3 ·
Replies
3
Views
932
  • · Replies 12 ·
Replies
12
Views
2K
  • · Replies 19 ·
Replies
19
Views
3K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 3 ·
Replies
3
Views
4K
  • · Replies 3 ·
Replies
3
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K
Replies
4
Views
2K