Clausius2 said:
There, flying around, there is an inhabbitant called "Enigma". He is the "Master of the Rockets" here. Surely he will advice you.

Thanks for the kind words, Clausius.
davehatton01 said:
variable gravity, variable mass, and how to model the curved flight path etc etc.
Hi Dave, welcome to PF!
A teammate and I did a similar project last year for a design project we were participating in. Unfortunately, we didn't get it working optimally, and had to scrap it for our final report (we just assumed that 9.5km/sec delta V would get us to orbit, waved our hands, pulled out the smoke and mirrors, and let it go with that).
The variable gravity and variable mass (we also took into account variable atmospheric density for drag and change in thrust due to the changing motor Isp due to atmospheric pressure) can be taken care of quite easily with a little calculus and Matlab's ode23 function. Basically, you'll need to set carefully define your coordinate systems such that the differential of the local gravity changes as height from the center of the Earth changes, and the differential of atmospheric pressure and density change WRT altitude. You couple those equations along with mass, thrust, position, velocity, etc.; code the ode function and let MATLAB do the numerical analysis for you. IIRC, we had about 10 terms. You'll need to run several piecewise ode's to account for when you drop of the Saturn V's first and second stages. Pass the ending conditions of the previous run into the next stage with removing the mass from the previous stage, and changing the nozzle specs when you switch from the 5 F-1's to the 5 J-2's to the single J-2.
I'd restrain the motion into a 2-d plane if it's possible. It's very tricky to do the motion in an IJK coordinate system.
Our major problem we had will probably not be an issue for you. We were trying to optimize the trajectory to minimize the delta-V requirement. This will not be an issue for you, because you already know the rocket got into orbit. If you know certain points (downrange distance vs. altitude) for the ascent, you can make a simplifying assumption that it was traveling in a single orbital plane (and as a result, following 2d motion), and then curvefit the points to obtain an 'optimal' trajectory. If you've got the optimal trajectory, you don't really have to worry about a control system, which is what stuck us up. Just feed in the optimal path to the ode solver (angle vs. altitude or time... you'll have to figure which works better) and have the thrust point in that direction for all times. We needed to code a multiple input-multiple output controller which wasn't covered in our controls system class (a graduate course covers it). By the time we got to the point that I realized my simple proportional controller wasn't doing what I wanted it to, we were too far down the semester with too many other systems to design to worry about trying to figure it out.
Hope that helped some.
[moderator hat on]
I'm going to change the title of the thread to something more descriptive.
[/moderator hat on]