Problem applying Lennard jones equation for large scale
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Roberto Castillejo Castillo
el 14 de Jul. de 2019
Comentada: Cristian Garcia Milan
el 14 de Jul. de 2019
Hi,
I am working on a project which is based on lennard jones potential. I'm trying to make a simulation for two points (or particles) but it doesn't work correctly. In my view, I think it's because this model is used to work with particles instead of large-scale problems. What could I do?
I consider that one particle is without moving.
You can see below the code. Thanks a million

clc
close all
clear all
epsilon = 5;
sigma = 2;
% initial position of A and B particles
a = [2 3];
b = [2 8];
% List of forces
f_list = zeros(30,1);
for k = 1:30
% unit vector
ba = a-b;
dab = norm(b-a);
unit_vector = ba /dab;
% force as negative gradient of lennard jones potential
f = 4*epsilon*((12*(sigma^12)/dab^13)-(6*(sigma^6)/dab^7));
f_list(k,:)= f;
force = unit_vector * f;
% new position
a = a + 0.1 * force;
scatter(a(1),a(2));
hold on
scatter(b(1),b(2));
pause(0.1)
end
1 comentario
Cristian Garcia Milan
el 14 de Jul. de 2019
Can you say me what is your exatc problem? I see that you are adding the force multiply by 0.1 to the position and I think it should be to the velocity and the velocity shjould be added to the position.
Respuestas (0)
Ver también
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!