void SOC(double voltage, double current)
{
int i, n_samples;
double dt, soc;
double []samples = new double[1000];
n_samples = 0;
while (n_samples < 1000)
{
dt = 1;
x = x + dt * (voltage / current - x);
p = p + q * dt;
k = p / (p + x);
x = x + k * (voltage - x);
p = (1 - k) * p;
samples[n_samples] = x;
n_samples++;
}
soc = 0;
for (i = 0; i < n_samples; i++)
{
soc += samples[i];
}
soc /= n_samples;
soc = (soc -3.0) / 1.2;
}
BMS上位机 下
最新推荐文章于 2024-09-10 15:28:21 发布