I am attempting to generate code files (MATLAB) for CSP and PV + battery storage base module simulations so that a user may run versions of those models in a "coupled" manner, i.e. keeping the base input values for most variables but programmatically varying others based on certain scenarios and relationships of CSP + PV + battery systems.
In the SAM application, certain variables are independent and therefore have editable fields, while others are dependent variables calculated from a combination of independent entries and are therefore not editable. I have noticed that variables of both types seem to exist in the calls to the "ssccall" function in the generated .m file. E.g. (from the PV model):
ssccall('data_set_number', data, 'batt_power_discharge_max_kwdc', 999.9993896484375);
ssccall('data_set_number', data, 'batt_power_charge_max_kwac', 1041.666015625);
ssccall('data_set_number', data, 'batt_power_discharge_max_kwac', 959.9993896484375);
My question is: are the functional relationships set at the GUI level for SAM or at the deeper calculation level? Is it possible to edit these input code files in a way that breaks the intended relationship? E.g.
ssccall('data_set_number', data, 'batt_power_discharge_max_kwdc', user_defined_value);
ssccall('data_set_number', data, 'batt_power_charge_max_kwac', 1041.666015625);
ssccall('data_set_number', data, 'batt_power_discharge_max_kwac', 959.9993896484375);
If I modified the script to allow the user to set the battery size via "user_defined_value" would SAM still enforce the AC-DC conversion efficiency relationship defined elsewhere or would it introduce an inconsistency?