First time here? We are a friendly community of Power Systems Engineers. Check out the FAQ!

Ask Your Question
0

Scipy optimize during dynamic simulations

asked Nov 27 '0

IndiraX gravatar image

updated Nov 27 '0

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...)

2 answers

Sort by » oldest newest most voted
0

answered Dec 2 '0

jfconroy gravatar image

updated Dec 2 '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.

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 gravatar imageIndiraX (Dec 2 '0)

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

jfconroy gravatar imagejfconroy (Dec 2 '0)

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 gravatar imagejfconroy (Dec 2 '0)

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 gravatar imageIndiraX (Dec 3 '0)
0

answered Dec 1 '0

IndiraX gravatar image

Nobody has replied :(

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 gravatar imagelikethevegetable (Dec 1 '0)

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 gravatar imagelikethevegetable (Dec 1 '0)

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 gravatar imageIndiraX (Dec 2 '0)

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.
Want to format code in your answer? Here is a one minute demo on Youtube

Add Answer

[hide preview]

Question Tools

1 follower

Stats

Asked: Nov 27 '0

Seen: 607 times

Last updated: Dec 02 '20