[Sticky] AC Generator, AC Load and Battery
Models an AC Generator, AC Load and Battery
HOMER Pro 3.9
This dispatch uses the battery to serve the load. When the maximum discharge power of the battery decreases below the load requirement, the generator is committed to meet the load.
I have been working on the code and I stumbled upon some irregularities. In the MatlabDispatch.m:
line 30; "min_load >= simulation_state.dc_bus.load_requested"
-->I think it should be the AC_Bus: "min_load >=simulation_statesimulation_state.ac_bus.load_requested"
line 42: "simulation_state.converters(1).rectifier_power_input = (simulation_state.batteries(1).rectifier_power_output)/(rect_efficiency/100);"
--> should be the converters instead of batteries: "simulation_state.converters(1).rectifier_power_input = (simulation_state.converters(1).rectifier_power_output)/(rect_efficiency/100); "
I am not sure about this, because I just started working on it, but at least the second one lead to a simulation crash before.
Thank you for pointing it out. I have made the updates and uploaded it again. However, it shouldn't have caused the program to crash. The HOMER file ran without issues before and after updating for me. So make sure the controller settings are right and you have the compatible MATLAB version (32-bit or 64-bit) installed.