A while ago, I did a Saturn V ascent simulation in Matlab. The catering for drag, gravity and thrust vectors and mass depletion worked well, but I struggled to implement ascent guidance.
I duplicated roughly what I saw in the ascent profile - a gravity turn a little while after liftoff (I tinkered with this, but I recall it being about 1.5km-2.5km alt).
Where I ran into problems was trying to guide it to orbit, as I didn't have a good set of rules for this. Typically it would either not reach orbit at all, or it would have too steep an angle of attack on SIVB cutoff and it would fall back to earth...
I understand it isn't a simple question but I appreciate any pointers. I'm happy to share the Matlab code if this helps (as long as you don't laugh too hard).