how to add a limitation in the following codes?

1 回表示 (過去 30 日間)
Mamad Mamadi
Mamad Mamadi 2019 年 12 月 8 日
コメント済み: Rik 2020 年 12 月 5 日
hi everyone,
i am newbie here and i want to develop Matlab codes for a Pv/Battery which i mean charging/discharging of li-ion battery and optimization to get the results for one year.
I wrote the other codes but i cant add limitation for codes i dont know how to discribe the situation, i hope you can understand me!
General view:
1-The first is that PV produced the maximum possible energy to supply the load and also to charge the battery while the state of charge is less than soc.
2-The second is that the battery soc reaches the maximum value and the PV at this point must stop charging the battery.
3-In the third the PV could not cover all the demanded energy by load and its not able to charge the battery and so at this point the battery must cover the load alone.
in here;
Pmax=3600
Pmin=0
the answer must not bigger than Pmax and must not smaller than Pmin
  3 件のコメント
Mamad Mamadi
Mamad Mamadi 2019 年 12 月 15 日
編集済み: per isakson 2019 年 12 月 15 日
no its not sumulink becuase i dnt know how to use simulink.its all about codes
i mean;
Pmax= 3600wh
Pmin=0wh
Pch wont be 3750 , must not be bigger than 3600
Pdis wont be -150, must not be smaller than 0
Pch=[2600 2750 2800 2950 3010 3100 3300 3580 3750];
Pdis=[3450 3330 2900 1500 1200 850 300 22 -150];
it these codes right? if not how can i write it?
a=1;
b=0;
result_data=[];
while a<=length(Pch);
b= Pch(a)+b;
result_data(a+1)=b;
a=a+1;
if result_data <= Pmax ;
finalresult = result_data;
elseif result_data > Pmax ;
break;
end
finalresult;
end
Rik
Rik 2019 年 12 月 15 日
(the previous comment was reposted as a question here)

サインインしてコメントする。

回答 (1 件)

eng ashraf
eng ashraf 2020 年 12 月 5 日
編集済み: Rik 2020 年 12 月 5 日
Please, if you know the solution please send me the code
[]@yahoo.com
  1 件のコメント
Rik
Rik 2020 年 12 月 5 日
This is not an answer. Please delete it.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeSources についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by