# Power of chi-square test for goodness-of-fit as function of sample size

I would like to calculate the power of a Chi-Square test for goodness-of-fit as a function of sample size for a specified alpha-value (say 0.01). Specifically, I am referring to power as the probability that the test will correctly reject the null hypothesis. In most places I look, I can find only vague references that this can be done and/or am referred to software. It seems to me that this should not be difficult. The specific question I would like to be able to answer (without using some sort of opaque software) follows:

Given an $\alpha$ value, for what sample size, $n$, can I expect a particular power, $\beta$?

Even better, how might I be able to calculate an ROC?

-