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

if isfield(ini_Val,'iopen')
    iopen = ini_Val.iopen;
else
    iopen = 0;
end
nn=ini_Val.ncontrol;
n_sample_fit=size(C_fit,1);

u_equi=linspace(0,1,n_sample_fit);


p = ini_Val.p;

[error, x_rep] = error_param_func(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)
%pause

