How do I prompt the software to provide the total generation by year by generator? Is there an easy way to get the entire simulation’s generation (MWh) by generator object? I know how to get each one individually {esum(‘GEN_TYPE.GEN_NAME.P’)} and how to get a table of hourly values for all of a certain GEN_TYPE but combining esum and table functions are giving me a hard time.
Use this script: but change your values to reflect your gen types and names, and desired units.
PCM_FULL_YEAR Scenario Results
Generation by Generator
Define start and end time
start = ‘01/01/2025 01:00’
end = ‘01/01/2026 00:00’
Plot
nplot(
‘PV.PV_HABITAT.P.[kW];r196g78b82;legend=PV Habitat;stack’,
‘PV.PV_ISRU.P.[kW];r140g140b140;legend=PV ISRU;stack’,
‘PV.PV_ICEMINING.P.[kW];r147g120b96;legend=PV Ice Mining;stack’,
‘PV.PV_ROVERS.P.[kW];r85g168b104;legend=PV Rovers;stack’,
‘PV.PV_SCIENCE.P.[kW];r221g132b82;legend=PV Science;stack’,
‘PV.PV_AGRICULTURE.P.[kW];r144g255b177;legend=PV Agriculture;stack’,
‘PV.PV_MANUFACTURING.P.[kW];r255g224b139;legend=PV Manufacturing;stack’,
‘FGEN.SMR.P.[kW];r255g204b51;legend=SMR;stack’,
‘ENET.PDSET.[kW];6;black;legend=Load;’
‘Title=Generation Fleet Dispatch;’,
start,
end
)
Good suggestion @smeloney! Using an IronPython script to combine many commands that are commonly used is great practice.
I have another recommendation that I think you both may find interesting. The quickest way I would recommend doing this is to use something like table('GEN.%.P','01/01/2024 01:00','01/01/2025 00:00')
. This would pull the results for all generators for the full year, and you can refer to the summary at the top which shows the Sum for each column. You can also right-click and export the table to Excel and the Sums will appear in the data there as well.
The explanation for you, @sean.morash, is that you actually have more object types available to you than just FGEN, XGEN, PV, WIND, etc. You also have options that include wider sets of objects like GEN (all generators), EXT (all externals), and EBR (all electric branches). To see the full set of objects and object groupings available, go to the Table
tab in the SAInt GUI and scroll through the set of options there. Keep in mind that when using these higher-level object groupings, you can only query properties that are common to all the child classes of objects. For example, you can’t query table('GEN.%.F')
because only FGENs have this property.
The direct answer to your question, @sean.morash, is that currently the esum
function native to the IronPython Interpreter in SAInt does not support exactly what you are asking for. This is great feedback for us, and I suspect my recommendation should be sufficient for now. Let me know if this works, doesn’t work, or if you disagree! If needed, I can always refer to the judgement of our IronPython guru @kwabena. I’m sure he would know a way to perform whatever calculations you need, and we would love to get feedback on how we can make querying results more user-friendly.
Happy analysis!
Thanks, Will! The suggested query is helpful, and the pointer to the GEN electric object type is particularly helpful.
I have also been trying to use the Export Results to an External File functionality so that I can pull a few standard things at once. However, the process is breaking down for me somewhere. I have a .txt file with 4 prompts as shown below.
When I input this, SAInt tells me via the Log Window that it has imported the file correctly, it then produces an Excel file which should have the results I want. Instead, the results file only contains the header for a Timestamp and a DateTime (no actual data). I do not see a log file.
Hi @sean.morash,
I’m glad that has been helpful!
Thanks for sharing this issue. You’ve bumped into a known limitation of the results exporting feature: the %
wildcard operator is not supported. This means you would need to write each External on a separate line, e.g. EXT.SOME_EXTERNAL.P.[MW]
.
While we do plan to implement support for this in the future, up to this point it has not been a high priority in our development queue because there is support for this in our pySAInt
data processing package:
import pysaint as ps
ps.utils.write_data_from_saint(
project_dir='my/saint/project/',
netname='MY_NETWORK',
scenname='EXAMPLE_SCENARIO',
descriptors={
'EXT': ['P'],
}
)
I’m aware that your Free Trial includes the SAInt API. If you are interested in trying out the API and pySAInt, we would be happy to facilitate that!
If you just want the quick-and-dirty get-things-done solution in the meantime, I would recommend building your results description file by using the network import template in Excel (or some other spreadsheet tool). This would make the names of all objects readily available for something like =CONCATENATE("EXT.",$A2,".P.[MW]")
(using Excel syntax) and with some simple auto-fills you can easily generate your results description file in a couple of minutes no matter how many Externals you have in your network.
I hope this helps!