function [x_rep] = reparametrize(C_fit,CP)
global  ini_Val Constraints 

nn=ini_Val.ncontrol;
n_sample_fit=size(C_fit,1);


u_equi=linspace(0,1,n_sample_fit);

% num1=3/4*n_sample_fit;
% num2=n_sample_fit-num1;
% U_equi = linspace(0,0.5,num1);
% U_equi(end) =[];
% U_equi=[U_equi 0.5:0.5/num2:1];

p = ini_Val.p;
if isfield(ini_Val,'iopen')
    iopen = ini_Val.iopen;
else
    iopen = 0;
end
[error, x_rep] = error_param(u_equi,nn,p,C_fit,CP,iopen);


%figure
%hold on
%plot(C(:,1),C(:,2),'mo')
%plot(x_rep(1:2:end),x_rep(2:2:end),'bv')

%disp('Error')
%disp(error)


