Discussion Thrust building up with time

N_Molson

Addon Developer
Addon Developer
Donator
Joined
Mar 5, 2010
Messages
9,278
Reaction score
3,247
Points
203
Location
Toulouse
Hello, :hello:

To keep a rocket realistic, the thrust has to build up at liftoff during a few seconds, except maybe for SRBs.

I'm trying to get this piece of code working. With success sometimes, but not always. There's certainly a way to improve it.

The idea is that the engines are pre-ignited at 20%, then their thrust build up until it reaches 100%.

I tried to write it as a function. The basic concept is "équation de droites", I didn't found a translation on Wikipedia :


The following is running in clbkPostStep(double simt, double simdt, double mjd)

if (GetThrusterLevel(th_main[0]) >= 0.02 && GetThrusterLevel(th_main[1]) >= 0.02 && ignition1 && SEP == 0)
{
if (ignitionA) // timer
{
Time = simt;
}

long double MainE;
MainE = 0.2*(simt-Time) + 0.2; // y = a . x + b ; y = thrust level, x = time, b = "starting offset"

SetThrusterLevel(th_main[0], MainE);
SetThrusterLevel(th_main[1], MainE);

if (MainE >= 1)
{
ignition1 = false; // close loop
}

ignitionA = false; // do only once
}

So, what do you think about it ? :cheers:
 
Last edited:

Wishbone

Clueless developer
Addon Developer
Joined
Sep 12, 2010
Messages
2,421
Reaction score
1
Points
0
Location
Moscow
What would you like to hear?

Code:
MainE = ((simT-ignitionT)>threshold? 1.0 : 0.2+0.8*(simT-ignitionT)/threshold);
 
Last edited:

N_Molson

Addon Developer
Addon Developer
Donator
Joined
Mar 5, 2010
Messages
9,278
Reaction score
3,247
Points
203
Location
Toulouse
Just to see if there are simpler and more "stable" methods to do this, because mine seems a little unreliable...
 
Top