How do I find the coordinates of the point at which the derivative is 0?
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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 commentaires
Réponses (1)
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) );
0 commentaires
Voir également
Catégories
En savoir plus sur Calculus dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!