-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Geoffroy Jamgotchian <[email protected]>
- Loading branch information
Showing
3 changed files
with
269 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# Maven projects | ||
target/ | ||
|
||
# IntelliJ | ||
/.idea | ||
*.iml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,111 @@ | ||
# powsybl-starter | ||
# PowSyBl Starter | ||
|
||
|
||
|
||
PowSyBl repositories versions: | ||
|
||
| powsybl-starter | powsybl-core | powsybl-open-loadflow | powsybl-single-line-diagram | powsybl-network-area-diagram | | ||
| --------------- | ------------ | --------------------- | --------------------------- | ---------------------------- | | ||
| 1.0.0 | 4.7.0 | 0.19.0 | 2.9.1 | 0.3.0 | | ||
|
||
|
||
|
||
## Getting started | ||
|
||
To start using PowSyBl components in a Maven project, you just have to include one dependency: | ||
|
||
```xml | ||
<dependency> | ||
<groupId>com.powsybl</groupId> | ||
<artifactId>powsybl-starter</artifactId> | ||
<version>1.0.0</version> | ||
</dependency> | ||
``` | ||
|
||
|
||
|
||
## Examples | ||
|
||
|
||
|
||
Create an IEEE 14 buses, run an AC load flow with default parameters, print calculation status and buses voltage magnitude: | ||
|
||
```java | ||
Network network = IeeeCdfNetworkFactory.create14(); | ||
LoadFlowResult result = LoadFlow.run(network); | ||
System.out.println(result.getComponentResults().get(0).getStatus()); | ||
network.getBusView().getBusStream().forEach(bus -> System.out.println(bus.getId() + " " + bus.getV())); | ||
``` | ||
|
||
|
||
|
||
Run a DC load flow instead of an AC one: | ||
|
||
```java | ||
Network network = IeeeCdfNetworkFactory.create14(); | ||
LoadFlowParameters parameters = new LoadFlowParameters() | ||
.setDc(true); | ||
LoadFlow.run(network, parameters); | ||
``` | ||
|
||
|
||
|
||
Load a PSS/E raw file, run an AC load flow and generate a single line diagram for voltage level 'VL8': | ||
|
||
```java | ||
Network network = Importers.loadNetwork("IEEE_118_bus.raw"); | ||
LoadFlow.run(network); | ||
SingleLineDiagram.draw(network, "VL8", "vl8.svg"); | ||
``` | ||
|
||
|
||
|
||
Load a UCTE file, run an AC load flow and generate a full network diagram: | ||
|
||
```java | ||
Network network = Importers.loadNetwork("simple-eu.uct"); | ||
LoadFlow.run(network); | ||
new NetworkAreaDiagram(network).draw(Paths.get("simple-eu.svg")); | ||
``` | ||
|
||
|
||
|
||
Load a UCTE file, run an AC security analysis with all N-1 line contingencies: | ||
|
||
```java | ||
Network network = Importers.loadNetwork("simple-eu.uct"); | ||
List<Contingency> contingencies = network.getLineStream().map(l -> Contingency.line(l.getId())).collect(Collectors.toList()); | ||
SecurityAnalysisResult result = SecurityAnalysis.run(network, contingencies).getResult(); | ||
``` | ||
|
||
|
||
|
||
Load 2 CGMES files, merge both networks and run a load flow on merged network: | ||
|
||
```java | ||
Network networkBe = Importers.loadNetwork("CGMES_v2_4_15_MicroGridTestConfiguration_BC_BE_v2.zip"); | ||
Network networkNl = Importers.loadNetwork("CGMES_v2_4_15_MicroGridTestConfiguration_BC_NL_v2.zip"); | ||
networkBe.merge(networkNl); | ||
LoadFlow.run(networkBe); | ||
``` | ||
|
||
|
||
|
||
Load a UCTE file and run a DC sensivity analysis of all generators active power injection on all branches active power flow for the pre-contingency state and for all N-1 line post-contingency states. | ||
|
||
```java | ||
Network network = Importers.loadNetwork("simple-eu.uct"); | ||
List<SensitivityFactor> factors = new ArrayList<>(); | ||
for (Generator g : network.getGenerators()) { | ||
for (Line l : network.getLines()) { | ||
factors.add(new SensitivityFactor(SensitivityFunctionType.BRANCH_ACTIVE_POWER, l.getId(), | ||
SensitivityVariableType.INJECTION_ACTIVE_POWER, g.getId(), | ||
false, ContingencyContext.all())); | ||
} | ||
} | ||
List<Contingency> contingencies = network.getLineStream().map(l -> Contingency.line(l.getId())).collect(Collectors.toList()); | ||
SensitivityAnalysisParameters parameters = new SensitivityAnalysisParameters(); | ||
parameters.getLoadFlowParameters().setDc(true); | ||
SensitivityAnalysisResult result = SensitivityAnalysis.run(network, factors, contingencies, parameters); | ||
``` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,152 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
Copyright (c) 2022, RTE (http://www.rte-france.com) | ||
This Source Code Form is subject to the terms of the Mozilla Public | ||
License, v. 2.0. If a copy of the MPL was not distributed with this | ||
file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
--> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<parent> | ||
<groupId>com.powsybl</groupId> | ||
<artifactId>powsybl-parent</artifactId> | ||
<version>8</version> | ||
<relativePath/> | ||
</parent> | ||
|
||
<artifactId>powsybl-starter</artifactId> | ||
<version>1.0.0-SNAPSHOT</version> | ||
|
||
<name>PowSyBl Starter POM</name> | ||
<description>A starter POM to help creating a PowSyBl based application faster</description> | ||
<url>https://www.powsybl.org</url> | ||
|
||
<scm> | ||
<connection>scm:git:https://github.com/powsybl/powsybl-starter.git</connection> | ||
<developerConnection>scm:git:https://github.com/powsybl/powsybl-starter.git</developerConnection> | ||
<url>https://github.com/powsybl/powsybl-starter</url> | ||
</scm> | ||
|
||
<developers> | ||
<developer> | ||
<name>Geoffroy JAMGOTCHIAN</name> | ||
<email>[email protected]</email> | ||
<organization>RTE</organization> | ||
<organizationUrl>http://www.rte-france.com</organizationUrl> | ||
</developer> | ||
</developers> | ||
|
||
<properties> | ||
<logback.version>1.2.10</logback.version> | ||
<slf4j.version>1.7.22</slf4j.version> | ||
|
||
<powsybl-dependencies.version>1.0.0</powsybl-dependencies.version> | ||
</properties> | ||
|
||
<dependencyManagement> | ||
<dependencies> | ||
<dependency> | ||
<groupId>com.powsybl</groupId> | ||
<artifactId>powsybl-dependencies</artifactId> | ||
<version>${powsybl-dependencies.version}</version> | ||
<type>pom</type> | ||
<scope>import</scope> | ||
</dependency> | ||
</dependencies> | ||
</dependencyManagement> | ||
|
||
<dependencies> | ||
<!-- platform config --> | ||
<dependency> | ||
<groupId>com.powsybl</groupId> | ||
<artifactId>powsybl-config-classic</artifactId> | ||
</dependency> | ||
|
||
<!-- network --> | ||
<dependency> | ||
<groupId>com.powsybl</groupId> | ||
<artifactId>powsybl-iidm-impl</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>com.powsybl</groupId> | ||
<artifactId>powsybl-iidm-reducer</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>com.powsybl</groupId> | ||
<artifactId>powsybl-iidm-test</artifactId> | ||
</dependency> | ||
|
||
<!-- network import/export --> | ||
<dependency> | ||
<groupId>com.powsybl</groupId> | ||
<artifactId>powsybl-iidm-xml-converter</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>com.powsybl</groupId> | ||
<artifactId>powsybl-ucte-converter</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>com.powsybl</groupId> | ||
<artifactId>powsybl-cgmes-conversion</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>com.powsybl</groupId> | ||
<artifactId>powsybl-triple-store-impl-rdf4j</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>com.powsybl</groupId> | ||
<artifactId>powsybl-psse-converter</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>com.powsybl</groupId> | ||
<artifactId>powsybl-powerfactory-converter</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>com.powsybl</groupId> | ||
<artifactId>powsybl-powerfactory-dgs</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>com.powsybl</groupId> | ||
<artifactId>powsybl-ieee-cdf-converter</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>com.powsybl</groupId> | ||
<artifactId>powsybl-matpower-converter</artifactId> | ||
</dependency> | ||
|
||
<!-- simulation --> | ||
<dependency> | ||
<groupId>com.powsybl</groupId> | ||
<artifactId>powsybl-open-loadflow</artifactId> | ||
</dependency> | ||
|
||
<!-- single line diagram --> | ||
<dependency> | ||
<groupId>com.powsybl</groupId> | ||
<artifactId>powsybl-single-line-diagram-core</artifactId> | ||
</dependency> | ||
|
||
<!-- network area diagram --> | ||
<dependency> | ||
<groupId>com.powsybl</groupId> | ||
<artifactId>powsybl-network-area-diagram</artifactId> | ||
</dependency> | ||
|
||
<!-- logging --> | ||
<dependency> | ||
<groupId>ch.qos.logback</groupId> | ||
<artifactId>logback-classic</artifactId> | ||
<version>${logback.version}</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.slf4j</groupId> | ||
<artifactId>log4j-over-slf4j</artifactId> | ||
<version>${slf4j.version}</version> | ||
</dependency> | ||
</dependencies> | ||
</project> |