How to store the existing value in a array format. Here I have given the charging and discharging limits but it does not check it properly. can anyone help me to sort out this

1 次查看(过去 30 天)
i_soc=30 %soc charging
% i_soc=90 %soc discharging
ev_a=5 %ev entering time
ev_d=9 % ev leaving time
pevchg=3 % EV maximum/minimum charging power
pevdchg=3
cev=24; % ev battery capacity
for i=1:5
if (i_soc>20 && i_soc<90)
f_SOC(i)=i_soc+(pevchg*(i))/cev*100; % soc charging equation
temp=f_SOC(i)
i_soc=temp
else if (i_soc>90)
f_SOC(i)=temp-(pevdchg*(i))/cev*100 %soc discharging equation
i_soc=f_SOC(i)
end
end
end

回答(1 个)

VBBV
VBBV 2022-12-15
f_SOC(i) = i_soc-(pevdchg*(i))/cev*100 %soc discharging equation
May be you mean i_soc instead of temp in discharging cycle
  6 个评论
VBBV
VBBV 2022-12-15
From the equation shown it appears that are more variables to be considered. Can you tell what is Tij used as summation? Presumably temperature or timestamp. The code shown also appears incomplete with an extra for loop missing. Pls post full code.

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Ordinary Differential Equations 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by