First time here? We are a friendly community of Power Systems Engineers. Check out the FAQ!
1 | initial version |
You don't really need to calculate the losses yourself as the APIs already have them.
For example, the "aflowreal()" function in the psspy module, which give you the losses of the whole subsystem. You can also get losses by area, just read the API doc.
After acquiring the data, export them to Excel is easy. Just use openpyxl or other modules. I won't recommend PSSE's Excel module though. It is very bad and it terminates all Excel processes without warning on import. It is even easier to export the data to CSV. You just need the standard Python lib.