How do I find the coordinates of the point at which the derivative is 0?

1 vue (au cours des 30 derniers jours)
Rhianne Tallarico
Rhianne Tallarico le 20 Fév 2018
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')

Réponses (1)

Walter Roberson
Walter Roberson le 20 Fév 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) );

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by