1
0
mirror of https://github.com/metrostroi-repo/MetrostroiAddon.git synced 2026-05-02 00:42:29 +00:00

Temporary commit just to switch to the base branch

This commit is contained in:
Moon Horse
2024-04-18 19:49:19 +03:00
parent 0027160c2d
commit 61952affe8
12 changed files with 119 additions and 61 deletions

View File

@@ -53,12 +53,15 @@ local function C(x) return x and 1 or 0 end
local min = math.min
local max = math.max
local linearity = 1.2
function TRAIN_SYSTEM:SolveAllInternalCircuits(Train,dT,firstIter)
local P = Train.PositionSwitch
local RheostatController = Train.RheostatController
local RK = RheostatController.SelectedPosition
local B = (Train.Battery.Voltage >= 60) and 1 or (Train.Battery.Voltage >= Train.Battery.CutoffVoltage) and 0.5 or 0
--local B = (Train.Battery.Voltage >= 60) and 1 or (Train.Battery.Voltage >= Train.Battery.CutoffVoltage) and 0.5 or 0
--local B = linearity*(Train.Battery.Voltage - Train.Battery.CutoffVoltage)/(Train.Battery.StartVoltage - Train.Battery.CutoffVoltage)
local B = math.min(1,(Train.Battery.CCcurrent_sigma - Train.PowerSupply.car_control_load + Train.Battery.Ibatt_sigma)*-1/80)
local BO = B*Train.VB.Value*(1-Train.PA1.Value)
local BO2 = B*Train.VB.Value*(1-Train.PA2.Value)
local T = Train.SolverTemporaryVariables
@@ -341,7 +344,9 @@ function TRAIN_SYSTEM:SolveRKInternalCircuits(Train,dT,firstIter)
local P = Train.PositionSwitch
local RheostatController = Train.RheostatController
local RK = RheostatController.SelectedPosition
local B = (Train.Battery.Voltage >= 60) and 1 or (Train.Battery.Voltage >= Train.Battery.CutoffVoltage) and 0.5 or 0
--local B = (Train.Battery.Voltage >= 60) and 1 or (Train.Battery.Voltage >= Train.Battery.CutoffVoltage) and 0.5 or 0
--local B = linearity*(Train.Battery.Voltage - Train.Battery.CutoffVoltage)/(Train.Battery.StartVoltage - Train.Battery.CutoffVoltage)
local B = math.min(1,(Train.Battery.CCcurrent_sigma - Train.PowerSupply.car_control_load + Train.Battery.Ibatt_sigma)*-1/80)
local BO = B*Train.VB.Value*(1-Train.PA1.Value)
local T = Train.SolverTemporaryVariables