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

Nice to have - setting values back to system from time series data for a specific time step #87

Open
rbolgaryn opened this issue Feb 3, 2025 · 0 comments
Labels
help wanted Extra attention is needed

Comments

@rbolgaryn
Copy link
Contributor

# This cannot work because we do not know the redistribution keys from the power values of devices 
# to the power values of buses. Leaving this here anyways to document this issue.
function set_system_time_step(sys::PSY.System, data::PowerFlowData; time_step = 1)
    @error("This function cannot work")
    for bus in PSY.get_components(PSY.Bus, sys)
        bus_number = data.bus_lookup[PSY.get_number(bus)]
        bus_type = data.bus_type[bus_number, time_step]
        sys_bus_type = sys.bustype # here we should be using the system bus type to know which inputs to modify

        # for REF bus, we don't need to set anything
        if sys_bus_type == PSY.ACBusTypes.PV
            # we need to modify the P value
            # TODO if we also modify time-series data for voltage set-points, also set that value. 
            #  However, we cannot do this easily because it can happen that the PV -> PQ transformation 
            #  caused a different Vm value as the result, while the set-point Vm is still the same. 
            #  We need a solution for this.
            P_gen = data.bus_activepower_injection[bus_number, time_step]
            Q_gen = 0.0
            # TODO write time-series value of the bus back to devices (not possible)
        elseif sys_bus_type == PSY.ACBusTypes.PQ
            P_gen = data.bus_activepower_injection[bus_number, time_step]
            Q_gen = data.bus_reactivepower_injection[bus_number, time_step]
            P_load = data.bus_activepower_withdrawals[bus_number, time_step]
            Q_load = data.bus_reactivepower_withdrawals[bus_number, time_step]
            # TODO write time-series value of the bus back to devices (not possible)
        end
    end
end
@rbolgaryn rbolgaryn added the help wanted Extra attention is needed label Feb 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant