![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/476238/image.png)
Supremum of a concave function
3 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
I have a function I want to calculate its supremum. The function is below.
-0.25* (c+A^t-v)^T *(c+A^t-v)/v for all v>0
2 comentarios
Image Analyst
el 1 de En. de 2021
Editada: Image Analyst
el 1 de En. de 2021
numPoints = 1000;
v = linspace(0.02, 1, 1000);
% Guesses:
c = 1 * ones(1, numPoints);
A = 2 * ones(1, numPoints);
T = 2 * ones(1, numPoints);
t = 3 * ones(1, numPoints);
% Compute function
y = -0.25 * (c+A.^t-v).^T .* (c+A.^t-v)./v %for all v>0
% Plot it.
plot(v, y, 'b.-', 'LineWidth', 2);
grid on;
What are c, A, t, and T?
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/476238/image.png)
John D'Errico
el 1 de En. de 2021
Editada: John D'Errico
el 1 de En. de 2021
What do you know about c, A, t, and T? T is most important, of course. For example, if T is not an integer, then things are, let me say, difficult? That is because noninteger powers of negative numbers will be complex, so that supremem will be a nasty thing.
Respuestas (1)
Walter Roberson
el 2 de En. de 2021
This creates a list of supermum for the function, together with the conditions under which the supermum hold. The calculations would have been easier if we had been given more information about the symbols.
syms A t T v c;
f = -0.25* (c+A^t-v)^T *(c+A^t-v)/v;
df = diff(f,v);
sol = solve(df == 0,v,'returnconditions', true);
flavor = simplify(subs(diff(df,v),v,sol.v));
conditional_flavor = arrayfun(@(F,C) simplify(piecewise(C & F>0,symtrue,nan)), flavor, sol.conditions);
bs1 = [T == -1, T==0, T==1, T~=-1 & T~=0 & T~=1 & 1<real(T), T~=-1 & T~=0 & T~=1 & 1>real(T)];
bs2 = [c + A^t~=0, c + A^t==0];
branches = and(bs1, bs2(:));
for bidx = 1 : numel(branches)
assume(assumptions, 'clear')
assume(branches(bidx));
constrained_conditions(:,bidx) = simplify(conditional_flavor);
end
assume(assumptions, 'clear')
supermum= [];
for K = 1: size(constrained_conditions,1)
for bidx = find(~isnan(constrained_conditions(K,:)))
temp = arrayfun(@(C) simplify(piecewise(v == sol.v(K) & C, subs(f, v, sol.v(K)))), branches(bidx) & constrained_conditions(K,bidx));
supermum = [supermum; temp];
end
end
supermum
There is also a saddle point of f = 0 when v = c + A^t
0 comentarios
Ver también
Categorías
Más información sobre Calculus en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!