how to add a limitation in the following codes?

2 vues (au cours des 30 derniers jours)
Mamad Mamadi
Mamad Mamadi le 8 Déc 2019
Commenté : Rik le 5 Déc 2020
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 commentaires
Mamad Mamadi
Mamad Mamadi le 15 Déc 2019
Modifié(e) : per isakson le 15 Déc 2019
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 le 15 Déc 2019
(the previous comment was reposted as a question here)

Connectez-vous pour commenter.

Réponses (1)

eng ashraf
eng ashraf le 5 Déc 2020
Modifié(e) : Rik le 5 Déc 2020
Please, if you know the solution please send me the code
[]@yahoo.com
  1 commentaire
Rik
Rik le 5 Déc 2020
This is not an answer. Please delete it.

Connectez-vous pour commenter.

Catégories

En savoir plus sur Programming dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by