Catalog/eng-ideal-gas-work

Engineering

Ideal-gas process work API

Computes boundary work W = ∫P dV for an ideal-gas isothermal (nRT·ln(V2/V1)), isobaric (P·ΔV), isochoric (0), or adiabatic ((P1V1−P2V2)/(γ−1)) process, returning work, heat, ΔU, and final state. Answers 'What is the work done in an isothermal/adiabatic expansion?', 'What is the final pressure after adiabatic compression?'.

Price$0.06per request
MethodPOST
Route/v1/engineering/ideal-gas-work
StatusLive
MIME typeapplication/json
Rate limit120/minute
Cache0s public
engineeringthermofluidsthermodynamicsideal-gasworkisothermaladiabaticisobaricpv-work
API URLhttps://x402.hexl.dev/v1/engineering/ideal-gas-work
Integration docs
Example request
{
  "process": "adiabatic",
  "pressure1Pa": 200000,
  "volume1M3": 0.01,
  "volume2M3": 0.03,
  "gamma": 1.4
}
Example response
{
  "process": "adiabatic",
  "gasConstant": 8.314462618,
  "gamma": 1.4,
  "pressure1Pa": 200000,
  "volume1M3": 0.01,
  "volume2M3": 0.03,
  "pressure2Pa": 42959.600998,
  "workJ": 1778.029925,
  "heatJ": 0,
  "deltaInternalEnergyJ": -1778.029925,
  "formula": "P1*V1^γ = P2*V2^γ; W = (P1V1 - P2V2)/(γ-1); Q = 0"
}
Input schema
{
  "type": "object",
  "required": [
    "process"
  ],
  "properties": {
    "process": {
      "type": "string",
      "enum": [
        "isothermal",
        "isobaric",
        "isochoric",
        "adiabatic"
      ],
      "examples": [
        "adiabatic"
      ]
    },
    "moles": {
      "type": "number",
      "description": "moles of gas n (isothermal)"
    },
    "temperatureK": {
      "type": "number",
      "description": "temperature T (K) (isothermal)"
    },
    "pressure1Pa": {
      "type": "number",
      "description": "initial pressure (Pa)"
    },
    "volume1M3": {
      "type": "number",
      "description": "initial volume (m^3)"
    },
    "volume2M3": {
      "type": "number",
      "description": "final volume (m^3)"
    },
    "gamma": {
      "type": "number",
      "description": "specific-heat ratio γ (adiabatic); default 1.4"
    }
  }
}
Output schema
{
  "type": "object",
  "additionalProperties": true
}