Python Lennard-Jones Force Formula Python Program

Click For Summary
The discussion revolves around understanding the concepts of characteristic binding energy and characteristic molecular size within the context of the Lennard-Jones formula used in a Python coding assignment. The characteristic binding energy represents the minimum energy needed to break the bond between two particles, while the characteristic molecular size indicates the distance at which the force between particles is zero. The user is attempting to implement a function to calculate the force between two particles but is encountering issues with the resulting plot, which starts high and quickly drops to zero. Suggestions include experimenting with different values for binding energy and molecular size to observe their effects on the plot, as well as ensuring that the units for each variable are consistent to better understand the formula's behavior. The importance of plotting potential energy instead of force for a clearer view of particle interactions is also highlighted.
eximius
Messages
29
Reaction score
0
I'm not looking for the answer, I just want some help with understanding the question. The main thing I'm stuck on is the characteristic binding energy and the characteristic molecular size. I've tried searching for these but I'm finding a lot of different stuff.

Homework Statement


All to be done in Python.
physforumsq.jpg


Homework Equations



F = (-24*bind)*(((2.0/r)*(sigma/r)**12) -((1.0/r)*(sigma/r)**6))

The Attempt at a Solution



This is what I've done so far. I'm not even sure if the formula function is correct. Because the plot I get begins at a high value fort the Force but falls quickly to zero and remains at zero.

Code:
def lgfunc(bind,sigma,r):
    '''
    Function to calculate force between two particles using
    Lennard-Jones formula
    '''
    F = (-24*bind)*(((2.0/r)*(sigma/r)**12) -((1.0/r)*(sigma/r)**6))
    
    return F
  
#For H2 -
  
bind = 4.48*1.6e-19
sigma = 2.92e-10
r = linspace(0,5e-9,50000)

plot(r,lgfunc(bind,sigma,r),'r.')


Any and all help would be greatly appreciated. Thanks
 
Technology news on Phys.org


I can provide some clarification on the terms "characteristic binding energy" and "characteristic molecular size" in the context of the Lennard-Jones formula you are working with.

The characteristic binding energy in this formula refers to the minimum energy required to break the bond between two particles. In other words, it is the energy at which the force between the particles becomes zero. In your code, this is represented by the variable "bind," which is multiplied by -24 in the formula.

The characteristic molecular size, on the other hand, refers to the distance at which the force between the particles is zero. In the Lennard-Jones formula, this is represented by the variable "sigma." This value is typically the distance at which the potential energy between the particles is at its minimum.

In terms of understanding the formula itself, it may be helpful to plot it with different values for "bind" and "sigma" to see how they affect the shape of the curve. You can also try plotting the potential energy (rather than the force) to get a better sense of how these variables impact the overall interaction between the particles.

Additionally, I would recommend looking into the units for each variable in the formula to ensure that they are all consistent. This may also help with understanding the behavior of the plot.

I hope this helps! Let me know if you have any other questions or if you need further clarification. Happy coding!
 
I tried a web search "the loss of programming ", and found an article saying that all aspects of writing, developing, and testing software programs will one day all be handled through artificial intelligence. One must wonder then, who is responsible. WHO is responsible for any problems, bugs, deficiencies, or whatever malfunctions which the programs make their users endure? Things may work wrong however the "wrong" happens. AI needs to fix the problems for the users. Any way to...

Similar threads

  • · Replies 2 ·
Replies
2
Views
8K
  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 3 ·
Replies
3
Views
4K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
Replies
9
Views
3K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 1 ·
Replies
1
Views
1K
Replies
3
Views
4K