Numerical Approximation of a Rocket's motion

Click For Summary

Discussion Overview

The discussion revolves around the numerical approximation of a rocket's motion, specifically focusing on the challenges of modeling flight dynamics with orientation and stability. Participants explore the implications of using different numerical methods for integration, such as Euler's method and Runge-Kutta, in the context of simulating a rocket's behavior under various conditions.

Discussion Character

  • Exploratory
  • Technical explanation
  • Debate/contested
  • Mathematical reasoning

Main Points Raised

  • One participant describes issues with their rocket model, noting that when the rocket is launched at an angle, it gains horizontal velocity faster than vertical, leading to instability and uncontrollable rotation.
  • Another participant suggests that numerical instability may be a factor due to the use of Euler's method, which has a limited region of stability, particularly for stiff problems characterized by dynamics on different timescales.
  • A different participant mentions achieving some stability by adjusting the time scale and considers switching to a higher-order Runge-Kutta method to improve results.
  • There is a proposal to simplify the model by clamping the pitch to the velocity vector if the pitch controller is not a focus, which could help mitigate stability issues.
  • One participant shares their experience with Euler's method, noting that while it was initially chosen for its simplicity, they are exploring more advanced numerical methods to address stability concerns.
  • Another participant emphasizes the potential benefits of using implicit methods and adaptive step sizes for stiff equations, suggesting that MATLAB and Simulink might be more suitable than Excel for this type of simulation.

Areas of Agreement / Disagreement

Participants express differing views on the effectiveness of Euler's method and the nature of the stability issues encountered. While some agree on the challenges posed by stiff equations, there is no consensus on the best approach to resolve the issues, and multiple competing methods are discussed.

Contextual Notes

Participants acknowledge limitations related to the choice of numerical methods, the nature of the equations involved, and the potential for compounding errors in simulations. There are references to specific conditions under which the problems manifest, such as at lower velocities or during certain phases of flight.

Mardlamock
Messages
2
Reaction score
0
So, I ve been trying to add orientation to my model of the flight dynamics of a rocket but I ve been running into a lot of problems. I didn't bother actually doing the math for the moments of inertia and everything because I guess it really doesn't have that much of an effect on the general behaviour of the rocket,but rather simple specifics of its movement.

The problem is the following, when the rocket is offset from a perfect 90 degree angle at launch, it gains horizontal velocity faster than vertical (due to gravity) and therefore acquires another offset from the launch angle (say it was 89 degrees). The fins of the rocket should stabilize it by using the lift gained from the small angle of attack and point it back towards the velocity vector, this is what produces the gravity turn we all know and love (I think, I might be wrong though). In my model though, the rocket fails to stabilize properly and starts rotating uncontrollably after a certain amount of time.

At first it oscillates as a pendulum would,but deviating just a bit more with each period and gaining more and more angular velocity. Is this something that naturally arises when using euler's method to analyse this type of motion or would it also happen if I were to use Runge-Kutta's? I was thinking it may be something that naturally happens when using discrete time to analyse something that would be continous. By reducing the time step I was able to increase the time it would take for the deadly rotation to take place, but I am running out of memory on excel (Its waay easier than using MATLAB or anything else, at least for me). I am going to be trying to use 2nd order RK and see if it works.

Anyways, please tell me what you think, I am attaching the excel spreadsheet and a picture with the equations I am trying to approximate
https://www.mediafire.com/?led0x2ubszo7avv
http://imgur.com/4I3cFUB

Thanks a lot!
 

Attachments

  • 10740687_10203439585645884_287536767_n.xlsx
    10740687_10203439585645884_287536767_n.xlsx
    2.3 MB · Views: 484
  • Physics.png
    Physics.png
    48.6 KB · Views: 705
Physics news on Phys.org
Without looking at your code, I would say that it is very likely you experience numerical instability. The forward Euler method has a very small region of stability [1] and for suitably stiff problems [2] it can be impossible to find a step size small enough for the solution to be stable, yet large enough that truncation and rounding error do not swamp out the solution. Stiff problems are characterized by having dynamics on different timescales, i.e. orders of magnitude appart. In your problem, the rocket pitch controller would need to "operate" at a much fast timescale than the simple kinematic trajectory of the rocket. In general, vehicle simulations (of all kinds) that includes orientation very often result in stiff problems.

So, what can you do. You can try see if you can to find a sweet-spot for the step size, but you have already tried that you say. You can try switch to a more stable method (that is still doable in Excel) with a larger region of stability, but for a stiff problem the underlying difficulty is still there.

If you are not trying to simulate the pitch controller (that is, you are not doing controller research with an interested in whether on not your rocket is stable in pitch) a better approach would be to remove your pitch controller and simply clamp your pitch to your velocity vector. This means that the trajectory of the rocket is determined from the initial pitch angle (everything else being equal), and it will be very sensitive to the changes in that value, but the numerical integration itself would only operate on a single time scale.

There are of course more advance options you can take, but you would probably first need some clear goals of what you want to achieve with your simulation and you will probably also have code your problem directly as opposed to using a spread-sheet for the numerical integration. Depending on your background you may actually find it easy to add functions to Excel if you like that platform, or you can choose to go for an environment like Matlab [3] or similar [4].[1] http://en.wikipedia.org/wiki/Euler_method#Numerical_stability
[2] http://en.wikipedia.org/wiki/Stiff_equation
[3] http://en.wikipedia.org/wiki/MATLAB
[4] http://en.wikipedia.org/wiki/List_of_numerical_analysis_software
 
Filip, I am aware of the limitations of Euler's method, I first chose it because it was the easiest to apply and for something such as the motion of a rocket, it isn't that inaccurate. I managed to get it to be somewhat stable by changing the time scale to 1/100 of a second, when doing that the problem becomes only apparent when the rocket reaches velocities lower than 40m-s, which is bad, but not as bad as it was before. I will try by switching to a high order Runge Kutta method and see how if it gets rid of the problem, I am pretty sure it will help a lot.

The purpose of the model is to determine how stable the rocket is with different fin configurations and to then feed the numbers (along with some random variations) to a program in order to test dead reckoning methods, it would make for a fun experiment and if I can get it to work I could port it into an arduino and try launching it ontop of a rocket. Before adding orientation into the picture I did exactly what you described and got some good results, around 10% accuracy compared to actual data from rocket launches, which is still what I am getting right now because the orientation problems only become apparent at apogee.

Im not really good with MATLAB, but I guess there is a time for everything, what resources would you recommend to a complete newbie with it? Excel on the other hand is a lot more intuitive, I understand exactly what I am doing, and having it in spreadsheet form, only caring about ifs and elses, also makes it a lot easier to spot my mistakes and correct them easily. I will look into numerical methods for stiff equations, I had no idea that was even a thing, I am sure I'll find something relevant to my model.

Anyways, thanks a lot man!
 
I think you've got a stiff equation, but the other issue is that you're using Euler. You're using a first-order integration method and you've got double derivatives so I think you're compounding your error. Using RK4 might help some, but with stiff equations you might have to use an implicit method with an adaptive step size. Some simple systems I've tried to model for control system design became very unstable in simulation because the equation was stiff, but the values were fine for the system in reality (the simulation worked, but the step sizes were way too small to make the simulation useful for me). Using Simulink and Matlab's ode15 solver might help you out more than Excel. An upshot for using Matlab over Excel is that you don't have to worry that you've implemented your integration scheme wrong. :-)

Hope that helps!
 

Similar threads

  • · Replies 13 ·
Replies
13
Views
2K
  • · Replies 165 ·
6
Replies
165
Views
8K
  • · Replies 25 ·
Replies
25
Views
2K
  • · Replies 65 ·
3
Replies
65
Views
8K
  • · Replies 2 ·
Replies
2
Views
5K
  • · Replies 2 ·
Replies
2
Views
3K
Replies
21
Views
2K
  • · Replies 11 ·
Replies
11
Views
2K
  • · Replies 9 ·
Replies
9
Views
4K
  • · Replies 2 ·
Replies
2
Views
1K