-
Notifications
You must be signed in to change notification settings - Fork 114
Fixes SAM #496 #541
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixes SAM #496 #541
Conversation
…files 447 ssc tests all passing
brtietz
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes look good overall, though it looks like the test is failing (good to have a test for this!). Generally, I'd prefer to have the commented out lines removed to avoid future confusion.
| int num_cells_series; // number of cells in series | ||
| int num_strings; // addition number in parallel | ||
| // int overflow erroeous results | ||
| // int num_cells_series; // number of cells in series |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove commented out code (leaving the bit about the int causing an overflow is fine)
|
@dguittet, yes, this "fix" was to convert 19 key variables from int to doubles throughout the UI and in all calculations in the PV and Battery libraries and compute modules as detailed in the above Word document. |
|
The data type ranges can be viewed at https://docs.microsoft.com/en-us/cpp/cpp/data-type-ranges?view=msvc-160 (for our predominant platform). The int to long long is okay but does not address the mixture of previous typecasting in ssc that is in patch and develop. Also, the wex library would have to be updated to display properly to whatever we chose as our standard going forward. |
|
The failing test will be addressed after we decide on a path forward... |
While I see your point that we should stay with consistent types, I don't think making everything a ssc_number_t makes sense because there are discrete variables and should represented as such, not as doubles. I'm worried this will lead to unintended problems. And you're absolutely right that my suggestion of using
That's true on the battery model side, and suggests we add error checks around those implicit typecasting lines and function and throw reasonable errors back to both the SDK and SAM users.
Perhaps this reinforces that |
|
Re-starting this convo for patch 2, I still don't think we should be using doubles to represent values that are inherently integers. In SSC, we can add a check that these integer inputs are > 0 and then throw an exception so that SAM can properly notify the user. In SAM, we'll need to add a callback function to protect against negative overflow if we don't want to even display these negative values to the user. |
@brtietz , @dguittet, @cpaulgilman |
|
@sjanzou Good point about the size limitations. This can be resolved by using larger cells. The default cell sizes are rather small and probably unrealistic building blocks for MWh+ battery systems... |
|
I don't think it's necessary to support sizes above max int. 2.1TWh is ~500x the annual installations for the entire US. If they want to model systems that large they should be using ReEDS, not SAM. |
|
Closed as per discussion in 11/16 mtg |

No description provided.