NREL / SAM

System Advisor Model (SAM)
BSD 3-Clause "New" or "Revised" License
318 stars 136 forks source link

Divide by zero in send to excel with equations #1784

Closed brtietz closed 3 weeks ago

brtietz commented 4 weeks ago

Describe the bug

When setting depreciation to 100% on one category (such as 5 year MACRS) the send to excel with equations produces a divide by zero error.

To Reproduce

Steps to reproduce the behavior:

  1. Open attached send to Excel spreadsheet, see error: div_by_zero_host_developer.zip

Tested in host developer, may exist in others.

Expected behavior

Setting depreciation to 100% in any category should be allowed. I suspect cell B398 on the cash flow tab should be referring to C145 on the inputs tab, like the cells nearby.

Operating System and Version

Additional context

@cpaulgilman, I'm assinging this to you, and leave it to your discretion whether to solve this in the patch (maybe in the Excel updates after https://github.com/NREL/SAM/issues/1477), or delaying until the release.

brtietz commented 4 weeks ago

I'm going to put a few other send to Excel issues here as I find them. The inputs sheet has two places for the ITC, which aren't linked by equations:

image

image

Perhaps the one on C106 should be the sum of the ones on line 179?