You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
record TestModel_Calibrated_20191204 "Final values of AixCaliBuHa-Calibration of Model AixCalTest.TestModel:
NRMSE = 0.002; Used Method: scipy_minimize - COBYLA"
parameter Real V=0.02 "Calibrated in bounds min=%s, max=%s";
parameter Real m_flow_nominal=0.02 "Calibrated in bounds min=%s, max=%s";
annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(
coordinateSystem(preserveAspectRatio=false)));
end TestModel_Calibrated_20191204;
The text was updated successfully, but these errors were encountered:
Related to this, it would make sense to also return the tuned parameters directly (similarly to how the final results of the sensitivity analysis are returned) or export the resulting parameters additionally in a format that can be easily read in within python (e.g. JSON).
For example in the following fashion at the end of the method def save_calibration_result(self, best_iterate, model_name, **kwargs) :
# Save relevant results in JSON
import json
results_file_path = os.path.join(os.getcwd(), "calibration_results.json")
try:
with open(results_file_path, 'r') as json_file:
parameter_values = json.load(json_file)
except:
parameter_values = {}
new_parameter_values = dict(zip(list(self.tuner_paras.get_names()), best_iterate["Parameters"]))
updated_parameter_values = {**parameter_values, **new_parameter_values}
with open(results_file_path, 'w') as json_file:
json.dump(updated_parameter_values, json_file , indent=4)
To make the use of the final calibration result easy, an export to a record should be implemented (as discussed).
In addition to the final values, the most relevant info about the calibration should also be in that record, e.g.:
Name: MODELNAME_Calibrated_DATEOFCALIBRATION.mo
Content:
The text was updated successfully, but these errors were encountered: