It is a good practice to index your equations but in your case, it needs some work. I can give you an outline on how to do it.

The aim should be to write con(r);

first let’s look at the terms tds (in first equation, you have tds(5) and tds(1), in second you have 4,2 and in so on… I don’t see any programming logic here so you will need to declare a 2D set.

Finally, I see that the parameters in your equations also change in equations. You will also need to declare parameters over a set (based on hwo they are calculated).