How do I find the coordinates of the point at which the derivative is 0?
1 view (last 30 days)
Show older comments
e=1;
sigma=0.154;
r=linspace(0.154,1,100);
U = @(r) 4*e*((sigma./r).^12)-((sigma./r).^6);
norm_r = r./sigma;
figure
plot(norm_r,U(r))
title('Lennard-Jones Potential')
xlabel('Distance (nm)')
ylabel('Potential Energy')
0 Comments
Answers (1)
Walter Roberson
on 20 Feb 2018
If you have the Symbolic Toolbox, then
r=linspace(0.154,1,100);
syms R real
location_of_zero_deriv = solve(diff(U(R),R),R);
mask = location_of_zero_deriv >= r(1) & location_of_zero_deriv <= r(end);
location_of_zero_deriv = double( location_of_zero_deriv(mask) );
0 Comments
See Also
Categories
Find more on Calculus in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!