필터 지우기
필터 지우기

Supremum of a concave function

조회 수: 3 (최근 30일)
Waqar Ahmed
Waqar Ahmed 2021년 1월 1일
답변: Walter Roberson 2021년 1월 2일
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
Image Analyst
Image Analyst 2021년 1월 1일
편집: Image Analyst 2021년 1월 1일
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?
John D'Errico
John D'Errico 2021년 1월 1일
편집: John D'Errico 2021년 1월 1일
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.

댓글을 달려면 로그인하십시오.

답변 (1개)

Walter Roberson
Walter Roberson 2021년 1월 2일
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
supermum = 
There is also a saddle point of f = 0 when v = c + A^t

카테고리

Help CenterFile Exchange에서 Calculus에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by