Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions cta-optimizer/Readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
README for Corrective Topological Actions optimizer


CTA version 1.0, June 8, 2016
Copyright (C) 2016, Tractebel Engineering SA
All rights reserved


The Corrective Topological Actions optimizer (CTA) is a proprietary software of TRACTEBEL ENGINEERING S.A.


It is integrated into the iTesla Power System Tool through the “CTA-integration” module.
The CTA-integration module 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/

The use of the Corrective Topological Actions optimizer (CTA) requires :

1. A license agreement duly signed with TRACTEBEL ENGINEERING S.A.

TRACTEBEL freely allows the use of CTA for research projects.
Detailed conditions may be obtained on request to support-eurostag@tractebel.engie.com

2. A set of configuration files for the module

They will be delivered by TRACTEBEL after the signature of the license agreement.

3. The XPRESS solver with support of AMPL

The CTA optimizer is based on AMPL anonymized scripts.
Those scripts are using the XPRESS solver.
The XPRESS solver must therefore be installed and configured on the hosting computer.
193 changes: 193 additions & 0 deletions cta-optimizer/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,193 @@
<?xml version="1.0"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>eu.itesla_project</groupId>
<artifactId>itesla-parent</artifactId>
<version>0.1-SNAPSHOT</version>
</parent>

<artifactId>cta-optimizer</artifactId>

<name>Corrective Topological Actions optimizer</name>
<description>classes to build optimization problem with cta opitmizer</description>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<tests.to.exclude>**/*ITest.java</tests.to.exclude>
<ipso.path>${user.home}/share/ipso</ipso.path>
<solver.path>/opt/xpressmp</solver.path>
<ampl.path>/opt/ampl-9.1</ampl.path>
<solverResources.path>${user.home}/Documents/solverResources</solverResources.path>
<contingencies.path>${user.home}/Documents/action-ctg_France_V0.4.xml</contingencies.path>
<network.folder>${user.home}/Documents/20130115_1845_SN2_FR0</network.folder>
<network.prefix>20130115_1845_SN2_FR0</network.prefix>
</properties>

<profiles>
<profile>
<id>ipso-integration-test</id>
<properties>
<tests.to.exclude>nothingToExclude</tests.to.exclude>
</properties>
</profile>
</profiles>

<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
</dependency>

<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</dependency>

<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
</dependency>

<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>case-repository</artifactId>
<version>${project.version}</version>
</dependency>

<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>iidm-network-api</artifactId>
<version>${project.version}</version>
</dependency>

<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>iidm-network-impl</artifactId>
<version>${project.version}</version>
</dependency>

<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>iidm-actions-contingencies-xml-client</artifactId>
<version>${project.version}</version>
</dependency>

<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>iidm-import-export-api</artifactId>
<version>${project.version}</version>
<type>jar</type>
</dependency>

<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>iidm-xml-import-export</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
</dependency>

<dependency>
<groupId>org.apache.velocity</groupId>
<artifactId>velocity</artifactId>
<version>1.7</version>
</dependency>


<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>cim1-import</artifactId>
<version>${project.version}</version>
</dependency>

<dependency>
<groupId>net.sf.supercsv</groupId>
<artifactId>super-csv</artifactId>
</dependency>

<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>eurostag-ech-export</artifactId>
<version>${project.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>eurostag-step-up-transformer</artifactId>
<version>${project.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>ucte-import</artifactId>
<version>${project.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
</dependency>

<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>computation</artifactId>
<version>${project.version}</version>
</dependency>

<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>modules</artifactId>
<version>${project.version}</version>
</dependency>

<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>computation-local</artifactId>
<version>${project.version}</version>
</dependency>

<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-all</artifactId>
<scope>test</scope>
</dependency>

</dependencies>

<build>
<testResources>
<testResource>
<includes>
<include>**/*.properties</include>
</includes>
<directory>src/test/resources</directory>
<filtering>true</filtering>
</testResource>
<testResource>
<excludes>
<exclude>**/*.properties</exclude>
</excludes>
<directory>src/test/resources</directory>
<filtering>false</filtering>
</testResource>
</testResources>

<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<excludes>
<exclude>${tests.to.exclude}</exclude>
</excludes>
</configuration>
</plugin>
</plugins>
</build>

</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
/** Copyright (c) 2016, Tractebel (http://www.tractebel-engie.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/.
**/
package eu.itesla_project.cta.converter;

import eu.itesla_project.cta.model.IpsoEquipment;
import eu.itesla_project.iidm.network.CurrentLimits;
import eu.itesla_project.iidm.network.Identifiable;
import eu.itesla_project.iidm.network.TwoTerminalsConnectable;

import java.util.Optional;

import static com.google.common.base.Preconditions.checkArgument;

/**
* @author Yannick Pihan <yannick.pihan at tractebel.engie.com>
*/

abstract class AbstractBranchModelConverter<F extends Identifiable, T extends IpsoEquipment> extends AbstractModelConverter<F,T>{

protected AbstractBranchModelConverter(ConversionContext context) {
super(context);
}

protected float findMaxCurrentPermanentLimitFor(TwoTerminalsConnectable connectable) {
checkArgument(connectable != null, "connectable must not be null");
Optional<CurrentLimits> currentLimits1 = Optional.ofNullable(connectable.getCurrentLimits1());
Optional<CurrentLimits> currentLimits2 = Optional.ofNullable(connectable.getCurrentLimits2());

if (currentLimits1.isPresent() && currentLimits2.isPresent()) {
float perm1 = currentLimits1.get().getPermanentLimit();
float perm2 = currentLimits2.get().getPermanentLimit();

if (!Float.isNaN(perm1) && !Float.isNaN(perm2)) {
return Math.max(perm1,perm2);
}
else if (!Float.isNaN(perm1)) {
return perm1;
}else if(!Float.isNaN(perm2)) {
return perm2;
}else {
return Float.NaN;
}
}else if (currentLimits1.isPresent()) {
return currentLimits1.get().getPermanentLimit();
} else if (currentLimits2.isPresent()) {
return currentLimits2.get().getPermanentLimit();
} else {
return Float.NaN;
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
/** Copyright (c) 2016, Tractebel (http://www.tractebel-engie.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/.
**/
package eu.itesla_project.cta.converter;

import eu.itesla_project.cta.model.IpsoLoad;
import eu.itesla_project.cta.model.IpsoNode;
import eu.itesla_project.iidm.network.Bus;
import eu.itesla_project.iidm.network.Equipments;
import eu.itesla_project.iidm.network.Identifiable;
import eu.itesla_project.iidm.network.Load;

/**
* @author Yannick Pihan <yannick.pihan at tractebel.engie.com>
*/
abstract class AbstractLoadModelConverter<F extends Identifiable> extends AbstractModelConverter<F, IpsoLoad>{

AbstractLoadModelConverter(ConversionContext context) {
super(context);
}

protected IpsoLoad convertLoad(Load load) {

String id = createIpsoId();

Equipments.ConnectionInfo info = Equipments.getConnectionInfoInBusBreakerView(load.getTerminal());
Bus bus = info.getConnectionBus();

final IpsoNode ipsoNode = getContext().getMappingBetweenIidmIdAndIpsoEquipment().getIpsoNodeFor(bus).get();

final float activePower = load.getTerminal().getP();
final float reactivePower = load.getTerminal().getQ();

return new IpsoLoad(
id,
load.getId(),
ipsoNode,
info.isConnected(),
activePower,
reactivePower,
getContext().getWorld());
}
}
Loading