Just for reference, very very roughly speaking:
Aerodynamic forces are proportional to the square of the velocity. This includes drag.
Aerodynamic heating is proportional to the cube of the velocity, at least until the onset of hypersonic speeds.
Both are proportional to atmospheric pressure.
Atmostpheric pressure decreases rather rapidly with altitude. Beware supersonic shockwaves though... they are not at ambient pressure for that altitude. So some regions of a rocket may see greater than ambient atmospheric pressure. And aero effects will certainly cause a pressure distribution around the rocket which is not equal to ambient atmospheric pressure, at least while the rocket is moving. But you can sort of pretend as a high level concept that atmospheric pressure as experienced by the rocket decreases rather rapidly with altitude.
Atmospheric temperature decreases with altitude, at least within the range of atmosphere we are generally flying in!
Drag is higher after the motor cuts off.
Rocket total energy lost due to gravity is the integral of gravity_at_that_altitude_and_location over time. Or roughly gravity times time, for our purposes.
Rocket total energy lost due to drag is the integral of drag over time. Sorry; no shortcut on this one.
In our small size rockets, drag losses dominate, limiting altitude. For extremely large rockets, gravity dominates, limiting altitude. So for super large rockets for high altitude, they just have to be slow enough to survive Max Q. Otherwise they are better off getting up there as quickly as possible. Little rockets like ours though are better climbing more slowly so more of the available propulsive energy is converted to altitude rather than heat and drag. It's actually a minimization function but hopefully you get the idea.
And the slower the rocket has to go, the lighter it can be built, which improves the propellant mass fraction and/or improves the odds of survival.
Climbing slowly generally requires multiple stages and/or rather long burn motors. So I'm personally looking at developing a sustainer motor that will burn 13s or longer, possibly somewhere around 18s, at 88mm diameter. It looks quite feasible from the work I've already done. I still need to do the sims to see how long I really want it to burn. I expect 13s would be the low end of the range.
Note, climbing slowly at very high altitude though costs too much stability if a motor is going to be burning. Lighting a third stage at 100Kft without active stabilization or plenty of spin would not be smart.
Gerald