# Shaft Calculator (Fatigue, Goodman, Diameter Sizing) (`jumblemog/shaft-calculator`) Actor

Shaft fatigue calculator from plain text: endurance limit with Marin factors, notch and stress concentration, von Mises stresses, safety by DE-Goodman, Gerber, ASME elliptic and Soderberg, yield, life, and diameter sizing.

- **URL**: https://apify.com/jumblemog/shaft-calculator.md
- **Developed by:** [Jumble Mog](https://apify.com/jumblemog) (community)
- **Categories:** AI, Automation, Developer tools
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per event

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Shaft Calculator (Fatigue, Goodman, Diameter Sizing)

**Will the shaft last? Describe the section in one line and find out.** Type `30 mm shaft, 1050 CD, machined, bending moment 140 N·m, steady torque 120 N·m, rounded shoulder, 99% reliability` or `find the diameter: 1045 CD, M 200 N·m, T 150 N·m, keyseat, safety 2`. You get back:

- **The endurance limit** with every Marin factor shown: surface (ka), size (kb), load (kc), temperature (kd) and reliability (ke).
- **The stress concentration**: Kt and Kts for the notch (from Shigley's first-iteration table for shoulders, keyseats and ring grooves, or your own), the notch sensitivity q from the Neuber constant, and the fatigue factors Kf and Kfs.
- **The stresses**: bending, torsion and axial, alternating and mean, combined into von Mises σa′ and σm′, and the peak stress.
- **Safety factors by all four classic criteria**: DE-Goodman, DE-Gerber, DE-ASME elliptic and DE-Soderberg, plus first-cycle yield.
- **The life** in cycles when the shaft isn't infinite-life.
- **For design requests**: the smallest standard diameter that meets your safety target, and the exact DE-Goodman diameter.
- **A chart**: the fatigue diagram with the four failure lines, the yield line, the load line and the operating point, next to the safety factors.

Loads are written the way they act:

- A **bending moment on a rotating shaft** reverses every turn, so it's all alternating.
- A **torque** is steady unless you say alternating or give a range (`T 50 to 150 N·m`).
- **Stationary** shafts and axles keep steady bending as a mean stress.
- **Axial forces** add to the bending stress.

Materials: the AISI carbon steels from 1006 to 1095, hot-rolled or cold-drawn, with Shigley's minimum strengths; any steel by Sut and Sy; or a Brinell hardness (Sut ≈ 3.4·HB). Metric (mm, N·m, MPa) or inch (in, lbf·in, kpsi): results come back in the units you wrote.

It's made for:

- Mechanical designers checking gearbox, pump, motor and conveyor shafts.
- Engineering students working Shigley-style shaft problems.
- Maintenance engineers judging a shaft that keeps breaking.
- AI agents that need real fatigue numbers instead of a guess.

![A 30 mm AISI 1050 cold-drawn shaft at a rounded shoulder analyzed by this Actor: the fatigue diagram with the Goodman, Gerber, ASME elliptic, Soderberg and yield lines, the operating point at 56 MPa mean and 84 MPa alternating, and safety factors from 1.88 to 2.24](https://api.apify.com/v2/key-value-stores/Km5b4PG3kYHdZSb1E/records/shaft-calculator-example.png?signature=1OT71doP0xegw7NTwkuXj)

### How to use it

1. Write **Shafts**, one section per entry. The form has examples.
2. Optionally set a **Default material**, **surface**, **reliability**, the **Main criterion** or the **Units**.
3. Click **Start**. Each section is a row in the results, with its summary, chart and report.

#### Writing a section

| You write | It means |
|---|---|
| `30 mm shaft`, `d = 1.25 in`, `axle 40 mm` | the diameter at the section |
| `1045 CD`, `AISI 1020 HR`, `Sut 105 kpsi, Sy 82 kpsi`, `300 HB` | the material |
| `ground`, `machined`, `cold-drawn`, `hot-rolled`, `forged` | the surface (machined if not given) |
| `rounded shoulder`, `sharp shoulder`, `keyseat`, `sled-runner keyseat`, `retaining ring groove` | the notch (Shigley Table 7-1) |
| `Kt 1.68, Kts 1.42, fillet radius 0.11 in` | your own stress concentration and notch radius |
| `M 140 N·m`, `bending moment 1260 lbf·in` | bending moment |
| `T 120 N·m`, `steady torque ...`, `alternating torque ...`, `T 50 to 150 N·m` | torque |
| `axial 5 kN` | axial force |
| `99% reliability`, `at 200 C`, `stationary` | reliability, temperature, a non-rotating shaft |
| `find the diameter ...`, `safety 2`, `gerber` | size it, the target, the main criterion |

Objects work too; see Input.

### Examples

All of these ran on this Actor; the numbers are from the results.

| Section | Result |
|---|---|
| `30 mm shaft, 1050 CD, machined, bending moment 140 N·m, steady torque 120 N·m, rounded shoulder, 99% reliability` | Se 193 MPa (ka 0.798, kb 0.862, ke 0.814); Kf 1.59, Kfs 1.44; σa′ 84.1, σm′ 56.4 MPa; safety 1.93 Goodman, 2.22 Gerber, 2.24 ASME, 1.88 Soderberg; yield 5.73 |
| `1.1 in shaft, Sut 105 kpsi, Sy 82 kpsi, machined, Kt 1.68, Kts 1.42, fillet radius 0.11 in, M = 1260 lbf·in, T = 1100 lbf·in` (Shigley Example 7-1) | q 0.85, Kf 1.58, ka 0.787, kb 0.868, Se 35.9 kpsi, as in the book; safety 1.93 Goodman, 2.25 Gerber; yield 4.50 |
| `find the diameter: 1045 CD, M 200 N·m, T 150 N·m, keyseat, safety 2` | 38 mm (exact DE-Goodman diameter 35.4 mm); safety 2.45 at 38 mm |
| Gearbox output shaft, 25 mm, 300 HB, Sy 800 MPa, ground, retaining ring groove, M 80 N·m, T 50 to 150 N·m | Safety only 1.16 Goodman: the ring groove's Kt of 5 dominates, and a warning says so |
| `20 mm shaft, 1020 HR, hot-rolled, M 250 N·m` | Safety 0.44 and yield 0.66: it yields at once and would last about 1,700 cycles |

The tests check that:

- The Marin factors, notch sensitivity and endurance limit of Shigley's Example 7-1 come out.
- Goodman, Soderberg and ASME elliptic match their formulas, and the Gerber result lies on the Gerber parabola.
- The material table, hardness rule, rotating and stationary loads, ranges and qualifiers are read correctly.
- The design diameter is the smallest standard size that works, and the exact diameter gives a safety of exactly the target.

### How-to examples

Each example is a complete input; the results are from runs of the Actor (also listed under **Examples**).

#### How to check shaft fatigue at a shoulder (Goodman, Gerber, ASME)

```json
{"shafts": ["30 mm shaft, 1050 CD, machined, bending moment 140 N·m, steady torque 120 N·m, rounded shoulder, 99% reliability"]}
```

Result: Se 193 MPa (ka 0.798, kb 0.862, ke 0.814); Kf 1.59 and Kfs 1.44; safety 1.93 Goodman, 2.22 Gerber, 2.24 ASME elliptic and 1.88 Soderberg; yield safety 5.73.

#### How to find the shaft diameter you need

```json
{"shafts": ["find the diameter: 1045 CD, M 200 N·m, T 150 N·m, keyseat, safety 2"]}
```

Result: 38 mm, where the exact DE-Goodman diameter is 35.4 mm; safety 2.45 at 38 mm.

#### How to reproduce Shigley's Example 7-1

```json
{"shafts": ["1.1 in shaft, Sut 105 kpsi, Sy 82 kpsi, machined, Kt 1.68, Kts 1.42, fillet radius 0.11 in, M = 1260 lbf·in, T = 1100 lbf·in"]}
```

Result: q 0.85, Kf 1.58, ka 0.787, kb 0.868 and Se 35.9 kpsi, as in the book; safety 1.93 Goodman and 2.25 Gerber; yield 4.50.

#### How to let an AI agent check shafts

Add this Actor to the [Apify MCP server](https://mcp.apify.com) with `https://mcp.apify.com/?tools=jumblemog/shaft-calculator`. The agent describes the section in one line and answers with the endurance limit, the notch factors and the safety factor by each criterion.

### FAQ

**Which notches does it know?** Shoulders (sharp or rounded), keyseats, retaining ring grooves and others, with Shigley's Table 7-1 first estimates, or your own Kt, Kts and fillet radius.

**Does it estimate life?** Yes. When the safety is under 1, it gives the cycles to failure from Basquin's line.

**Does it check deflection or critical speed?** No: one section's stresses only. Check deflection, critical speed, keys and hubs separately.

**Does it work for aluminum?** No. The endurance rules are for steel; aluminum and other metals have no endurance limit.

### Input

| Field | What it is |
|---|---|
| `shafts` | Shaft sections, as text or objects. |
| `material` | Default material (AISI 1045 CD if unset). |
| `surface` | Default surface (machined). |
| `reliability` | Default reliability in % (50). |
| `criterion` | Main criterion: `goodman` (default), `gerber`, `asme` or `soderberg`. |
| `units` | `mm` (default) or `in`, for numbers written without a unit. |
| `charts` | Draw charts (default on). |

**A section as an object** takes:

- `diameter`, `mode` (`analyze` or `design`), `safety` (design target, default 1.5), `criterion`.
- `material`, or `sut` and `sy`, or `hardness` (HB).
- `surface`, `reliability`, `temperature`, `miscFactor`.
- `notch`, or `kt`, `kts`, `ktAxial`, and `notchRadius`.
- `moment`, `momentAlternating`, `momentMean`, `torque`, `torqueAlternating`, `torqueMean`, `axial` (each a value or a range like `"50 to 150 N·m"`), `rotating` (default true).
- `units`, `title`, and `text` (a line of text, with the other fields overriding what it says).

### Output

One dataset item per section, also saved together in the run's `OUTPUT` record:

```json
{
  "request": 1, "status": "ok", "type": "shaft", "mode": "analyze", "title": "30 mm shaft, AISI 1050 CD",
  "units": {"length": "mm", "moment": "N·m", "force": "kN", "stress": "MPa"},
  "material": {"name": "AISI 1050 CD", "sut": 690, "sy": 580},
  "section": {"diameter": 30.0, "notch": "rounded shoulder", "kt": 1.7, "kts": 1.5, "notchRadius": 3.0,
              "q": 0.847, "qs": 0.879, "kf": 1.593, "kfs": 1.44},
  "loads": {"momentAlternating": 140.0, "torqueMean": 120.0},
  "endurance": {"sePrime": 345.0, "ka": 0.798, "kb": 0.862, "kc": 1.0, "kd": 1.0, "ke": 0.814, "se": 193.06},
  "stresses": {"bendingAlternating": 84.12, "shearMean": 32.59, "vonMisesAlternating": 84.12,
               "vonMisesMean": 56.44, "vonMisesMax": 101.3},
  "safety": {"goodman": 1.932, "soderberg": 1.876, "gerber": 2.219, "asme": 2.24},
  "fatigueSafety": 1.932, "yieldSafety": 5.73, "infiniteLife": true,
  "imageUrl": "https://api.apify.com/v2/key-value-stores/.../records/001-....png"
}
```

A design adds `design` with the target, the standard and the exact diameter. Every item has `warnings`, `notes` (the formulas and assumptions), a Markdown `report` and links to the chart and report. A request that can't be computed has `"status": "failed"` and the reason in `error`, and isn't billed.

### How it works

1. **Reading**: each line is read for the diameter, material, surface, notch, loads and options; numbers carry their units.
2. **Endurance limit**: Se′ = 0.5·Sut (700 MPa above 1400 MPa), times ka = a·Sut^b for the surface, kb = 1.24·d^−0.107 (or 1.51·d^−0.157 above 51 mm), kc, kd from the temperature polynomial and ke for the reliability (Shigley eqs. 6-8 and 6-18 to 6-27).
3. **Notches**: Kf = 1 + q(Kt − 1) with q = 1/(1 + √a/√r) from the Neuber constant for bending and torsion; Table 7-1 notches use their typical r/d.
4. **Stresses**: σa′ = √((32·Kf·Ma/πd³)² + 3(16·Kfs·Ta/πd³)²) and the same for the mean, with axial stress added to bending.
5. **Criteria**: the four distortion-energy criteria along a load line from the origin (Shigley eqs. 7-8 to 7-15); yield against the peak von Mises stress; life from Basquin's line through 0.9·Sut at 10³ cycles and Se at 10⁶ with the Goodman equivalent stress.
6. **Design**: standard diameters from small to large until the main criterion and yield both reach the target, recomputing kb and any r/d-based notch radius each time.

Results are engineering estimates for the stated assumptions; check deflections, critical speeds and the real notch geometry before building.

### Pricing

You pay one low price per section, at the price shown on this page. It includes the chart and the report. Requests that can't be computed are never charged. If you set a maximum cost per run, the Actor stops before a request that wouldn't fit.

### Speed

A section takes a millisecond and a diameter search a few, plus the chart. A run through the API answers in about 5 to 10 seconds, including the cloud container starting.

### Tips and limits

- **One section per entry**: check each shoulder, keyseat and groove along the shaft, with the moment and torque at that point (the Beam & Frame Calculator gives the moment diagram).
- **Table 7-1 notch values** are first estimates. For a final check, read Kt and Kts from the real fillet radius and diameter ratio and enter them with the radius.
- **Steels only**: the endurance rules here are for steel. Aluminum and other metals have no endurance limit.
- **Not covered**: deflection and slope at bearings and gears, critical speed, keys and hub stresses.
- **Limits**: 500 sections per run.

### For AI agents and developers

This Actor works with the [Apify MCP server](https://mcp.apify.com), so AI agents can call it as a tool. Pass `shafts` as plain text and read `summary`, `safety`, `yieldSafety`, `infiniteLife`, `lifeCycles`, `warnings` and, for designs, `design.standardDiameter`. A direct API call that waits for the answer:

```bash
curl -X POST "https://api.apify.com/v2/acts/jumblemog~shaft-calculator/run-sync-get-dataset-items?token=YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"shafts": ["find the diameter: 4140 at 300 HB, Sy 800 MPa, M 450 N·m, T 300 N·m, sharp shoulder, safety 1.8"]}'
```

`run-sync` instead returns the run's `OUTPUT`: the status, the counts and every result as JSON.

In Python, with the `apify-client` package:

```python
from apify_client import ApifyClient

client = ApifyClient("YOUR_TOKEN")
run = client.actor("jumblemog/shaft-calculator").call(run_input={
    "shafts": [{"diameter": "1.1 in", "sut": "105 kpsi", "sy": "82 kpsi", "kt": 1.68, "kts": 1.42,
                "notchRadius": "0.11 in", "moment": "1260 lbf·in", "torque": "1100 lbf·in"}],
})
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item["summary"])
```

### Credits

- Charts: [Vega-Lite](https://vega.github.io/vega-lite/) and [vl-convert](https://github.com/vega/vl-convert) (BSD-3-Clause), with the [Inter](https://rsms.me/inter/) font (SIL Open Font License).
- Method: Budynas and Nisbett, *Shigley's Mechanical Engineering Design*, chapters 6 and 7 (Marin factors, notch sensitivity, Table 7-1 stress concentration estimates, distortion-energy fatigue criteria, yield and life), and Table A-20 for carbon steel strengths.

# Actor input Schema

## `shafts` (type: `array`):

One section per entry, as a line of text or an object. Give the diameter ('30 mm shaft'), the material ('1045 CD', '1020 HR', or 'Sut 105 kpsi, Sy 82 kpsi', or '300 HB'), the surface (ground, machined, cold-drawn, hot-rolled, forged), the notch (rounded shoulder, sharp shoulder, keyseat, sled-runner keyseat, retaining ring groove, or 'Kt 1.68, Kts 1.42' with 'fillet radius 1 mm'), and the loads: 'M 140 N·m' (on a rotating shaft it reverses every turn), 'T 120 N·m' (steady), 'alternating torque 20 N·m', 'T 50 to 150 N·m', 'axial 5 kN'. Optional: '99% reliability', 'at 200 C', 'stationary', 'safety 2', 'gerber'. Write 'find the diameter' (or leave the diameter out) to size it. Object fields: mode, diameter, material, sut, sy, hardness, surface, reliability, temperature, notch, kt, kts, notchRadius, rotating, moment, momentAlternating, momentMean, torque, torqueAlternating, torqueMean, axial, safety, criterion, units, title.

## `material` (type: `string`):

For sections that don't name one, such as '1045 CD'. Otherwise AISI 1045 cold-drawn.

## `surface` (type: `string`):

Sets the surface factor ka. Machined if unset.

## `reliability` (type: `string`):

Sets the reliability factor ke. 50% if unset.

## `criterion` (type: `string`):

The criterion the warnings and the diameter search use. All four are always reported.

## `units` (type: `string`):

For numbers written without a unit. Inches, lbf or kpsi in the text switch to inch units on their own.

## `charts` (type: `boolean`):

The fatigue diagram and the safety factors for each section.

## Actor input object example

```json
{
  "shafts": [
    "30 mm shaft, 1050 CD, machined, bending moment 140 N·m, steady torque 120 N·m, rounded shoulder, 99% reliability",
    "1.1 in shaft, Sut 105 kpsi, Sy 82 kpsi, machined, Kt 1.68, Kts 1.42, fillet radius 0.11 in, M = 1260 lbf·in, T = 1100 lbf·in",
    "find the diameter: 1045 CD, M 200 N·m, T 150 N·m, keyseat, safety 2",
    {
      "title": "Gearbox output shaft at the ring groove",
      "diameter": "25 mm",
      "hardness": 300,
      "sy": "800 MPa",
      "surface": "ground",
      "notch": "retaining ring groove",
      "moment": "80 N·m",
      "torque": "50 to 150 N·m"
    }
  ],
  "units": "mm",
  "charts": true
}
```

# Actor output Schema

## `results` (type: `string`):

One row per shaft section: the summary and chart.

## `output` (type: `string`):

The OUTPUT record: every result in one JSON object.

## `files` (type: `string`):

Charts (PNG and SVG) and Markdown reports in the run's key-value store.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "shafts": [
        "30 mm shaft, 1050 CD, machined, bending moment 140 N·m, steady torque 120 N·m, rounded shoulder, 99% reliability",
        "1.1 in shaft, Sut 105 kpsi, Sy 82 kpsi, machined, Kt 1.68, Kts 1.42, fillet radius 0.11 in, M = 1260 lbf·in, T = 1100 lbf·in",
        "find the diameter: 1045 CD, M 200 N·m, T 150 N·m, keyseat, safety 2",
        {
            "title": "Gearbox output shaft at the ring groove",
            "diameter": "25 mm",
            "hardness": 300,
            "sy": "800 MPa",
            "surface": "ground",
            "notch": "retaining ring groove",
            "moment": "80 N·m",
            "torque": "50 to 150 N·m"
        }
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("jumblemog/shaft-calculator").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "shafts": [
        "30 mm shaft, 1050 CD, machined, bending moment 140 N·m, steady torque 120 N·m, rounded shoulder, 99% reliability",
        "1.1 in shaft, Sut 105 kpsi, Sy 82 kpsi, machined, Kt 1.68, Kts 1.42, fillet radius 0.11 in, M = 1260 lbf·in, T = 1100 lbf·in",
        "find the diameter: 1045 CD, M 200 N·m, T 150 N·m, keyseat, safety 2",
        {
            "title": "Gearbox output shaft at the ring groove",
            "diameter": "25 mm",
            "hardness": 300,
            "sy": "800 MPa",
            "surface": "ground",
            "notch": "retaining ring groove",
            "moment": "80 N·m",
            "torque": "50 to 150 N·m",
        },
    ] }

# Run the Actor and wait for it to finish
run = client.actor("jumblemog/shaft-calculator").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "shafts": [
    "30 mm shaft, 1050 CD, machined, bending moment 140 N·m, steady torque 120 N·m, rounded shoulder, 99% reliability",
    "1.1 in shaft, Sut 105 kpsi, Sy 82 kpsi, machined, Kt 1.68, Kts 1.42, fillet radius 0.11 in, M = 1260 lbf·in, T = 1100 lbf·in",
    "find the diameter: 1045 CD, M 200 N·m, T 150 N·m, keyseat, safety 2",
    {
      "title": "Gearbox output shaft at the ring groove",
      "diameter": "25 mm",
      "hardness": 300,
      "sy": "800 MPa",
      "surface": "ground",
      "notch": "retaining ring groove",
      "moment": "80 N·m",
      "torque": "50 to 150 N·m"
    }
  ]
}' |
apify call jumblemog/shaft-calculator --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,jumblemog/shaft-calculator"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/V9guQQnG91t7qlO7R/builds/K4AAgEfAHcLdZBFlm/openapi.json
