How does climb-rate vary with density/pressure altitude? I'm seeking to write a little web or phone app which can help me choose the best cruising altitude based upon winds aloft. I know Garmin Pilot (and probably Foreflight) have a cruising altitude selector, but they don't seem to take into account the extra time/fuel required to get to the higher altitudes. I'm looking to make a calculator which factors that in.

I realize that the actual formulae for climb-rate, take-off distance, landing distance, etc are quite complex, but I don't need to generate them from scratch. What I plan to do is start with the charts in the performance section of the POH for a particular aircraft...

...and find some known values for climb-rate for given pressures/temps/weights and use curve-fitting to come up with simple formulae which are still within a few percent of what I would get with these charts.

Of course, to be as accurate as possible, it would be better to know, roughly, how climb-rate varies with pressure-altitude, density-altitude, weight, etc. Some of the adjustments (eg. for weight) seem to be fairly linear (at least over the domain of values of interest to us), while some others seem to have some curve... so maybe they vary as $b^{-x}$, $\frac{1}{x}$, $x^2$, $log(x)$...?

Does anybody know the general way in which climb-rate varies with these factors? (Bonus round: can you do the same for take-off and landing distances, in case I wanted to make a calculator for those?)
For propeller aircraft, the climb rate is a function of 


available power
demanded power
weight
air density
wing lift


Five variables, and wing lift is itself a function of Mach number, Reynolds number, wing AoA, wing area. Available power is a function of air density, throttle setting, propeller incidence - demanded power a function of air speed, air density, angle of attack, Mach &amp; Reynolds numbers. So in total a very large matrix of independent variables - in order to find equations via an analysis, we'll have to make some assumptions and simplifications. For instance that the aircraft thrust vector stays reasonably horizontal so that $T \cdot sin(\Gamma)$ is close to zero and can be disregarded. Also, that lift = weight during the climb.

For the steady climb, the weight equation then becomes $$W = C_L \cdot \frac{1}{2} \rho V^2 \cdot S \Rightarrow V = \sqrt{\frac{W}{S}\cdot\frac{2}{\rho} \cdot \frac{1}{C_L}} \tag{1}$$

For the drag in horizontal flight:

$$ D_h = C_D \cdot \frac{1}{2}\rho V^2 \cdot S = \frac{C_D}{C_L} \cdot W \tag{2}$$

and the required power in horizontal flight $(P_r)_h$ becomes:

$$ (P_r)_h = D_h \cdot V = W \cdot \sqrt{\frac{W}{S}\cdot\frac{2}{\rho} \cdot \frac{{C_D}^2}{{C_L}^3}} \tag{3}$$

The power required to maintain climb speed $C$ is $W \cdot C$ and available power $P_a = (P_r)_h + W \cdot C$, hence:

$$ C = \frac{P_a - (P_r)_h}{W} = \frac{P_C}{W} \tag{4}$$
Combine (3) and (4):

$$ C = \frac{P_a - (P_r)_h}{W} = \frac{P_a}{W} - \sqrt{\frac{W}{S}\cdot\frac{2}{\rho} \cdot \frac{{C_D}^2}{{C_L}^3}} = \frac{\eta \cdot P_{br}}{W} - \sqrt{\frac{W}{S}\cdot\frac{2}{\rho} \cdot \frac{{C_D}^2}{{C_L}^3}} \tag{5}$$



Above picture shows a graph of $P_{br}$ of the P&amp;W Wasp: function of manifold pressure and altitude. This engine had a turbo-charger for improved altitude performance, the engines of GA aircraft may not have these. Plots of variable pitch propellers show a propeller efficiency $\eta$ of about 0.8. 

How this ties into the graph shown in OP:


The equations feature air density $\rho$. This is a function of static pressure and of temperature: an equation to convert to static pressure and vice versa can be found here.
Available power for a normally aspirated piston engine decreases as a function of altitude, approximately according to $\frac{({P_{br}})_h}{({P_{br}})_o} = (1 + c) \frac{\rho_h}{\rho_o}$. Tests on some American piston engines showed that for many of them a value of $C$ = 0.132 would be appropriate, refer to figure below which also shows the altitude-power function of a piston engine with supercharger.




All references and pictures from a university lecture book, paper copy only.