Simple AC Generator AC Load - Learning how to use MATLAB Link
I've recently installed the MATLAB Link within my HOMER software. The modelling I am undertaking of remote communities consist of dispatch strategies which require MATLAB to accurately model the real world settings I am working in. I have had limited exposure to MATLAB in my undergrad a decade ago but virtually none since. I am getting up to speed on the software but it is taking some time. I am currently trying to mimic a community load with a fairly straight forward dispatch strategy. The community consists of three generators of three sizes. When the load is above a certain threshold, Gen 1 supplies power to the load. When the load is below a certain threshold, Gen 3 supplies power to the load. And, when the load falls within the upper and lower thresholds, Gen 2 supplies power to the load.
I am unfamiliar with how to correctly set up my script and as a result, my code errors out relatively quickly. The logic in my head makes sense, I think there is just something missing from how I am structuring my script which, as a MATLAB novice, continues to escape me. Any help would be greatly appreciated.
What are the errors that you get?
Oh dammit, I put the errors in italics and they seem to have disappeared. Apologies. First error should be on second line and reads:
MATLAB error while executing '[new_simulation_state, custom_variables] = MatlabDispatch(simulation_parameters, simulation_state, custom_variables);': Reference to non-existent field 'ac_bus.load_requested'. Error in MatlabDispatch(line7) if simulation_state.ac_bus.load_requested>328;
The second error should be on the fourth line and reads:
Function with duplicate name "MatlabDispatch" cannot be defined
Third error should be on eighth line and reads:
Infeasible due to the capacity shortage constraint.
Sorry about that