Optimal investment in learning-curve technologies