Hi, Mr. Kardos already gave the references for you to explore the cost functions in detail. A quick fix: If you just want to minimize reactive power, then just put cost terms of the real power to zero in its approriate mpc.gencost field ☺
Btw, minimizing objective function can mean anything, as it depends on your “function”. It cannot always mean considering only the reactive power, as you mentioned in your previous email. Thanks, Sarmad From: [email protected] [mailto:[email protected]] On Behalf Of Akash Tyagi Sent: Wednesday, 12 July, 2017 4:59 PM To: MATPOWER discussion forum Subject: Re: Objective Functions Hello, The obj_func mainly minimizes the cost including the real and reactive power. But I have to only minimize objective function i.e. cost considering only the reactive power. I tried the way explained by you above but I am not able to do this.? Can you help? basically, my goal is to change the objective function. Thanks On Wed, Jul 12, 2017 at 1:49 PM, Akash Tyagi <[email protected]<mailto:[email protected]>> wrote: ok, thanks On Wed, Jul 12, 2017 at 1:40 PM, Kardoš Juraj <[email protected]<mailto:[email protected]>> wrote: Try to have a look in the code in opf_costfcn.m and compare it with the objective function definition in the manual (http://www.pserc.cornell.edu/matpower/manual.pdf) section 6.1 equation (6.6). You will find the function implemented in the code, as well as its gradient and Hessian w.r.t. vector x (equation 6.5). If you have problems with derivatives, have a look at section 6 in this document http://www.pserc.cornell.edu/matpower/TN2-OPF-Derivatives.pdf. It describes how the first and second derivatives can be computed. Good luck! ========================== Juraj Kardos Advanced Computing Laboratory Institute of Computational Science Universita della Svizzera italiana Via Giuseppe Buffi 13 Lugano 6904 Switzerland http://www.ics.inf.usi.ch =========================== On 12 Jul 2017, at 09:46, Akash Tyagi <[email protected]<mailto:[email protected]>> wrote: Can you explain me through simple example.? On Wed, Jul 12, 2017 at 1:09 PM, Kardoš Juraj <[email protected]<mailto:[email protected]>> wrote: Hello, as far as I know, you can define arbitrary objective function by modifying the following source file: opf_costfcn.m. Don’t forget that you need to provide gradient and Hessian w.r.t. OPF control variables as well. These derivations are used in optimizers to find the optimal solution. Best regards, ========================== Juraj Kardos Advanced Computing Laboratory Institute of Computational Science Universita della Svizzera italiana Via Giuseppe Buffi 13 Lugano 6904 Switzerland http://www.ics.inf.usi.ch<http://www.ics.inf.usi.ch/> =========================== On 12 Jul 2017, at 08:02, Akash Tyagi <[email protected]<mailto:[email protected]>> wrote: Hello everyone, I am working on congestion management and running optimal power flow. The Objective function after running the OPF is the cost, but I want to include my own objective function. Can you please let me know how to remove the existing objective function and include my own objective function. Thanks in advance
