Plotting Lennard-Jones Potential

19 Ansichten (letzte 30 Tage)
Nate Downs
Nate Downs am 23 Jan. 2020
Beantwortet: Sindar am 23 Jan. 2020
Hi. I'm trying to plot the Lennard-Jones potential and am making my first script to do so. However, whenever I try to plot the function, I'm not getting anything out. What am I doing wrong?
U = @(e,s,r) 4*e*((s./r).^12 - (s./r).^6); % Lennard-Jones
r = .13: .13: .13; %radius
e1 = 0.70641 ; %Fe-Fe
e2 = 1.11195 ; %Mo-Mo
e3 = 0.67322 ;%Cr-Cr
r01 = 0.0226738 ; %Angstroms
r02 = 0.0248919 ; %Angstroms
r03 = 0.0228130 ; %Angstroms
s1 = 4.327 ; %potential energy
s2 = 6.812 ; %potential energy
s3 = 4.129 ; %potential energy
plot( r, s1, r, s2, r, s3);
title("Fe, Mo, Cr");
xlabel("distance"); ylabel("potential energy");
grid
ylim([-2 2])

Antworten (1)

Sindar
Sindar am 23 Jan. 2020
It looks like you are only plotting single points, so you might miss them in the plot. Also, what is the purpose of U in this script?

Kategorien

Mehr zu Glaciology finden Sie in Help Center und File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by