Menu

Run the dynamic mode in python

Wei Z
2024-04-30
2025-03-31
  • Wei Z

    Wei Z - 2024-04-30

    Hi Daniel,

    May I ask if the dynamic API is ready for use now?
    There is a sample called" Heat Exchanger" in DWSIM, and I'm trying to run the dynamic model with python.

    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
    for key, value in event_set.Events.items():
    event_list.append(value)

    How can I get the dynamic object from the .dwxmz file and set the events by myself?

    Thank you so much!
    Wei

     
    • Daniel Medeiros

      Daniel Medeiros - 2024-04-30
       
      • Wei Z

        Wei Z - 2024-05-09

        Hi Daniel,

        Thank you for your reply! Now I can set the events.

        But I still not sure which command to use for the "run schedule" of dynamic mode.
        I read the API documentation and thought the the function "CalculateFlowsheet()" did not fit the task.

        Could you please give me some clues about this? I want to run the dynamic mode and save the data of monitored variables at each steps.

        I really appreciate your help!
        Wei

         
        • Daniel Medeiros

          Daniel Medeiros - 2024-05-09

          Hi Wei, I have a project for dynamic mode automation but it is not free/open. I'm still deciding what to do with it as it is really powerful. I created it on top of DWSIM, everything you need to do it on your own is there already.

           
          • Faraz Qasim

            Faraz Qasim - 2025-03-31

            Hi Daniel. Thanks for your dedication to DWSIM. I am wondering whether Dynamic Mode automation API is available or not? Have you made any decision about it, and can we use it as either open or closed source? I will be very thankful for your feedback.

             
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.