how to add a limitation in the following codes?

2 visualizaciones (últimos 30 días)
Mamad Mamadi
Mamad Mamadi el 8 de Dic. de 2019
Comentada: Rik el 5 de Dic. de 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 comentarios
Mamad Mamadi
Mamad Mamadi el 15 de Dic. de 2019
Editada: per isakson el 15 de Dic. de 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 el 15 de Dic. de 2019
(the previous comment was reposted as a question here)

Iniciar sesión para comentar.

Respuestas (1)

eng ashraf
eng ashraf el 5 de Dic. de 2020
Editada: Rik el 5 de Dic. de 2020
Please, if you know the solution please send me the code
[]@yahoo.com

Categorías

Más información sobre Programming en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by