function [ f ] = Untitled12( x)
n=100;T=10;R=54;D=22; x0=(1); A=[];b=[];Aeq=[];beq=[]; VLB=(1);VUB=[];
f=n*(1/x)*(1-1/x)^(n-1);
function [C,Ceq]=nonlcon(x)
C=T/(1-(1/(R-x)))^(n-1)-D;
Ceq=[];
[x,fval]=fmincon(Untitled12,x0,A,b,Aeq,beq,VLB,VUB,nonlcon);
end
holdtom