Lennard-Jones Force Formula Python Program

Click For Summary
SUMMARY

The discussion focuses on implementing the Lennard-Jones force formula in Python, specifically addressing the characteristic binding energy and molecular size. The formula used is F = (-24*bind)*(((2.0/r)*(sigma/r)**12) -((1.0/r)*(sigma/r)**6)). The user is advised to experiment with different values for the binding energy (bind) and molecular size (sigma) to observe their effects on the force curve. Additionally, ensuring unit consistency for all variables is crucial for accurate results.

PREREQUISITES
  • Understanding of the Lennard-Jones potential
  • Familiarity with Python programming
  • Knowledge of plotting libraries in Python, such as Matplotlib
  • Basic concepts of molecular physics
NEXT STEPS
  • Learn about the Lennard-Jones potential and its applications in molecular simulations
  • Explore Python's Matplotlib library for advanced plotting techniques
  • Investigate unit consistency in physical formulas
  • Study the effects of varying parameters in force and potential energy plots
USEFUL FOR

This discussion is beneficial for physics students, computational chemists, and Python developers interested in molecular modeling and simulations using the Lennard-Jones potential.

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!
 

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 ·
Replies
9
Views
3K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 1 ·
Replies
1
Views
1K
Replies
3
Views
4K