Replies: 2 comments 3 replies
-
Hi. This is an interesting use case, and certainly one where a scripting interface shines – be it Java, Python, or even Matlab. But since you didn't get a specific answer here yet (and I doubt you'll ever get one, given how dormant this "discussion forum" is), rest assured that it's definitely possible to automate your manual work-around. You just need to figure out the API calls, and translate that from Java to Python. Which, for the general case, is answered in the pinned discussion, #86 , and by extension also in the documentation. |
Beta Was this translation helpful? Give feedback.
-
Thank you! This worked:
which changes each line of the initial values, or to start with physics controlled values:
I tried to make it more pythonic but couldn't make it work. I tried variations of (in the last example line)
and I get this error: TypeError: eval() arg 1 must be a string, bytes or code object. and I don't really understand what is the problem. Thanks again! `` |
Beta Was this translation helpful? Give feedback.
-
Hello, and thank you for this amazing interface!
I am trying to solve a cyclic time-dependent problem, where the last solution of the 1st step of a study is used as initial values in the second step, and then the last solution for the second step goes back as initial parameters of the first one, and so on.
My problem is that the first time the code is run, the initial values for step 1 must be physics-controlled (instead of the solution of step 2, which doesn't exist yet). My workaround is running the model the first time, then manually changing the initial values to "solution of step 2", and then cycling using mph, but would be great if I could change the initial values from the Python code itself.
Thank you!
Beta Was this translation helpful? Give feedback.
All reactions