tpt-energy

Rust

Fully open-source, pure-Rust computational engine for energy systems, power grids, and renewable integration. MIT OR Apache-2.0.

0 stars0 forks0 watchers

Languages

Rust95.6%Python2.3%MATLAB2.1%
README

tpt-energy

Power systems, resource modeling, storage, dispatch, and grid economics — pure Rust.

Org: TPT Solutions · License: MIT OR Apache-2.0 · Repo: tpt-energy

TPT Energy is a comprehensive, open-source toolkit for power-systems engineering and energy-systems modeling, written in Rust and built on the TPT substrate crates (tpt-math, tpt-engineering, tpt-science). It is designed for research, planning, dispatch, real-time grid control, and in-browser exploration via WebAssembly.

Energy Cycle

TPT Energy follows the Energy Cycle: resources → grid → storage → microgrid → dispatch → economics, all of which integrate back into the TPT substrate (materials degradation → device physics → grid dispatch).

flowchart LR
    A[Resource<br>solar · wind · hydro · load] --> B[Grid<br>power flow · fault · state est · protection]
    B --> C[Storage<br>battery · hydrogen · thermal]
    C --> D[Microgrid<br>DER · islanding · VPP]
    D --> E[Dispatch<br>unit commitment · economic · reserves]
    E --> F[Economics<br>LCOE · market · carbon]
    F --> A

Crate Status

CrateDescriptionStatus
tpt-nrg-coreEnergy system data modelStable
tpt-nrg-topologyGraph & Y-bus constructionStable
tpt-nrg-timeseriesLoad/generation/price profilesStable
tpt-nrg-wasmBrowser/edge WASM bindingsAlpha
tpt-nrg-solarSolar position & PV outputStable
tpt-nrg-windWind power & wake lossesStable
tpt-nrg-hydroHydro power calculationStable
tpt-nrg-loadLoad forecasting & demand responseStable
tpt-nrg-powerflowAC/DC power flow solversStable
tpt-nrg-faultShort-circuit (fault) analysisStable
tpt-nrg-state-estimationDC-approx WLS grid state estimatorAlpha
tpt-nrg-protectionRelay coordination & protection zonesStable
tpt-nrg-batteryBattery storage & degradationStable
tpt-nrg-hydrogenElectrolyzer / fuel-cell / H2 storageStable
tpt-nrg-thermal-storageThermal storageStable
tpt-nrg-derDistributed energy resourcesStable
tpt-nrg-islandingLoss-of-mains detection & resyncStable
tpt-nrg-vppVirtual power plant aggregationStable
tpt-nrg-unit-commitmentPriority-list UC (MILP behind substrate)Alpha
tpt-nrg-economic-dispatchEconomic dispatch & storage arbitrageStable
tpt-nrg-reserveSpinning & contingency reserveStable
tpt-nrg-lcoeLCOE / NPV / IRRStable
tpt-nrg-marketMarket signal modelingStable
tpt-nrg-carbonCarbon intensityStable

See docs/book/src/crate-status.md for detailed maturity notes per crate.

Quick Start

# Cargo.toml
[dependencies]
tpt-nrg-core = "0.1"
tpt-nrg-powerflow = "0.1"
use tpt_nrg_core::EnergySystem;
use tpt_nrg_powerflow::{PowerFlowSolver, PowerFlowMethod};

let system = EnergySystem::from_json(include_str!("ieee14.json"))?;
let solver = PowerFlowSolver::new(PowerFlowMethod::NewtonRaphson);
let result = solver.solve(&system)?;
println!("{:?}", result);

Examples

  • examples/ieee-14-bus-powerflow — solve the IEEE 14-bus case
  • examples/solar-farm-layout — solar position + PV output profile
  • examples/wind-farm-wake — Jensen wake model
  • examples/microgrid-islanding — islanding event + battery dispatch
  • examples/battery-arbitrage — storage arbitrage from price forecast

License

Licensed under either of Apache-2.0 or MIT at your option.

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.