Init section for device json input
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 27
- Forks
- 11
- Avg merge
- 3d 8h
- Merged PRs (30d)
- 23
Description
Summary
The exciter and governor models desperately need a way to initialize their external. We are initializing these models in an unfortunate way because we don't have a way to set the initial values of external states in the case format:
Some of the more advanced models cannot be implemented due to our current approach of intialziation intra-model.
Rationale
Right now, during initialization, the Genrou model writes information to the governor Tgov1 via the mechanical power signal. And then (the sequencing matters, which is unfortunate) the governor initialization reads this data that landed in its own internal state:
// Initial mechanical = initial electric torque
if (signals_.template isAssigned<Tgov1InternalVariables::PM>())
{
p0 = y_[2]; ///<- generator needs to be initialized first
}
// Input Variables (Parameter for now)
pref_ = R_ * p0;
which is then used to initialize the static values of pref which is an external variable of the governor
But the dependency chain is backward, since we can know a priori from the power flow solution the value of pref. And the case format itself embeds knowledge of the models, so if the machine Genrou isn't wired up to an exciter, then the author of the case format already knows to initialize pmech with the value we would have given pref if it had a governor.
Additionally, this would allow us to fully unit test models without coupling them with other models as we do with the exciter, governor, and machine trio.
Description
a init section which only accepts names of external variables
{
"class": "Tgov1",
"ports": {
"bus": 26,
"speed": 28,
"pmech": 29
},
"id": "26_1_tgov1",
"init":{
"pref": 10.0,
},
"params": {
"R": 0.05,
"T1": 0.5,
"T2": 2.5,
"T3": 7.5,
"Pvmin": 0.0,
"Pvmax": 1.0,
"Dt": 0.0
}
},
Additional information
I had a conversation a while ago about this with @abirchfield, but I hit a wall with the REECA exciter implementation for IBR because of this issue
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing initialization between the Genrou, Tgov1, and REECA models, especially the external pref and pmech values described in the issue. Review how the case format currently represents model data and how model unit tests initialize signals. Done means the case format can provide initial values for external variables and the coupled initialization path no longer requires the current sequencing dependency.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- backend
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100