I'm trying to run Dymola using Python, each time i change the values of the parameters, different equations are used through many "if elseif" that activates and disactivates the corresponding equations.
Im using this code:
def simulateModel(model, startTime, stopTime, resultFile, initialNames, initialValues, finalNames):
output = dymola.simulateExtendedModel(model,
startTime=startTime,
stopTime=stopTime,
numberOfIntervals=500,
outputInterval=0.0,
method="Dassl",
tolerance=0.0001,
fixedstepsize=0.0,
resultFile=resultFile,
initialNames=initialNames,
initialValues=initialValues,
finalNames=finalNames,
autoLoad=False)
status = output[0]
if not status:
print("Simulation failed.")
log = dymola.getLastError()
print(log)
return
result = output[1]
return result
The problem is that when i define my new values for the parameters, the script changes them in the model, but it keeps using the same set of equations of the last time i have ran the program on Dymola directly, which is not the case, the program is not taking into consideration that the parameters changes the system of equations to be used.
Any suggestion? Regards