Menu

Loop a Dynamic Simulation

2022-03-28
2024-04-29
  • Jiajun Duan

    Jiajun Duan - 2022-03-28

    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
  • Daniel Medeiros

    Daniel Medeiros - 2022-03-28

    Hi Jiajun,

    I still have to implement an API for that. I apologize.

    Regards
    Daniel

     
    • Wei Z

      Wei Z - 2024-04-29

      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

       
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.