Gradient and Hessian of the Coulomb/Electrostatic Energy

AI Thread Summary
The discussion centers on calculating the gradient and Hessian of the Coulomb potential energy function, V, defined for a system of charges. The potential is expressed as a function of the positions of the charges, and there is confusion regarding the representation of the distance between charge vectors, r_i, which should be treated as vectors rather than scalar distances. The participants clarify that the correct form involves the square root of the squared differences in coordinates between charge pairs. Additionally, there is a focus on how to optimize V despite its divergence when charges approach each other, prompting questions about boundary conditions and the overall optimization strategy. The conversation emphasizes the importance of clear notation and accurate representation of the mathematical relationships involved.
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.
 
Thread 'Motional EMF in Faraday disc, co-rotating magnet axial mean flux'
So here is the motional EMF formula. Now I understand the standard Faraday paradox that an axis symmetric field source (like a speaker motor ring magnet) has a magnetic field that is frame invariant under rotation around axis of symmetry. The field is static whether you rotate the magnet or not. So far so good. What puzzles me is this , there is a term average magnetic flux or "azimuthal mean" , this term describes the average magnetic field through the area swept by the rotating Faraday...

Similar threads

Replies
12
Views
2K
Replies
12
Views
2K
Replies
19
Views
2K
Replies
3
Views
3K
Replies
1
Views
1K
Replies
3
Views
2K
Replies
6
Views
2K
Back
Top