Engineering
Mass-spring SHM API
Computes angular frequency ω=sqrt(k/m), period T=2π·sqrt(m/k), and frequency for a mass–spring oscillator, plus max velocity, acceleration, and energy for a given amplitude. Answers 'What is the period of a mass on a spring?', 'What is the natural frequency of an oscillator?'.
Price$0.04per request
MethodPOST
Route/v1/engineering/simple-harmonic-motion
StatusLive
MIME typeapplication/json
Rate limit120/minute
Cache0s public
engineeringmechanicsphysicsshmsimple-harmonic-motionoscillationnatural-frequencyperiod
API URL
Integration docshttps://x402.hexl.dev/v1/engineering/simple-harmonic-motionExample request
{
"massKg": 0.5,
"springConstantNm": 200,
"amplitudeM": 0.05
}Example response
{
"massKg": 0.5,
"springConstantNm": 200,
"angularFrequencyRadS": 20,
"periodS": 0.314159,
"frequencyHz": 3.183099,
"formula": "ω = sqrt(k/m), T = 2π*sqrt(m/k), f = 1/T",
"amplitudeM": 0.05,
"maxVelocityMs": 1,
"maxAccelerationMs2": 20,
"maxEnergyJ": 0.25
}Input schema
{
"type": "object",
"required": [
"massKg",
"springConstantNm"
],
"properties": {
"massKg": {
"type": "number",
"description": "oscillating mass (kg)",
"examples": [
0.5
]
},
"springConstantNm": {
"type": "number",
"description": "spring constant k (N/m)"
},
"amplitudeM": {
"type": "number",
"description": "oscillation amplitude (m)"
}
}
}Output schema
{
"type": "object",
"additionalProperties": true
}