How do departments determine the optimal quantity of elective offerings? In my department, we have a problem in trying to determine how many credits of electives we should offer.  At first, it seems that it should be a simple equation to take the number of students enrolled at the department multiplied by the elective credits they will take on average that semester, and then divide by the minimum student enrollment for a course to help estimate how many credits to offer.  The problem is that not only is the average elective credits to be taken not known in advance, but also that students often take electives outside the department, and students from other departments will sometimes take our department's courses.  

As a result, the department makes no effort to estimate elective credits, and often offers more credits than could reasonably be filled.  This results in under-enrollment of the electives, which means that many do not meet their minimum enrollment numbers, and are cancelled before the semester even starts.  

Does anyone have a tool their department uses that works well to mitigate this problem?
Gradually converge to a number that works well, and adapt as things change, by adjusting upward or downward each semester if there were too few/too many the previous semester. 

Most classes, including electives, are on a fixed schedule (e.g. "this class is taught in the Spring semester every other year") that is determined and then adjusted by the method described above. 

Demand is not spread evenly across all electives; a course that is consistently underenrolled when offered every year might be moved to every two years, while a course that is overenrolled when offered once a year might change to every semester.

Demand does not usually change dramatically from one year to the next, so this works pretty well.