Math & Numbers
Solve the Bernoulli equation p/(ρg) + v²/(2g) + z = const for steady, ideal, incompressible flow between two points on a streamline. Supply all three upstream quantities (p₁, v₁, z₁) and any two of the three downstream quantities; the tool solves for the third. Solve velocity: v₂ = √[v₁² + 2(p₁-p₂)/ρ + 2g(z₁-z₂)] — a negative radicand is physically impossible and is rejected. Solve pressure: p₂ = p₁ + ½ρ(v₁²-v₂²) + ρg(z₁-z₂). Solve elevation: z₂ = z₁ + (p₁-p₂)/(ρg) + (v₁²-v₂²)/(2g). g = 9.81 m/s². Density in kg/m³/g/cm³, pressure in Pa/kPa/bar/atm/psi, velocity in m/s, elevation in m/cm/ft. The upstream pressure/velocity/elevation heads and the total head are also reported.
Call this tool from your code in three languages.
curl -X POST 'https://api.elysiatools.com/en/api/tools/bernoulli-equation-solver' \
-H 'Content-Type: application/json' \
-d '{"unknownVar":"velocity","density":1000,"densityUnit":"kg/m3","p1":200000,"v1":2,"z1":0,"pressureUnit":"Pa","velocityUnit":"m/s","lengthUnit":"m","p2":100000,"v2":0,"z2":0,"decimalPlaces":4}'Send a POST request with your inputs as JSON. File parameters require a separate upload first.
POST https://api.elysiatools.com/en/api/tools/bernoulli-equation-solver| Name | Type | Required | Description |
|---|---|---|---|
| unknownVar | select | No | Which downstream quantity to solve for: velocity v₂, pressure p₂, or elevation z₂. Provide the other two downstream quantities. |
| density | number | Yes | Fluid density ρ. Enter in the selected Density Unit. |
| densityUnit | select | No | — |
| p1 | number | Yes | Upstream (point 1) pressure p₁. Enter in the selected Pressure Unit. |
| v1 | number | Yes |
Add this tool to your Model Context Protocol server so AI agents can list and call it.
Add this block to your MCP client configuration:
{
"mcpServers": {
"elysiatools-bernoulli-equation-solver": {
"name": "bernoulli-equation-solver",
"description": "Solve the Bernoulli equation p/(ρg) + v²/(2g) + z = const for steady, ideal, incompressible flow between two points on a streamline. Supply all three upstream quantities (p₁, v₁, z₁) and any two of the three downstream quantities; the tool solves for the third. Solve velocity: v₂ = √[v₁² + 2(p₁-p₂)/ρ + 2g(z₁-z₂)] — a negative radicand is physically impossible and is rejected. Solve pressure: p₂ = p₁ + ½ρ(v₁²-v₂²) + ρg(z₁-z₂). Solve elevation: z₂ = z₁ + (p₁-p₂)/(ρg) + (v₁²-v₂²)/(2g). g = 9.81 m/s². Density in kg/m³/g/cm³, pressure in Pa/kPa/bar/atm/psi, velocity in m/s, elevation in m/cm/ft. The upstream pressure/velocity/elevation heads and the total head are also reported.",
"baseUrl": "https://api.elysiatools.com/mcp/sse?toolId=bernoulli-equation-solver",
"command": "",
"args": [],
"env": {},
"isActive": true,
"type": "sse"
}
}
}After connecting to the SSE endpoint, list the exposed tools:
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/list"
}Invoke the tool by its id, passing arguments built from its parameters:
{
"jsonrpc": "2.0",
"id": 2,
"method": "tools/call",
"params": {
"name": "bernoulli-equation-solver",
"arguments": {
"unknownVar": "velocity",
"density": 1000,
"densityUnit": "kg/m3",
"p1": 200000,
"v1": 2,
"z1": 0,
"pressureUnit": "Pa",
"velocityUnit": "m/s",
"lengthUnit": "m",
"p2": 100000,
"v2": 0,
"z2": 0,
"decimalPlaces": 4
}
}
}| Upstream (point 1) velocity v₁ in m/s. |
| z1 | number | Yes | Upstream (point 1) elevation z₁. Enter in the selected Length Unit. |
| pressureUnit | select | No | — |
| velocityUnit | select | No | — |
| lengthUnit | select | No | — |
| p2 | number | No | Downstream (point 2) pressure p₂. Enter in the selected Pressure Unit. Required unless solving for p₂. |
| v2 | number | No | Downstream (point 2) velocity v₂ in m/s. Required unless solving for v₂. |
| z2 | number | No | Downstream (point 2) elevation z₂. Enter in the selected Length Unit. Required unless solving for z₂. |
| decimalPlaces | number | No | — |
JSON result
{
"key": {...},
"metadata": {
"key": "value"
},
"error": "Error message (optional)",
"message": "Notification message (optional)"
}Questions or issues? Contact [email protected]