Don’t think there is an API, like total_load, that calculates total generation. You can do this easily by summing the active powers (PG column) in the mpc.gen array.
If you have any question on what API functions are available in MATPOWER then please refer to http://www.pserc.cornell.edu//matpower/docs/ref/ Thanks, Shri Ph: (630) 252 0219 www.mcs.anl.gov/~abhyshr<http://www.mcs.anl.gov/~abhyshr> From: <bounce-122201204-73493...@list.cornell.edu> on behalf of Zain Anwer Memon <zainanwerme...@gmail.com> Reply-To: MATPOWER discussion forum <matpowe...@list.cornell.edu> Date: Wednesday, January 17, 2018 at 10:12 AM To: MATPOWER discussion forum <matpowe...@list.cornell.edu> Subject: Re: Introducing contingency in the network ok and how can I find total generation like we find total load through total_load? On Wed, Jan 17, 2018 at 5:07 PM, Abhyankar, Shrirang G. <abhy...@anl.gov<mailto:abhy...@anl.gov>> wrote: MATPOWER’s power flow does not enforce generator active power limits. To do so, run a dc optimal power flow (rundcopf). Thanks, Shri Ph: (630) 252 0219 www.mcs.anl.gov/~abhyshr<http://www.mcs.anl.gov/~abhyshr> From: <bounce-122200108-73493...@list.cornell.edu<mailto:bounce-122200108-73493...@list.cornell.edu>> on behalf of Zain Anwer Memon <zainanwerme...@gmail.com<mailto:zainanwerme...@gmail.com>> Reply-To: MATPOWER discussion forum <matpowe...@list.cornell.edu<mailto:matpowe...@list.cornell.edu>> Date: Wednesday, January 17, 2018 at 4:35 AM To: "matpowe...@list.cornell.edu<mailto:matpowe...@list.cornell.edu>" <matpowe...@list.cornell.edu<mailto:matpowe...@list.cornell.edu>> Subject: Introducing contingency in the network Hello everyone, I am analyzing a simple case, that has 3 generators and liming the max power of all the generators to some limit. If I turn off one generator, and run dc power flow, then one of the generator real power is increased by its own more than its MAX Power to meet the load requirement. how generators real power becomes more than its max active power power limit? I just want to have a difference in generation and demand so that I can implement a deterministic algorithm. -- Zain Anwer Memon -- Zain Anwer Memon