 
theta_vec = 0:0.5:1;

hold on

u_sol = @(x) min(1,1-abs(x));
x = linspace(-1,1,1000);

plot(x, u_sol(x),'Color','black');

for the = 1:length(theta_vec)
    for k = 1:3
        
        u = Kushner_Dupuis_Scheme(10^k ,theta_vec(the) );
        x = linspace(-1,1,10^k);
        plot (x,u, 'Color', rand(3,1));
        
    end
end

h_legend = legend('u_{sol}', 'u_{num} with N = 10 and \theta = 0','u_{num} with N = 10^2 and \theta = 0', 'u_{num} with N = 10^3 and \theta = 0',...
    'u_{num} with N = 10 and \theta = 0.5', 'u_{num} with N = 10^2 and \theta = 0.5', 'u_{num} with N = 10^3 and \theta = 0.5', ...
    'u_{num} with N = 10 and \theta = 1', 'u_{num} with N = 10^2 and \theta = 1', 'u_{num} with N = 10^3 and \theta = 1');
set(h_legend,'FontSize',5);
xlabel('x');
hold off

%%

u = Kushner_Dupuis_Scheme(10^4 ,0.5 );
x = linspace(-1,1,10^4);
plot (x,u, 'Color', rand(3,1));
        