Optimise an optical system: damped least squares, orthogonal descent or the Halton-keyed hammer on the merit function (OP3)
curl --request POST \
--url https://api.eddy.engineer/v1/optics.optimize \
--header 'Content-Type: application/json' \
--data '{}'import requests
url = "https://api.eddy.engineer/v1/optics.optimize"
payload = {}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({})
};
fetch('https://api.eddy.engineer/v1/optics.optimize', 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/optics.optimize",
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([
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$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/optics.optimize"
payload := strings.NewReader("{}")
req, _ := http.NewRequest("POST", url, payload)
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/optics.optimize")
.header("Content-Type", "application/json")
.body("{}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.eddy.engineer/v1/optics.optimize")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{}"
response = http.request(request)
puts response.read_bodyOptics
Optimise an optical system: damped least squares, orthogonal descent or the Halton-keyed hammer on the merit function (OP3)
The same body as `/v1/solve.optics` with, on the system, `variables` [{surface, column: curvature|thickness|conic|param<n>, min?, max?}], `merit` rows [{kind (one of the 448 merit operands; slices 1–4 implement 408: first order, rays, Seidel, boundaries, the wave families, the lens / glass / paraxial / real-ray / element-position data, the aberration families, the math and control rows), surface, surface2, wavelength, hx, hy, px, py, target, weight, params, rows}] and `optimization` {algorithm: dls | orthogonal_descent | hammer, cycles, damping, restarts, default_merit: {criterion: rms_spot | rms_wavefront, reference: centroid | chief, rings, arms, glass_min, glass_max, glass_edge, air_min, air_max, air_edge}}. Runs the shared lifecycle synchronously (content-addressed: identical inputs return the cached result) and answers {system: the optimised prescription, merit_initial, merit_final, merit_value (its square root), cycles, evaluations, gradient_norm, rows: the merit function editor (value, target, weight, contribution per row), variables: their final values, metrics, fields (optimize/merit_history, optimize/operands)}. Deterministic: fixed damping schedule (Marquardt ν = 10), forward-difference Jacobian, Halton restarts — no RNG. Typed refusals: OPTICS_INVALID; an operand outside the slices names OP3.b.
POST
/
v1
/
optics.optimize
Optimise an optical system: damped least squares, orthogonal descent or the Halton-keyed hammer on the merit function (OP3)
curl --request POST \
--url https://api.eddy.engineer/v1/optics.optimize \
--header 'Content-Type: application/json' \
--data '{}'import requests
url = "https://api.eddy.engineer/v1/optics.optimize"
payload = {}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({})
};
fetch('https://api.eddy.engineer/v1/optics.optimize', 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/optics.optimize",
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([
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$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/optics.optimize"
payload := strings.NewReader("{}")
req, _ := http.NewRequest("POST", url, payload)
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/optics.optimize")
.header("Content-Type", "application/json")
.body("{}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.eddy.engineer/v1/optics.optimize")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{}"
response = http.request(request)
puts response.read_bodyBody
application/json
The body is of type object.
Response
optimised