%
% OPTCONDVP  Optimally conditioned
%   Vandermonde matrix with nonnegative
%   nodes
%
n=10;
A=zeros(n-1,n); Aeq=zeros(1,n);
b=zeros(n-1,1); beq=[0];
if n>2
  for k=1:n-2
    A(k,k)=-1; A(k,k+1)=1;
  end
end
A(n-1,n-1)=-1;
Aeq(1,n)=1;
%x0=[2 .5 0]';
%x0=[2 1 .5 0]';
%x0=[1.5 1 .7 .5 0]';
%x0=[1.3 1.2 .9 .5 .1 0]';
%x0=[1.2402 1.1625 .9658 .6593 .3594 .0959 0]';
%x0=[1.215 1.163 1.004 .781 .507 .262 .068 0]';
%x0=[1.19701 1.15388 1.03816 .846520 .635886 .394570 .200087 .0493951 0]';
x0=[1.181 1.149 1.051 .906 .716 .519 .317 .155 .039 0]';
[xmin,fmin,fl]=fmincon(@(x) condVp(n,x),x0,A,b,Aeq,beq)
sum(xmin.^(n-1))
