Jump to content

CrashChris

Members
  • Posts

    1
  • Joined

  • Last visited

Reputation

0 Neutral

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Hi Guys I am working on a control code in krpc, where i need to precicly predict the drag coefficient in each stage of flight since i want to determine the impact position and velocity to calculate an ideal landing burn. (I know, there are mods that do exactly the same, but i want to learn how to do this by myself) I did some tests to measure the atmospheric properties used in KSP but i don‘t really understand them. My results are the following: 1) The pressure as a function of altitude is nearly an exponential function 2) The temprature distribution is similar to the one at earth 3) The density is calculated fom 1) and 2) using the assumption of an ideal gas So far so good, because everything is convertable to formulae Then, i measured the dragcoefficient times surface over different mach numbers staying at the same altitude. The results are, as expected from the real world: At transsonic speeds, drag increases dramaticly, falling down again for supersonic/hypersonic speeds: (The wobbles and the narrow peak at 0.6 are coming from minimal steering, that changes the angle of attack) But here is my first problem: How can this relation be calculated for the KSP physics / how is it calculated internally? Does anybody know this? Finally, I meausred the drag coefficient times surface for different altitudes while staying at the same mach number, using a PID controller. The coeefficient increases dramatically for high altitudes and there are also some strange wobbles around 35km as it can be seen here: And this relation is my biggest trouble, because i have no idea, how to calculate this effects. I know, that both effects are coming from the changing Reynolds number but i cannot find any source, that gives a hint how this is approximated in KSP. I am basicly looking for a formula, that calculates the drag coefficient at a specific flight phase in relation of a constant "standard" drag coefficient, mach number, temperature and altitude. I checked the corresponding part of the mechjeb landing code and realized, that mechjeb uses the KSP API to get the drag calculations. Is there any chance, to get reasonable predictions without using the KSP API (since i don‘t want to write my code in C#)? Many thanks in advance, Chris
×
×
  • Create New...