NREL / ssc

SAM Simulation Core (SSC) contains the underlying performance and financial models for SAM
BSD 3-Clause "New" or "Revised" License
79 stars 85 forks source link

Update debt fraction limits code to only lend when projects have a possitive ebitda. #1136

Closed brtietz closed 7 months ago

brtietz commented 7 months ago

Change != to > for debt fraction sizing code. Ensures that projects with negative EBITDA get zero debt, even in IRR target mode. Additionally, ensure minimum debt fraction is non-zero to ensure the relevant code always runs. If users want zero debt, they can specify it in debt percent mode.

My opinion is that if users want negative DSCR or other strange behavior, they can uncheck this box, but happy to discuss.

Test file available in the issue. Fixes: https://github.com/NREL/SAM/issues/1353

brtietz commented 7 months ago

For consistency, we should update the other occurrences of "if (dscr!=0)" : image

That seems worth some discussion. If the debt fraction limits box is unchecked, I was under the impression we allowed negative DSCRs. Similarly, if a debt percent is specified, a negative DSCR is a valid outcome of this calculation. I'll add to the SAM team meeting agenda to discuss.

Also, (maybe a separate issue) we should update cmod_communitysolar to have the same max debt fraction checking and to have the dscr>0 check image

I had filed https://github.com/NREL/SAM/issues/1708 for that, thanks for the reminder on community solar. I had that tagged for the fall release, but happy to discuss which portions are patchable versus requiring a release.

brtietz commented 7 months ago

Decision at 2/27 SAM meeting:

cpaulgilman commented 7 months ago

Links to related issues now closed:

brtietz commented 7 months ago

@cpaulgilman Thanks, I added debt percent < 0 check to the check functions from https://github.com/NREL/ssc/pull/903/files. This is ready for a second review.