A universal algorithm for calculation of nutrient solutions