【发布时间】:2020-08-16 20:02:58
【问题描述】:
我实际上正在绘制 sigma=2.74 和 epsilon=0.0031 的 lj 电位曲线。下面是我的代码。
function [V,r]=lj(si,e)
for i=1:3
si=si*(1+(i-1)*0.1)
r=linspace(0.75,8,1000)*si;
V=4*e*((si./r).^12-(si./r).^6);
subplot(2,2,1)
plot((r/si),(V/e),'o')
h = gca(); // get current axes
h.data_bounds = [0.75, -2 ; 2.5, 2]
end
for i=1:3
e=e*(1+(i-1)*0.3)
r=linspace(0.75,8,1000)*si;
V=4*e*((si./r).^12-(si./r).^6);
subplot(2,2,2)
plot((r/si),(V/e),'r')
h = gca(); // get current axes
h.data_bounds = [0.75, -2 ; 2.5, 2]
end
endfunction
实际上,在上述情况下,我对不同的 sigma 和 epsilon 值进行了此操作,但我只得到一条曲线,在下面的代码中它运行良好(即,轴图仅在 x 和y 轴)。如果有人在我的第一个代码中进行了一些更改以获取各种价值,那就太好了。 下面是我的工作代码。
function [V,r]=lj(si,e)
for i=1:3
si=si*(1+(i-1)*0.1)
r=linspace(0.75,8,1000);
V=4*e*((si./r).^12-(si./r).^6);
subplot(2,2,1)
plot(r,V,'o')
h = gca(); // get current axes
h.data_bounds = [2, -0.01 ; 6, 0.01]
end
for i=1:3
e=e*(1+(i-1)*0.3)
r=linspace(0.75,8,1000);
V=4*e*((si./r).^12-(si./r).^6);
subplot(2,2,2)
plot(r,V,'r')
h = gca(); // get current axes
h.data_bounds = [2, -0.01 ; 6, 0.01]
end
endfunction
【问题讨论】:
标签: scilab computation-theory computation