function H0=add_H_tilde0(regulator_parameters,H_tilde)
index=decompose_index(k,regulator_parameters.n_grid,dim);
            for l=1:dim
                H_tilde0(l)=H_tilde(l,index(l));
            end

H0=zeros(size(regulator_parameters.H_tilde_on));
a=0;
for i=1:(size(regulator_parameters.H_tilde_on,1))
    for j=1:(size(regulator_parameters.H_tilde_on,2))
        if (regulator_parameters.H_tilde_on(i,j))
            a=a+1;
            H0(i,j)=H_tilde(a);
        end
    end
end

end