- #1

- 158

- 23

## Main Question or Discussion Point

I've been using MATLAB (ode45) to simulate the mechanics of a rocket under the forces of gravity, drag, and internal thrust.y I've recently refactored my simulation to include 2d space, orientation of the rocket, etc. (So I can try to make it orbit, finding optimal ascent profiles, etc)

Because I want to retain the simplicity of my 1d model, I've attempted to use polar coordinates for defining the rockets position, velocity, and acceleration. I've implemented it, but when I run the simulation and plot height vs theta... I get a disturbing picture.

Gravity does not affect the orbital velocity in any way. It always accelerates the height of the rocket downward. And yet for it to orbit, it needs to have a cyclic, non-zero height. Something is very wrong here, and I can't tell what it is.

The line defining gravitational acceleration is as follows. I define it as a vector, with the first component being orbital acceleration (how much theta's rate of change changes due to gravity), and the second component being height's acceleration. (height is y, here)

Since S (the standard gravitation parameter) is positive, the acceleration of height will always be negative. The height of the rocket must inevitably go to zero. My intuition of gravity no longer makes sense.

This is bothering me on a visceral level. I can't tell what I'm doing wrong. I now suspect the Earth will fall into Sol in the next few hours.

Because I want to retain the simplicity of my 1d model, I've attempted to use polar coordinates for defining the rockets position, velocity, and acceleration. I've implemented it, but when I run the simulation and plot height vs theta... I get a disturbing picture.

Gravity does not affect the orbital velocity in any way. It always accelerates the height of the rocket downward. And yet for it to orbit, it needs to have a cyclic, non-zero height. Something is very wrong here, and I can't tell what it is.

The line defining gravitational acceleration is as follows. I define it as a vector, with the first component being orbital acceleration (how much theta's rate of change changes due to gravity), and the second component being height's acceleration. (height is y, here)

Code:

`grav = [0; -S/(R+y)^2];`

This is bothering me on a visceral level. I can't tell what I'm doing wrong. I now suspect the Earth will fall into Sol in the next few hours.