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
댓글 수: 0
답변 (1개)
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
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 Center 및 File Exchange에서 Ordinary Differential Equations에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!