Skip to content

Commit

Permalink
linearized and parametrized ame function
Browse files Browse the repository at this point in the history
  • Loading branch information
nkokic committed Jan 21, 2025
1 parent 71eb7fe commit f7ecd75
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions Content.Server/Ame/AmeNodeGroup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -181,10 +181,21 @@ public float CalculatePower(int fuel, int cores)
{
return 0f;
}

// Power generation curve assuming x is the number of cores and the injection scales linearly to always be the twice the number of cores.
// https://www.wolframalpha.com/input?i=200000+*+log10%28%28x*2%29%5E1.9%29+*+%280.4+*+%28%28x*2%29+%2F+x%29%29+for+x+from+1+to+10
return 200000f * MathF.Log10(MathF.Pow(fuel, 1.9f)) * (0.4f * (fuel / cores));

//more parametrized and linear AME power function https://www.desmos.com/calculator/qsdxxvpcq8
float wattsPerCore = 80000f;
float efficencyPenalty = 2f;
float tailPenaltyFactor = 0.9f;

float efficency = fuel / (2 * efficencyPenalty * cores);

if (fuel >= 2 * cores - 1)
efficency += (fuel - (2 * cores - 1)) * (1 - 1 / efficencyPenalty);

if (fuel >= 2 * cores)
efficency -= (fuel - (2 * cores)) * (1 - 1 / efficencyPenalty) * tailPenaltyFactor;

return efficency * wattsPerCore * cores;
// End of DeltaV code
}

Expand Down

0 comments on commit f7ecd75

Please sign in to comment.