Examples & recipes
The 14 analyses at a glance
Every analysis type the platform exposes, with its honest validation tier. See the public feature matrix for the full breakdown. Labels are display-honest summaries, not certifications.
| Analysis type | Dim · Compute | Validation tier | What it does |
|---|
The field_to_field_neural_operator is an experimental
in-distribution surrogate — not a drop-in replacement for the physics
solver. Reported accuracy (in-distribution held-out rel-L2 ≈ 0.68 %,
out-of-distribution ≈ 5.8 %) is not a general accuracy guarantee.
Platform capabilities
cufemlab is a GPU-accelerated electromagnetic-engineering platform. The rows separate the compute path and validation scope of each capability.
| 2-D electromagnetic (magnetostatic) analysis | Supported · GPU · externally cross-checked (FEMM / GetDP) |
| 3-D electromagnetic field computation | Supported · field lane (cufem3d) |
| GPU-accelerated execution | Supported (2-D magnetostatics, thermal, coupled) |
| 3-D field validation utility | Available · CPU (numpy/scipy) · analytic-case check |
| Thermal (steady & transient) & coupled | Supported · GPU · internally validated |
| Neural-operator surrogate (FNO) | Available · experimental (in-distribution) |
| Independently validated 3-D torque prediction | Not claimed |
3-D field analysis (cufem3d)
Exercises and checks the 3-D field-computation path (geometry → volumetric
edge-element mesh → magnetostatic field) against a controlled analytic case
(uniformly magnetized sphere, B_in = 2/3·Br).
Parameters: mesh_n (int, 12–32, default 24), box_L (float, 2.0–4.0, default 3.0).
Outputs include relative_error_pct, uniformity_pct, mean_Bz_T,
mesh_elements, device, converged.
import os
from cufemlab_client import Client
client = Client(api_key=os.environ["CUFEMLAB_API_KEY"])
project = client.create_project("3-D field validation")
job = client.analyze(
project_id=project.id,
analysis_type="cufem3d_field_validation",
input_params={"mesh_n": 24, "box_L": 3.0}, # parametric — no geometry upload
max_minutes=5,
)
job.wait(poll_interval=10)
result = job.result()
print(result.verdict, result.value) # relative_error_pct, mean_Bz_T, device, ...
Illustrative request based on the current repository contract; runtime execution was not independently reproduced during this website update.
A1 — Eddy-current skin depth (runs with no setup)
# Proprietary and confidential. Copyright Secrotec B.V.. All rights reserved.
import math, json
def skin_depth(freq_hz=50.0, sigma_s_per_m=2.0e6, mu_r=1000.0):
"""delta = 1 / sqrt(pi * f * mu * sigma). Jackson, Classical Electrodynamics, Ch. 8."""
mu0 = 4.0 * math.pi * 1e-7
delta = 1.0 / math.sqrt(math.pi * freq_hz * mu_r * mu0 * sigma_s_per_m)
return {"ok": True, "phase": "A/J", "example": "eddy-current skin depth",
"method": "closed-form EM skin depth",
"reference": "Jackson, Classical Electrodynamics, Ch. 8",
"verdict": "ANALYTICAL_CPU_OK",
"metrics": {"freq_hz": freq_hz, "skin_depth_mm": round(delta * 1e3, 4)},
"notes": ["pure stdlib math; no API key, no file, no GPU"]}
print(json.dumps(skin_depth(), indent=2))
A2 — Rotating-disk burst safety factor (runs with no setup)
# Proprietary and confidential. Copyright Secrotec B.V.. All rights reserved.
import math, json
def rotating_disk_safety(rpm=10000.0, R=0.10, rho=7700.0, nu=0.29, sigma_yield=250e6):
"""Solid spinning-disk peak hoop stress + burst-speed safety factor.
Timoshenko and Goodier, Theory of Elasticity, Sec. 73."""
omega = 2.0 * math.pi * rpm / 60.0
sigma_hoop_max = (3.0 + nu) / 8.0 * rho * omega**2 * R**2
return {"ok": True, "phase": "C", "example": "rotating-disk burst safety factor",
"method": "closed-form solid-disk elasticity",
"reference": "Timoshenko and Goodier, Theory of Elasticity, Sec. 73",
"verdict": "ANALYTICAL_CPU_OK",
"metrics": {"rpm": rpm, "sigma_hoop_max_MPa": round(sigma_hoop_max / 1e6, 3),
"safety_factor": round(sigma_yield / sigma_hoop_max, 2)},
"notes": ["pure stdlib math; runs instantly"]}
print(json.dumps(rotating_disk_safety(), indent=2))
A3 — 1-D steady conduction slab (runs with no setup)
# Proprietary and confidential. Copyright Secrotec B.V.. All rights reserved.
import json
def slab_conduction(k=45.0, area_m2=0.01, thickness_m=0.02, T_hot=120.0, T_cold=40.0):
"""1-D steady Fourier conduction: q = k A (T_hot - T_cold) / L. Incropera, Ch. 3."""
q = k * area_m2 * (T_hot - T_cold) / thickness_m
R = thickness_m / (k * area_m2)
return {"ok": True, "phase": "B", "example": "1-D steady slab conduction",
"method": "Fourier law closed form",
"reference": "Incropera, Fundamentals of Heat and Mass Transfer, Ch. 3",
"verdict": "ANALYTICAL_CPU_OK",
"metrics": {"heat_flow_W": round(q, 3), "thermal_resistance_K_per_W": round(R, 4)},
"notes": ["pure stdlib; no deps"]}
print(json.dumps(slab_conduction(), indent=2))
Client-SDK examples (need an API key)
These submit real GPU jobs to the
platform. Create a key under API keys and set
CUFEMLAB_API_KEY first — otherwise they raise
AuthenticationError.
01 — Demo motor quick check
import os
from cufemlab_client import Client
client = Client(api_key=os.environ["CUFEMLAB_API_KEY"])
project = client.create_project("Quick motor check")
job = client.analyze(
project_id=project.id,
analysis_type="demo_motor_quick_check",
input_params={"notes": "quick smoke check"},
max_minutes=5,
)
job.wait(poll_interval=10)
result = job.result()
print(result.verdict, result.value)
02 — Cogging sweep (2-D)
import os
from cufemlab_client import Client
client = Client(api_key=os.environ["CUFEMLAB_API_KEY"])
project = client.create_project("Cogging sweep")
# cogging_sweep_2d is PARAMETRIC — no geometry upload. The parameters below
# match the in-app "New analysis" form for this type.
job = client.analyze(
project_id=project.id,
analysis_type="cogging_sweep_2d",
input_params={"n_angles": 32, "Br_T": 1.20},
max_minutes=20, gpu=True,
)
job.wait(poll_interval=10)
result = job.result()
print(result.verdict, result.summary) # .summary is a dict property, not a method
03 — Iron-loss estimate
import os
from cufemlab_client import Client
client = Client(api_key=os.environ["CUFEMLAB_API_KEY"])
project = client.create_project("Iron loss study")
job = client.analyze(
project_id=project.id,
analysis_type="iron_loss_estimate",
input_params={"rpm": 3000, "B_peak_T": 1.4, "material": "M250-35A"},
max_minutes=15,
)
job.wait(poll_interval=10)
res = job.result()
print(f"total iron loss={res.value} W metrics={res.metrics}")
04 — Signed PDF report
import os
from cufemlab_client import Client
client = Client(api_key=os.environ["CUFEMLAB_API_KEY"])
source_job_id = "..." # a completed job whose result you want to certify
src = client.get_job(source_job_id)
job = client.analyze(
project_id=src.project_id,
analysis_type="signed_report_generation",
input_params={"source_job_id": source_job_id},
max_minutes=5,
)
job.wait(poll_interval=5)
path = job.download_report("report.pdf") # streams the signed PDF, returns the path
print("Saved:", path)
/api/v1/* surface; no proprietary
internals are exposed.