y = r^2 (0.5) - r^3
I am trying to get maximum point on this graph from range 0 to 0.5. Can some one help??
Plot[y, {r, 0, 0.5}]
y = r^2 (0.5) - r^3
I am trying to get maximum point on this graph from range 0 to 0.5. Can some one help??
Plot[y, {r, 0, 0.5}]
y = r^2 (0.5) - r^3;
max = NMaximize[{y, 0 < r < .5}, r]
pt = {r /. Last@max, First@max}
Plot[y, {r, 0, 0.5}, Epilog -> {PointSize[Large], Red, Point[pt]}]
ClearAll[f]
f[r_] := r^2 (0.5) - r^3
An alternative approach to mark the interior local maxima of a differentiable function f using MeshFunctions + Mesh + MeshStyle:
Plot[f[r], {r, 0, 0.5},
MeshFunctions -> {If[f''[#] <= 0, f'[#], 1] &},
Mesh -> {{0}},
MeshStyle -> Directive[Red, PointSize[Large]]]
Normal[%] /. p_Point :> {p, Text["maximum", p[[1]], {-1, -1}]}
Maximize[{r^2 (0.5) - r^3, 0 <r < .5}, r]– creidhne Dec 24 '20 at 11:41