Skip to content

Update Residential / Commercial Cash Flow to Excel for Battery and Fuel Cell#1545

Merged
cpaulgilman merged 2 commits into
developfrom
SAM1403_cashflow-excel-batt-fuelcell
Nov 16, 2023
Merged

Update Residential / Commercial Cash Flow to Excel for Battery and Fuel Cell#1545
cpaulgilman merged 2 commits into
developfrom
SAM1403_cashflow-excel-batt-fuelcell

Conversation

@cpaulgilman

Copy link
Copy Markdown
Collaborator

Pull Request Template

Description

Modify residential_commercial.xlsx workbook for send-to-Excel with equations:

  • Account for battery operating costs
  • Account for fuel cell operating costs
  • Account for fuel cell value of thermal energy

Send-to-Excel with equations values of LCOE and NPV for default PV-Battery / Commercial and Fuel Cell / Commercial configurations should now match values in SAM metrics table.

Fixes #1403

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update
  • This change modifies variables in existing compute modules. Please see Checking for PySAM Incompatible API Changes.

Checklist:

If you have added a new compute module in a SSC pull request related to this one, be sure to check the Process Requirements.

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules
  • I have checked my code and corrected any misspellings

@cpaulgilman cpaulgilman added the bug label Nov 2, 2023
@cpaulgilman cpaulgilman added this to the SAM Fall 2023 Release milestone Nov 2, 2023
@cpaulgilman cpaulgilman requested a review from brtietz November 2, 2023 22:05
@cpaulgilman cpaulgilman self-assigned this Nov 2, 2023
@brtietz

brtietz commented Nov 3, 2023

Copy link
Copy Markdown
Collaborator

I tested this with PV-Battery Commercial and got the OLE automation error 3 times in a row, even after restarting SAM and renaming the file so it wasn't overwriting an existing Excel. Any recommendations for how to kick that error? Is a full rebuild necessary?

@cpaulgilman

cpaulgilman commented Nov 7, 2023

Copy link
Copy Markdown
Collaborator Author

@brtietz I sometimes get an OLE Automation error with Send-to-Excel with Equations, but it usually opens the appropriate Excel workbook and populates the inputs, so it's just an annoyance to have to close the error window. Is it preventing the workbook inputs from being populated for you?

image

This has long been an issue for any SAM functions that interact with Excel.

@brtietz

brtietz commented Nov 8, 2023

Copy link
Copy Markdown
Collaborator

When the error shows up for me, it populates some but not all of the values, which causes things like LCOE and NPV to mismatch (which seemed critical to the review).

@cpaulgilman

Copy link
Copy Markdown
Collaborator Author

@sjanzou Do you have any thoughts on how fixable this OLE Automation error might be? I had not noticed it was sometimes resulting in partial data being sent from SAM to Excel. Should we create a separate issue for this to investigate after the release?

@sjanzou

sjanzou commented Nov 10, 2023

Copy link
Copy Markdown
Collaborator

@sjanzou Do you have any thoughts on how fixable this OLE Automation error might be? I had not noticed it was sometimes resulting in partial data being sent from SAM to Excel. Should we create a separate issue for this to investigate after the release?

The OLE Automation error is from automtn.cpp in src/msw/ole folder in wxWidgets:
image

According to Microsoft, the error can be caused by a reference issue
https://support.microsoft.com/en-us/topic/excel-automation-fails-second-time-code-runs-6647c4b4-da5c-ee1f-cc6f-58815d47702d

I created issue #1563

@cpaulgilman

Copy link
Copy Markdown
Collaborator Author

I think this PR fixes #1403. For this test file, I get reasonably close NPV, real LCOE, and nominal LCOE:

image

@brtietz Can we merge this into Develop and deal with the OLE Automation error separately with #1563?

@brtietz brtietz left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good based on test file

@cpaulgilman cpaulgilman merged commit db0ceb5 into develop Nov 16, 2023
@cpaulgilman cpaulgilman deleted the SAM1403_cashflow-excel-batt-fuelcell branch November 16, 2023 21:47
@cpaulgilman cpaulgilman added the added to release notes PR and/or issue has been added to release notes for a public release label Nov 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

added to release notes PR and/or issue has been added to release notes for a public release bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

LCOE real for PV + Storage discrepancy in the cash flow 'send to Excel with equations' workbook.

3 participants