Logical Blocks - Controller Block Updating ManipulatedVariable with PythonNet #889
elliotfekete
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi Daniel,
First of all, thanks for so much writing DWSIM - it's a genuine god send at work.
I'm writing a script using the PythonNet interpreter in the Script Manager to simulate a dynamic problem. In this simulation I've found that using fsolve in scipy.optimize really struggles under some conditions since the dependent variable can become extremely sensitive.
I find that the flowsheet solver is more reliable, so I've added a controller block to replace fsolve. However, I need to dynamically change the Manipulated Variable between Pressure and Mass Flow in my code to make this work.
Currently, I have the following code that is supposed to update the Manipulated Variable to Mass Flow. When I run and print controller.ManipulatedVariable, it has been updated with the value "Mass Flow", but the controller block does not update. I know that controller.ManipulatedVariable is being updated, since it prints "Mass Flow" when I print it. It seems like it isn't being fed to the Controller Block input. I also have the same issue when trying to set other properties of the Controller Block.
Do you know what I am missing here?
Thanks in advance!
Cheers,
Elliot.
Beta Was this translation helpful? Give feedback.
All reactions