0

Scipy optimize during dynamic simulations

Hi everyone,

Does anyone has used scipy.optimize to tune control parameters during dynamic simulations? What I expect is to adjust (increase/decrease) my parameters regarding an optimal decision for each dynamic simulation (iteration). The outcome will be a set of control parameters that will provide the desired response.

Thanks in advance.

https://psspy.org/psse-help-forum/question/6592/does-scipy-conflict-with-psse/ (https://psspy.org/psse-help-forum/que...)

IndiraX's avatar
27
IndiraX
asked 2020-11-27 00:52:08 -0500, updated 2020-11-27 01:00:14 -0500
edit flag offensive 0 remove flag close merge delete

Comments

add a comment see more comments

2 Answers

0

Nobody has replied :(

IndiraX's avatar
27
IndiraX
answered 2020-11-30 21:37:09 -0500
edit flag offensive 0 remove flag delete link

Comments

This is a pretty big ask. I don't have experience with this, but I could imagine how one could go about. Run your simulation within Python, open up the .out file, look at the recorded parameters, and adjust. I think opening the .out fle every one or few timesteps will get slow.

likethevegetable's avatar likethevegetable (2020-12-01 10:13:53 -0500) edit

You might be better off tuning the controls post-processing. If you have an algorithm to dynamically tune the parameters, perhaps you could implement it in a user-written model? Although writing that FORTRAN could be tough.

likethevegetable's avatar likethevegetable (2020-12-01 10:15:26 -0500) edit

Hi! I think you understand my issue really well. I have run my simulation, I access to the parameters, and I can evaluate my variables post-simulation. What I am looking for it is an algorithm to tune the parameters. I thought of scipy but I haven't seen any code on how to use for this process

IndiraX's avatar IndiraX (2020-12-01 19:39:48 -0500) edit
add a comment see more comments
0

This sounds like a classic optimization problem. You need to define what your objective is, and what are the ranges for which you are allowing the input parameters (controller settings) to change. You will then have to run simulations in a loop, checking the value of your objective function after each run, and adjusting your input parameters according to your optimization algorithm. This can all be automated in a Python program that is calling PSS/E, running the simulation and extracting the results from .out or .outx files.

jfconroy's avatar
186
jfconroy
answered 2020-12-02 02:05:50 -0500, updated 2020-12-02 02:06:15 -0500
edit flag offensive 0 remove flag delete link

Comments

Hi jfconroy! Yes, it is what I need to do. Firstly, I thought to use scipy but I don't think it will work. Then, I wonder if I could get an example from the forum to build my own code. It would be just great! Thanks

IndiraX's avatar IndiraX (2020-12-02 03:06:15 -0500) edit

I don't have an example that I can provide.

jfconroy's avatar jfconroy (2020-12-02 03:49:48 -0500) edit

If you're not happy with scipi, you can use one of the many optimization packages that are available on the Python package website pypi.org. Before starting your optimization code, you need to write the code to run PSS/E simulations in a loop and extract the results into Python/numpy arrays.

jfconroy's avatar jfconroy (2020-12-02 03:50:15 -0500) edit

Yes, I have my code to run the PSS/E simulation in a loop, read and change the CONs. I will have a look on the website you suggested jfconroy. Thanks

IndiraX's avatar IndiraX (2020-12-02 21:43:41 -0500) edit
add a comment see more comments

Your Answer

Login/Signup to Answer