Skip to content
Automatisch übersetzt, noch nicht geprüft. Massgebend ist die englische Version.

API ​

Wir bieten einige öffentliche REST-Endpunkte an, mit denen Sie unter anderem

  • Berechnungen ausführen
  • Anschlussgesuche einreichen
  • Daten aus Adaptricity exportieren

Dokumentation der Endpunkte ​

Alle öffentlichen Endpunkte sind in Adaptricity unter User > API Documentation dokumentiert.

Netze und Zeitreihen werden über die separate Data Integration API (v3) importiert.

Seite API Documentation in Adaptricity

Authentifizierung ​

Für den Zugriff auf die Endpunkte benötigen Sie ein API-Token, das Sie in Ihrem Benutzerprofil erstellen.

Token erstellen

Dieses Token ist Ihr Schlüssel zu Adaptricity. Behandeln Sie es wie ein Passwort!

Beispiel ​

Als Beispiel betrachten wir den Lastfluss-Endpunkt. Er berechnet den Lastfluss eines Netzes und gibt die Ergebnisse im JSON-Format zurück.

http
POST https://{instance-id}.adaptricity.com/api/grid/{grid-id}/calculatepowerflow/v2

Vorbereitung ​

Zur Vorbereitung laden wir zuerst ein Netz in Adaptricity hoch:

Grids > Grid Editor > Load grid from file > example-grid.xml hochladen

Netz hochladen

Jedes Netz hat eine eindeutige, 24 Zeichen lange ID, die in der URL steht (im Screenshot gelb markiert). Entnehmen Sie die Grid-ID der URL. Lassen Sie beim Kopieren das führende «g» weg, es gehört nicht zur Grid-ID.

Die Web-URLs von Adaptricity haben meist dieses Format:

http
https://{instance-id}.adaptricity.com/#/{project-id}/s/g{grid-id}/

URL ​

Ersetzen Sie in der Endpunkt-URL {grid-id} und {instance-id} durch Ihre IDs.

http
POST https://{instance-id}.adaptricity.com/api/grid/{grid-id}/calculatepowerflow/v2

Request-Header ​

Setzen Sie diese Request-Header und ersetzen Sie {your-api-token} durch Ihr Token.

http
X-Auth-Token: {your-api-token}
Content-Type: application/json

Request-Body ​

Die Algorithmus-Einstellungen werden im Body übergeben.

json
{
	"DPGProtocolVersion": "2.0",
	"operationalVoltages": [],
	"algorithm": {
		"type": "FULL_NEWTON",
		"tolerance": 0.000001,
		"maxIter": 1000
	}
}

Request senden ​

Nun können Sie den Request mit einem Werkzeug wie Postman oder direkt in der Konsole, z. B. mit curl, senden. Ein Beispiel des vollständigen curl-Befehls:

bash
curl -X POST "https://adt-123456.adaptricity.com/api/grid/688109db1dadf237a782a8ef/calculatepowerflow/v2" \
  -H "X-Auth-Token: {your-api-token}" \
  -H "Content-Type: application/json" \
  -d '{
    "DPGProtocolVersion": "2.0",
    "operationalVoltages": [],
    "algorithm": {
      "type": "FULL_NEWTON",
      "tolerance": 0.000001,
      "maxIter": 1000
    }
  }'

Antwort ​

Die Antwort enthält die Lastflussergebnisse, darunter Knotenspannungen, Leitungsströme und Verluste, im JSON-Format.

json
{
  "convergenceInfo": {
    "algorithm": "Full Newton-Raphson",
    "hasConverged": true,
    "numIterations": 1,
    "disabledWarmStart": false
  },
  "powerFlowSummary": {
    "load": {
      "total": { "activePowerInMegawatt": 0.01, "reactivePowerInMegavar": 0.0 },
      "byVoltageLevel": {
        "20.0 kV": {
          "activePowerInMegawatt": 0.0,
          "reactivePowerInMegavar": 0.0
        },
        "0.4 kV": {
          "activePowerInMegawatt": 0.01,
          "reactivePowerInMegavar": 0.0
        }
      }
    },
    "generation": {
      "total": { "activePowerInMegawatt": 0.0, "reactivePowerInMegavar": 0.0 },
      "byVoltageLevel": {
        "20.0 kV": {
          "activePowerInMegawatt": 0.0,
          "reactivePowerInMegavar": 0.0
        },
        "0.4 kV": {
          "activePowerInMegawatt": 0.0,
          "reactivePowerInMegavar": 0.0
        }
      }
    },
    "flow": {
      "total": {
        "activePowerInMegawatt": 0.01998689567564519,
        "reactivePowerInMegavar": -5.192047912955003e-6
      },
      "byVoltageLevel": {
        "0.4 kV": {
          "activePowerInMegawatt": 0.009988478786482116,
          "reactivePowerInMegavar": 1.9374434934664843e-8
        },
        "20.0 / 0.4 kV": {
          "activePowerInMegawatt": 0.009998416889163076,
          "reactivePowerInMegavar": -5.211422347889668e-6
        }
      }
    },
    "losses": {
      "total": {
        "activePowerInMegawatt": 1.0498950978737875e-5,
        "reactivePowerInMegavar": 9.72651577058059e-6
      },
      "byVoltageLevel": {
        "0.4 kV": {
          "activePowerInMegawatt": 9.435569420235268e-6,
          "reactivePowerInMegavar": 2.6319084106551927e-6
        },
        "20.0 / 0.4 kV": {
          "activePowerInMegawatt": 1.0633815585026074e-6,
          "reactivePowerInMegavar": 7.094607359925398e-6
        }
      }
    }
  },
  "powerFlowResult": [
    {
      "elementType": "bus",
      "id": "bus_1",
      "powerFlowData": {
        "voltageInPerUnit": 1.0,
        "angleInRadians": 0.0,
        "activeBusLoadInMegawatt": 0.0,
        "reactiveBusLoadInMegavar": 0.0,
        "activeBusGenerationInMegawatt": 0.0,
        "reactiveBusGenerationInMegavar": 0.0,
        "voltageInKilovolt": 20.0,
        "activeResidualBusLoadInMegawatt": 0.0,
        "reactiveResidualBusLoadInMegavar": 0.0,
        "angleInDegrees": 0.0
      }
    },
    {
      "elementType": "bus",
      "id": "bus_2",
      "powerFlowData": {
        "voltageInPerUnit": 0.999893774408436,
        "angleInRadians": -7.095529905871144e-4,
        "activeBusLoadInMegawatt": 0.0,
        "reactiveBusLoadInMegavar": 0.0,
        "activeBusGenerationInMegawatt": 0.0,
        "reactiveBusGenerationInMegavar": 0.0,
        "voltageInKilovolt": 0.3999575097633744,
        "activeResidualBusLoadInMegawatt": 0.0,
        "reactiveResidualBusLoadInMegavar": 0.0,
        "angleInDegrees": -0.04065439170152748
      }
    },
    {
      "elementType": "bus",
      "id": "bus_3",
      "powerFlowData": {
        "voltageInPerUnit": 0.9989500624829588,
        "angleInRadians": -0.0011471351227720045,
        "activeBusLoadInMegawatt": 0.01,
        "reactiveBusLoadInMegavar": 0.0,
        "activeBusGenerationInMegawatt": 0.0,
        "reactiveBusGenerationInMegavar": 0.0,
        "voltageInKilovolt": 0.39958002499318357,
        "activeResidualBusLoadInMegawatt": 0.01,
        "reactiveResidualBusLoadInMegavar": 0.0,
        "angleInDegrees": -0.06572600106605739
      }
    },
    {
      "elementType": "powerline",
      "id": "powerline_1",
      "powerFlowData": {
        "activePowerInMegawatt": 0.009988478786482116,
        "reactivePowerInMegavar": 1.9374434934664843e-8,
        "activeLossInMegawatt": 9.435569420235268e-6,
        "reactiveLossInMegavar": 2.6319084106551927e-6,
        "apparentPowerInMegavoltampere": 0.009988478786500906,
        "activePowerInPerUnit": 9.988478786482116e-5,
        "reactivePowerInPerUnit": 1.9374434934664843e-10,
        "activeLossInPerUnit": 9.435569420235268e-8,
        "reactiveLossInPerUnit": 2.6319084106551927e-8,
        "apparentPowerInPerUnit": 9.988478786500907e-5,
        "loadingInPerUnit": 0.04008966745271987,
        "currentInAmpere": 14.432280282979153,
        "currentInPerUnit": 9.998977087677769e-5,
        "currentAngleInRadians": -0.0011490748010613216,
        "voltageDropInVolt": 0.37748477019086124,
        "loadingInPercent": 4.008966745271987,
        "activePowerFlowingToBus2": true,
        "reactivePowerFlowingToBus2": true
      }
    },
    {
      "elementType": "transformer",
      "id": "transformer_1",
      "powerFlowData": {
        "activePowerInMegawatt": 0.009998416889163076,
        "reactivePowerInMegavar": -5.211422347889668e-6,
        "activeLossInMegawatt": 1.0633815585026074e-6,
        "reactiveLossInMegavar": 7.094607359925398e-6,
        "apparentPowerInMegavoltampere": 0.009998418247324139,
        "activePowerInPerUnit": 9.998416889163075e-5,
        "reactivePowerInPerUnit": -5.211422347889668e-8,
        "activeLossInPerUnit": 1.0633815585026074e-8,
        "reactiveLossInPerUnit": 7.094607359925398e-8,
        "apparentPowerInPerUnit": 9.998418247324139e-5,
        "loadingInPerUnit": 0.01587050515448276,
        "currentInAmpere": 14.433006821095084,
        "currentInPerUnit": 9.99948044804994e-5,
        "currentAngleInRadians": -1.8832828710316994e-4,
        "voltageDropInVolt": 0.04249023662561413,
        "loadingInPercent": 1.587050515448276,
        "activePowerFlowingToBus2": true,
        "reactivePowerFlowingToBus2": false
      }
    }
  ]
}