function [ref_v,val_mu] = reference_vel(mu1,mu2,time)
    if time<10
        val_mu = mu1;
    elseif time>=10 && time <20
        t = (time-10)/10;
        y = [0,0,1,1];
        val_mu = mu1 + (mu2-mu1)*de_casteljau(t,y);
    else
        val_mu = mu2;
    end
        ref_v = calculate_vel(val_mu);
end