curl --request POST \
--url https://api.eddy.engineer/v1/power.opf.ac \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"async": true,
"case": "<string>",
"network": {},
"network_key": "<string>",
"project": "<string>",
"settings": {},
"variant": "<string>"
}
'import requests
url = "https://api.eddy.engineer/v1/power.opf.ac"
payload = {
"async": True,
"case": "<string>",
"network": {},
"network_key": "<string>",
"project": "<string>",
"settings": {},
"variant": "<string>"
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
async: true,
case: '<string>',
network: {},
network_key: '<string>',
project: '<string>',
settings: {},
variant: '<string>'
})
};
fetch('https://api.eddy.engineer/v1/power.opf.ac', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.eddy.engineer/v1/power.opf.ac",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'async' => true,
'case' => '<string>',
'network' => [
],
'network_key' => '<string>',
'project' => '<string>',
'settings' => [
],
'variant' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.eddy.engineer/v1/power.opf.ac"
payload := strings.NewReader("{\n \"async\": true,\n \"case\": \"<string>\",\n \"network\": {},\n \"network_key\": \"<string>\",\n \"project\": \"<string>\",\n \"settings\": {},\n \"variant\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.eddy.engineer/v1/power.opf.ac")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"async\": true,\n \"case\": \"<string>\",\n \"network\": {},\n \"network_key\": \"<string>\",\n \"project\": \"<string>\",\n \"settings\": {},\n \"variant\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.eddy.engineer/v1/power.opf.ac")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"async\": true,\n \"case\": \"<string>\",\n \"network\": {},\n \"network_key\": \"<string>\",\n \"project\": \"<string>\",\n \"settings\": {},\n \"variant\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{}{
"events": "/v1/jobs/job-000001-…/events",
"job_id": "<string>",
"phase": "queued",
"poll": "/v1/jobs/job-000001-…"
}{
"error": {
"code": "INVALID_GEOMETRY",
"message": "<string>"
}
}{
"error": {
"code": "INVALID_GEOMETRY",
"message": "<string>"
}
}{
"error": {
"code": "INVALID_GEOMETRY",
"message": "<string>"
}
}{
"error": {
"code": "INVALID_GEOMETRY",
"message": "<string>"
}
}AC optimal power flow (MATPOWER's MIPS ported) with its SOC relaxation bound and gap (`ss.power.opf_ac/1`)
TP11: MATPOWER’s polar AC OPF (balances, generator P and Q limits, voltage limits, apparent power at both ends of every rated branch for the duty, angle limits) solved by our port of MIPS (BSD-3, cited) on ss-sparse’s LU; HVDC links as MATPOWER’s dcline terminal pairs (TP11.b). A run that does not reach an optimum is a status with the worst constraint, never a dispatch; one retry from the ratios start with step-size control is recorded. Jabr’s SOC relaxation through ss-optim gives a lower bound and the gap. The optimum’s dispatch is written back (dispatched_network_key), and its result key warm-starts power_contingency, power_nk and power_transfer (start_key). Settings (TP11’s Settings): duty (normal), angle_limits (true), start (interior | flat | load_flow | ratios), mips (MIPS’s options, cost_mult 1e-4), binding_tol (1e-4), retry (true), bound (true), bound_options. 36 s at 13,659 buses in a release build. Refused: POWER_REQUEST (400: the body, a member the study does not take, a document given twice or not at all), POWER_SETTINGS (400: a setting that does not read, with the field), POWER_DOCUMENT_INVALID (400: the network), POWER_NETWORK_NOT_FOUND / POWER_PLANNING_NOT_FOUND (404: a key that names no such document), POWER_PROJECT_KIND (422), POWER_BUSY (429: the heavy lane is full; retry after Retry-After, or send async: true), POWER_OPF_INVALID (422), POWER_OPF_UNSUPPORTED (422: an element the OPF does not take, named), POWER_OPF_SOLVER (422). A screening study, reviewed by a person; never a TNSP or AEMO submission.
curl --request POST \
--url https://api.eddy.engineer/v1/power.opf.ac \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"async": true,
"case": "<string>",
"network": {},
"network_key": "<string>",
"project": "<string>",
"settings": {},
"variant": "<string>"
}
'import requests
url = "https://api.eddy.engineer/v1/power.opf.ac"
payload = {
"async": True,
"case": "<string>",
"network": {},
"network_key": "<string>",
"project": "<string>",
"settings": {},
"variant": "<string>"
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
async: true,
case: '<string>',
network: {},
network_key: '<string>',
project: '<string>',
settings: {},
variant: '<string>'
})
};
fetch('https://api.eddy.engineer/v1/power.opf.ac', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.eddy.engineer/v1/power.opf.ac",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'async' => true,
'case' => '<string>',
'network' => [
],
'network_key' => '<string>',
'project' => '<string>',
'settings' => [
],
'variant' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.eddy.engineer/v1/power.opf.ac"
payload := strings.NewReader("{\n \"async\": true,\n \"case\": \"<string>\",\n \"network\": {},\n \"network_key\": \"<string>\",\n \"project\": \"<string>\",\n \"settings\": {},\n \"variant\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.eddy.engineer/v1/power.opf.ac")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"async\": true,\n \"case\": \"<string>\",\n \"network\": {},\n \"network_key\": \"<string>\",\n \"project\": \"<string>\",\n \"settings\": {},\n \"variant\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.eddy.engineer/v1/power.opf.ac")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"async\": true,\n \"case\": \"<string>\",\n \"network\": {},\n \"network_key\": \"<string>\",\n \"project\": \"<string>\",\n \"settings\": {},\n \"variant\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{}{
"events": "/v1/jobs/job-000001-…/events",
"job_id": "<string>",
"phase": "queued",
"poll": "/v1/jobs/job-000001-…"
}{
"error": {
"code": "INVALID_GEOMETRY",
"message": "<string>"
}
}{
"error": {
"code": "INVALID_GEOMETRY",
"message": "<string>"
}
}{
"error": {
"code": "INVALID_GEOMETRY",
"message": "<string>"
}
}{
"error": {
"code": "INVALID_GEOMETRY",
"message": "<string>"
}
}Body
true: run as a job and answer 202 with job_id, poll and events; the finished job's result is this route's body without the inline result (read result_key's blob, or page it with power_contingency_page). false: always inline. Left out: inline up to an estimated work of 5e6 bus-solves (SS_POWER_PLANNING_SYNC_WORK; N-1 of a 2,000-bus case is about 7e6, an AC OPF of 13,659 buses 9e6), a job above. Above 2e5 (SS_POWER_PLANNING_LIGHT_WORK) a study takes a slot of PW12's heavy lane
Response
study, schema, result_key (BLAKE3 of the result's canonical bytes, the crate's own content_hash; blob_uri reads it, report_uri is its certificate, which verify_result runs again), request_key, documents (each document the study read, by content key), network {key, name, counts}, case, summary, elapsed_ms, work (the estimate the lane and the job threshold read), result_inline, and result (the whole result document, up to 16 MiB), dispatched_network_key. result: outcome {status: optimal | iteration_limit | numerically_failed}, objective, attempts, history, worst, check, buses (voltages, LMPs), sources, branches, binding, totals, hvdc, bound {status, objective, gap}, findings
The response is of type object.