Azzera filtri
Azzera filtri

Find function's minimum for specific constant values

1 visualizzazione (ultimi 30 giorni)
I have a function mew which is a derivative of another function, fun:
syms v a b
fun = -a*v + (2*b*v^(2/3))/(exp(0.5) - 2*(v^(1/3))*log(exp(0.5)*v^(1/3)));
mew=diff(fun,v)
I must find mew's minimum for a=0, b=1.3
How?

Risposte (2)

Walter Roberson
Walter Roberson il 4 Giu 2018
G = subs(mew, [a, b], [0, 1.3]);
sol = solve(G);
mewmin = subs(G, v, sol)
crosscheck = subs(G, v, sol+1)
The reason for doing the crosscheck is that solve() is only able to find a single numeric root, and without further checking you do not know whether it will be a maxima or a minima. The fact that the crosscheck comes out with a larger value (less negative) than the min gives evidence that we are indeed working with a minima not a maxima. But you should really look at sign( subs(diff(mew), v, sol ) to be sure.
  2 Commenti
Walter Roberson
Walter Roberson il 4 Giu 2018
Note that if there are multiple minima then this will not find them all to check which is the global minimum.
Walter Roberson
Walter Roberson il 5 Giu 2018
MATLAB finds sol as
6396480385065521911547770910773962672562070583/(1427247692705959881058285969449495136382746624*lambertw(0, (3445831591435597800619981388529*exp(-1))/1267650600228229401496703205376)^3)
However, if you change the exp(0.5) to exp(sym(0.5)) then the more accurate solution is
exp(3/2)/LambertW(1)^3

Accedi per commentare.


Sid Parida
Sid Parida il 4 Giu 2018
Try this:
You can play wit the lb, and ub to get the global minimum:
syms v a b
fun = -a*v + (2*b*v^(2/3))/(exp(0.5) - 2*(v^(1/3))*log(exp(0.5)*v^(1/3)));
mew = diff(fun,v);
subbed_ab = matlabFunction(subs(mew, {a, b}, {0.0, 1.3}));
lower_bound = -100000;
upper_bound = 100000;
min_val= fminbnd(subbed_ab, lower_bound, upper_bound);
  3 Commenti
Valeria
Valeria il 5 Giu 2018
Matlab doesn't recognize its own function, although it is in its help file... Whattt

Accedi per commentare.

Tag

Community Treasure Hunt

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

Start Hunting!

Translated by