I have created a dyamic model as shown below.
Now, I want to write a loop to set different PI gains to see the effects.
I have set schedule = Flowsheet.DynamicsManager.ScheduleList[Flowsheet.DynamicsManager.CurrentSchedule]
integrator = Flowsheet.DynamicsManager.IntegratorList[schedule.CurrentIntegrator]
Do you know how which command I should use to run the dynamic model instead of clicking "Run Schedule" button on Inegrtor Controller? Also do you know how to adjust the PI gains?
There is a sample called" Heat Exchanger" in DWSIM, and I'm trying to run the dynamic model.
Another question is, I'm going to set the events with python, but the EventSetList which i read from the flowsheet is a interface: manager = Automation3()
filepath = "D:\Windows\Heat-Exchanger.dwxmz"
myflowsheet = manager.LoadFlowsheet(filepath)
dymanager = myflowsheet.DynamicsManager
for key, value in dymanager.EventSetList.items():
event_set = value#<class 'dwsim.interfaces.idynamicseventset'="">
for key, value in event_set.Events.items():
event_list.append(value)#<class 'dwsim.interfaces.idynamicsevent'=""></class></class>
How can I get the object from the .dwxmz and set the events by myself?
Thank you so much!
Sincerely,
Wei
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi Daniel,
I have created a dyamic model as shown below.
Now, I want to write a loop to set different PI gains to see the effects.
I have set
schedule = Flowsheet.DynamicsManager.ScheduleList[Flowsheet.DynamicsManager.CurrentSchedule] integrator = Flowsheet.DynamicsManager.IntegratorList[schedule.CurrentIntegrator]
Do you know how which command I should use to run the dynamic model instead of clicking "Run Schedule" button on Inegrtor Controller? Also do you know how to adjust the PI gains?
Thanks,
Jiajun
Last edit: Jiajun Duan 2022-03-28
Hi Jiajun,
I still have to implement an API for that. I apologize.
Regards
Daniel
Hi Daniel,
May I ask if the API is ready for use now?
There is a sample called" Heat Exchanger" in DWSIM, and I'm trying to run the dynamic model.
Another question is, I'm going to set the events with python, but the EventSetList which i read from the flowsheet is a interface:
manager = Automation3()
filepath = "D:\Windows\Heat-Exchanger.dwxmz"
myflowsheet = manager.LoadFlowsheet(filepath)
dymanager = myflowsheet.DynamicsManager
for key, value in dymanager.EventSetList.items():
event_set = value#<class 'dwsim.interfaces.idynamicseventset'="">
for key, value in event_set.Events.items():
event_list.append(value)#<class 'dwsim.interfaces.idynamicsevent'=""></class></class>
How can I get the object from the .dwxmz and set the events by myself?
Thank you so much!
Sincerely,
Wei