-
Notifications
You must be signed in to change notification settings - Fork 0
/
Sparlectra.jl
114 lines (98 loc) · 3.64 KB
/
Sparlectra.jl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
"""
Sparlectra 0.4.18
Sparlectra is a Julia package for the calculation of electrical networks. It is designed to be used in the context of power system analysis and optimization.
- [GitHub Repository](https://github.com/welthulk/Sparlectra.jl)
- [Website](https://welthulk.github.io/Sparlectra.jl)
**Naming Conventions:**
The project follows the Julia Naming Conventions for the most part,
but it's important to note that the naming convention for functions might deviate.
In this module, functions are written in CamelCase with a lowercase initial letter.
"""
module Sparlectra
# Author: Udo Schmitz (https://github.com/Welthulk)
# Purpose: network calculation
# Naming Conventions:
# The project follows the Julia Naming Conventions for the most part,
# but it's important to note that the naming convention for functions might deviate.
# In this module, functions are written in CamelCase with a lowercase initial letter.
#! format: off
using LinearAlgebra, SparseArrays, Printf, Logging
# resource data types for working with Sparlectra
const Wurzel3 = 1.7320508075688772
const SparlectraVersion = VersionNumber("0.4.18")
abstract type AbstractBranch end
export
# constants
Wurzel3, ComponentTyp,
# classes
# Component
AbstractComponent, Component, ImpPGMComp, ImpPGMComp3WT,
# Node
Node,
# Line
ACLineSegment,
# Trafo
TrafoTyp, PowerTransformerTaps, PowerTransformerWinding, PowerTransformer, TransformerModelParameters,
# ProSumer
ProSumer,
# Branch
AbstractBranch, Branch,BranchModel, BranchFlow, getBranchFlow, setBranchFlow!, setBranchStatus!,getBranchLosses, setBranchLosses!,
# Shunt
Shunt,
# Net
Net,
# functions
# Compomnent
toComponentTyp, getRXBG, getCompName,
# Transformers
getSideNumber2WT, getWinding2WT, calcTransformerRatio, recalc_trafo_model_data, create2WTRatioTransformerNoTaps, create3WTWindings!,
getTrafoImpPGMComp, getWT3AuxBusID, isPerUnit_RXGB, getWindingRatedS,
# Nodes
setRatedS!, setVmVa!, addShuntPower!, addLoadPower!, addGenPower!, getNodeVn, isSlack, isPVNode, isPQNode, isIsolated, toNodeType, setNodeType!,
busComparison, toString,
# Branch
setBranchFlow!, setBranchStatus!,
# Shunt
getGBShunt, getPQShunt, updatePQShunt!,
# ACLineSegment
get_line_parameters, isPIModel,
# ProSumer
isSlack, isGenerator, isAPUNode, setQGenReplacement!, getQGenReplacement, toProSumptionType, updatePQ!,
# Net
addBus!, addShunt!, addACLine!, addPIModelACLine!, add2WTrafo!, addPIModelTrafo!, addProsumer!, lockNet!, validate!, hasBusInNet, addBusGenPower!, addBusLoadPower!, addBusShuntPower!,
getNetOrigBusIdx, geNetBusIdx, setBranchStatus!, setTotalLosses!, getTotalLosses, getBusType, get_bus_vn_kV, get_vn_kV, updateBranchParameters!, hasShunt!, getShunt!, markIsolatedBuses!,
# create_powermat.jl
casefileparser, createNetFromMatPowerFile,
# exportMatPower.jl
writeMatpowerCasefile,
# equicircuit.jl
calcComplexRatio, calcNeutralU, createYBUS, adjacentBranches, toPU_RXGB, to_RXGB,
# nbi.jl
getNBI, mdoRCM,
# jacobian.jl
setJacobianDebug, setJacobianAngleLimit, runpf!,
# losses.jl
calcNetLosses!,
# results.jl
printACPFlowResults, convertPVtoPQ!,
# run_acpflow.jl
run_acpflow, run_net_acpflow
include("component.jl")
include("lines.jl")
include("transformer.jl")
include("prosumer.jl")
include("node.jl")
include("branch.jl")
include("shunt.jl")
include("network.jl")
include("import.jl")
include("equicircuit.jl")
include("jacobian.jl")
include("losses.jl")
include("nbi.jl")
include("createnet_powermat.jl")
include("exportMatPower.jl")
include("results.jl")
include("run_acpflow.jl")
#! format: on
end # module Sparlectra