public float Next(float x, float deltaT) { x -= lastValue * K; x = sum.Next(x * deltaT); lastValue = x; return(x * K); }
// Update is called once per frame void FixedUpdate() { float x = FuelHeat * MaxFuelPerSec * BurnRate; x -= Qremove; x = boilerDelay.Next(x); x = boilerHeat.Next(x); //Tank.Mix.Heat = x; x /= CMboiler; // x is boiler temperature Tboiler = x; Tank.Mix.Temp = x; x -= Tremove; x *= Csteam; if (x > 0) { x = Mathf.Min(x, Msteam * Csteam); } else { x = 0; } Qremove = x; x /= Csteam; // x is a mass of steam produced Tank.Mix.AddFraction(new ChemFraction(SteamElement, x)); x = Tank.Mix.Mass * Constants.R * Tboiler / Tank.Volume; x *= 1e-6f; Tremove = 179.47f * (Mathf.Pow(x, 0.2391f)) + 273f; }
public float Next(float x) { x -= lastValue * K; x = sum.Next(x); lastValue = x; return(x * K); }
void RevolutionRegulator() { float x = TargetRevs - CurrentRevs; x = revRegIntegrator.Next(x); x = revRegDelay.Next(x); x *= revRegulatorGain; x = Mathf.Clamp01(x); SteamValve.GateGap = x; }