Skip to content
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

update decision state for OnVariable and ActivePowerVariable #1232

Merged
merged 1 commit into from
Feb 1, 2025

Conversation

m-bossart
Copy link

No description provided.

@m-bossart m-bossart requested a review from jd-lara January 31, 2025 20:00
@m-bossart
Copy link
Author

This change seems to give the desired behavior of the generator outage and then being brought back online:
image

@@ -368,9 +355,11 @@ function update_decision_state!(
simulation_time::Dates.DateTime,
model_params::ModelStoreParams,
) where {T <: VariableType, U <: PSY.Component}
event_ocurrence_data = get_decision_state_data(state, AvailableStatusParameter(), U)
@error "UPDATE DECISION STATE $key"
event_ocurrence_data = get_decision_state_data(state, AvailableStatusChangeParameter(), U)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
event_ocurrence_data = get_decision_state_data(state, AvailableStatusChangeParameter(), U)
event_ocurrence_data =
get_decision_state_data(state, AvailableStatusChangeParameter(), U)

Comment on lines +384 to +385
if event_status_data.values[name, outage_index] == 0.0
state_data.values[name, outage_index] = 0.0
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
if event_status_data.values[name, outage_index] == 0.0
state_data.values[name, outage_index] = 0.0
if event_status_data.values[name, outage_index] == 0.0
state_data.values[name, outage_index] = 0.0

if event_status_data.values[name, outage_index] == 0.0
state_data.values[name, outage_index] = 0.0
@info "forcing $key to zero at index $outage_index because status was zero for $name"
else
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
else
else

Comment on lines +389 to +390
end
if outage_index == length(state_data.values[name, :])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
end
if outage_index == length(state_data.values[name, :])
end
if outage_index == length(state_data.values[name, :])

Comment on lines +392 to +394
end
outage_index += 1
end
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
end
outage_index += 1
end
end
outage_index += 1
end

@m-bossart
Copy link
Author

When applying the event, if the status is zero moving forward from a status change, then the OnVariable and ActivePower should be forced to zero in the decision model as well?

Copy link
Member

@jd-lara jd-lara left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR was tested synchronously and it fixed the observed problem

@jd-lara jd-lara merged commit 5d82c30 into jd/outages Feb 1, 2025
6 of 16 checks passed
@jd-lara jd-lara deleted the mb/outages-fix branch February 1, 2025 22:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants