Skip to content

Commit

Permalink
some docs clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
NLaws committed Dec 16, 2024
1 parent 48de600 commit a050d6f
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 11 deletions.
2 changes: 1 addition & 1 deletion docs/src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ Building a `BranchFlowModel` requires three things:
3. the type of model to be built, i.e. one of the [`BranchFlowModel.ModelType`](@ref)
```@docs
BranchFlowModel.ModelType
build_bfm!
```
To build a model see [build_bfm!](@ref)

# Variables

Expand Down
3 changes: 1 addition & 2 deletions docs/src/math.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,8 @@ w_i \ell_{ij} = P_{ij}^2 + Q_{ij}^2 \forall (i,j) \in \mathcal{E} \\
# Three Phase BranchFlowModel
```@docs
constrain_KVL(m, net::Network{MultiPhase})
BranchFlowModel.add_bfm_variables
```

See also [`add_bfm_variables`](@ref)

```math
\begin{aligned}
Expand Down
3 changes: 0 additions & 3 deletions docs/src/methods.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,11 @@ build_bfm!
constrain_power_balance
constrain_KVL
check_rank_one
check_soc_inequalities
get_load_bal_shadow_prices
reduce_tree!
trim_tree!
set_inputs!
get_diffs
solve_metagraph!
metagraph_voltages
check_statuses
remove_bus!
```
4 changes: 3 additions & 1 deletion src/BranchFlowModel.jl
Original file line number Diff line number Diff line change
Expand Up @@ -45,17 +45,19 @@ export
# end new methods TODO distinguish all exports by module

build_bfm!,
add_bfm_variables,
add_linear_variables,
add_variables,
add_sdp_variables,
constrain_power_balance,
constrain_substation_voltage,
constrain_KVL,
constrain_bfm_nlp,
# recover_voltage_current, # TODO validate this method
init_inputs!,
set_inputs!,
get_diffs,
solve_metagraph!,
metagraph_voltages,
check_statuses,
remove_bus!,

Expand Down
7 changes: 7 additions & 0 deletions src/model_single_phase.jl
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,13 @@ function build_bfm!(m::JuMP.AbstractModel, net::Network{SinglePhase}, ::Val{Line
end


"""
add_linear_variables(m, net::Network{SinglePhase})
Add variables for the single-phase, linear model:
- `Pij` and `Qij` for all `edges(net)`
- `p0` and `q0` slack bus power
"""
function add_linear_variables(m, net::Network{SinglePhase})
es = collect(edges(net))

Expand Down
5 changes: 1 addition & 4 deletions test/test_nlp.jl
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@


m = Model(Ipopt.Optimizer)
set_optimizer_attribute(m, "print_level", 0)
# set_optimizer_attribute(m, "print_level", 0)

build_bfm!(m, net, Unrelaxed)

Expand Down Expand Up @@ -75,12 +75,9 @@

dss_voltages = dss_voltages_pu()

errors = []
for b in keys(vs)
for (i, phsv) in enumerate(filter(v -> v != 0, vs[b]))
@test abs(phsv - dss_voltages[b][i]) < 1e-3
push!(errors, phsv - dss_voltages[b][i])
# println("$b - $i $(phsv - dss_voltages[b][i])")
end
end

Expand Down

0 comments on commit a050d6f

Please sign in to comment.