Skip to content

fixed endless SOC iteration for HEVs#260

Merged
kylecarow merged 4 commits into
fastsim-3from
f3/endless-soc-iteration
Jul 13, 2026
Merged

fixed endless SOC iteration for HEVs#260
kylecarow merged 4 commits into
fastsim-3from
f3/endless-soc-iteration

Conversation

@kylecarow

Copy link
Copy Markdown
Collaborator

@jhoshiko @jakeholden

I've fixed the issue with endless SOC iteration that we were seeing in https://github.nrel.gov/MBAP/fastsim/issues/423.

The issue was that when starting a new iteration, only the ending SOC -> starting SOC carryover was plumbed up correctly. The actual iteration counter was getting reset each iteration as it is stored within the Vehicle object.

This PR does not fix the issues with those specific vehicles not converging to a balanced SOC!

@kylecarow kylecarow requested a review from jhoshiko June 23, 2026 18:00
@kylecarow kylecarow added the bug Something isn't working label Jun 23, 2026
@kylecarow

Copy link
Copy Markdown
Collaborator Author

Worth noting too that the default maximum iterations in fastsim-3 is 5, which is decreased from the fastsim-2 maximum of 30(!!!)

@jakeholden Should we change this limit back?

@kylecarow

Copy link
Copy Markdown
Collaborator Author

@jhoshiko the error for > 5 iterations seems like its pretty vague, let me know if the message you see should be changed :)

if self
.veh
.hev()
.with_context(|| format_dbg!())?
.soc_bal_iters
.get_fresh(|| format_dbg!())?
> &self
.veh
.hev()
.with_context(|| format_dbg!())?
.sim_params
.soc_balance_iter_err
{
bail!(
"{}",
format_dbg!((
self.veh
.hev()
.with_context(|| format_dbg!())?
.soc_bal_iters
.clone(),
self.veh
.hev()
.with_context(|| format_dbg!())?
.sim_params
.soc_balance_iter_err
))
);
}

@kylecarow

Copy link
Copy Markdown
Collaborator Author

@jhoshiko can this be merged?

@jhoshiko jhoshiko 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.

I'd Say So!

@kylecarow kylecarow merged commit e26fe17 into fastsim-3 Jul 13, 2026
9 of 12 checks passed
@kylecarow kylecarow deleted the f3/endless-soc-iteration branch July 13, 2026 16:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants