Skip to content

Support or add calc_branch_flow_nfa #977

@yasirroni

Description

@yasirroni

In https://lanl-ansi.github.io/PowerModels.jl/stable/power-flow/#Branch-Flow-Values, there are calc_branch_flow_ac and calc_branch_flow_dc, but not for calc_branch_flow_nfa. But, this will not help I think, except calc_branch_flow_nfa just:

function calc_branch_flow_nfa(data::Dict{String,<:Any})
    pm_data = get_pm_data(data)
    
    return Dict(
        "branch" => Dict(
            i => Dict(
                "pf" => branch["pf"],
                "qf" => branch["qf"],
                "pt" => branch["pt"], 
                "qt" => branch["qt"]
            ) for (i, branch) in data["branch"]
        ),
        "per_unit" => pm_data["per_unit"],
        "baseMVA" => pm_data["baseMVA"]
    )
end

Usage is the same with the other:

update_data!(network, result["solution"])
flows = calc_branch_flow_nfa(network)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions