function to make a linear formula from strings of variable names
docs for cache