a problem on optimization having a good looking $$\min_{x\geq 0}\sum_{i=1}^n (a_i-x b_i)^2 [a_i-x b_i\leq 0],\quad a_i,b_i\in\mathbb R,n\in\mathbb N$$
where $[p]$ is an Iverson bracket.
The objective function seemed easy (convex).
1.Is there any the concrete name for this kind of optimization or specific method to solve?
2.Any reference material?
3.To find the solution, is there suitable package in R?

For a convex function $F$ of one variable you can always find the minimum by simple bisection: if you know that the minimum is attained on $[a,b]$ (in your case $a=0$ and the initial $b$ can be found going to the right geometrically until the current value is greater than the previous one), then you can split $[a,b]$ into 4 equal parts by the points $a<x<y<z<b$ and look at the values at those points to choose a smaller interval. 
If $F(a)<F(x)$, switch to $[a,x]$, else
if $F(x)<F(y)$, switch to $[a,y]$, else
if $F(y)<F(z)$, switch to $[x,z]$, else
if $F(z)<F(b)$, switch to $[y,b]$, else
switch to $[z,b]$.
This approach is somewhat crude but quick and once you are close enough to the minimum, you can find it exactly because you will know which brackets are involved. 
