I have not done this, but I have done pretty much all other calculations for Pokémon values and damage...basically what you need to do is get the power up costs table and the cp formula.
You then reposition the elements (I don't know the correct mathematical term in English) to have it calculate CPM, and you then make a list of CPM values and link them to the Level number and have that displayed to you.