Description
Sample validated practice cases for Bulk Modulus From Sound Speed from an explicit candidate bank, returning separate prompts and calculator answers with repeat policy and replay metadata.
A worked-example generator selects educational cases from a finite bank supplied by the user. It validates those cases with an existing calculator and returns prompts separately from calculated answers. Sampling changes which eligible cases appear; it does not create a new scientific model or invent measurements.
Acoustic models distinguish pressure level, intensity, energy, loudness and material properties. Keep energy windows, reference levels and SI units with each case. Ideal sound-field, room and material assumptions remain part of the selected model.
Calculator model: Adiabatic bulk modulus rho*c² from medium density and sound speed.1
When to use this tool
Use this generator when you already have candidate Bulk Modulus From Sound Speed inputs and want reproducible practice prompts with separately available calculator answers.
How to use the tool and how it works
- Prepare candidatesJson as distinct {id,input} records using the calculator fields and units below. Choose a replay seed, exercise count and repeat policy.
- Run the generator and read result.status and result.rejected before using the exercise list. Correct or deliberately exclude rejected candidates.
- Read each exercise’s prompt and separate answer. Keep result.model and result.replay with exported examples so units, source calculator and repeat policy remain explicit.
Validate each explicit candidate {id,input} through acoustics/bulk-modulus-from-sound-speed before sampling. The calculator multiplies density in kg/m³ by the square of sound speed in m/s to obtain adiabatic bulk modulus in pascals for the stated medium model. Keep successful prompt/answer pairs and structured rejections. Sample eligible IDs uniformly with the chosen replacement policy using one advancing source, then return separate prompts and actual calculator output objects with source indexes and model ports. Equal answers do not merge distinct candidate IDs.2
| Input field | Meaning and units | Accepted input |
|---|---|---|
| seed | Nonblank replay seed, at most 256 UTF-16 code units; an injected source overrides seeded draws. | Text, at most 8,192 UTF-16 code units; narrower grammar/range rules also apply. |
| count | Requested exercise count, integer 1–32. | Finite safe integer satisfying the stated bounds. |
| withoutReplacement | True selects distinct eligible candidate IDs; false allows an eligible ID to recur. | Boolean true or false. |
| candidatesJson | JSON text for at most 128 exact {id,input} records. id is a nonempty distinct string; input is an object for the linked calculator using the candidate fields below. Equal inputs/answers may have different IDs. | Text, at most 8,192 UTF-16 code units; narrower grammar/range rules also apply. |
Every candidate is evaluated before selection. count is 1–32; candidatesJson contains at most 128 records with exactly id and input keys. Duplicate or empty IDs, malformed bank records and invalid outer fields cause an input error. A base-calculator failure is retained in rejected rather than silently discarded.
If no candidate succeeds, status is empty-eligible-bank. If distinct selection requests more cases than succeed, status is insufficient-eligible-bank. Both return no exercises. Otherwise status is ok. Every selected answer is the actual output object of the linked calculator, not a fabricated answer inferred from a prompt.
Candidate conventions: densityKgPerCubicMeter and speedMetersPerSecond must both be strictly positive. The answer is a model value in pascals, not a material measurement.
| Candidate input field | Meaning | Required / type and units |
|---|---|---|
| densityKgPerCubicMeter | Density Kg Per Cubic Meter | Required. number; unit: kg/m3 |
| speedMetersPerSecond | Speed Meters Per Second | Required. number; unit: m/s |
| Answer field | Meaning | Declared type and units |
|---|---|---|
| bulkModulusPascals | Bulk Modulus Pascals | number; unit: Pa |
These decoded structures show the examples inside JSON text fields. Supply their serialized JSON strings as input.
{
"candidatesJson": [
{
"id": "canonical",
"input": {
"densityKgPerCubicMeter": 1000,
"speedMetersPerSecond": 1500
}
}
]
} | Output field | Interpretation |
|---|---|
| result | Object containing the fields below. |
| result.status | ok, empty-eligible-bank or insufficient-eligible-bank. Non-ok banks return no exercises. |
| result.baseToolId | Canonical calculator ID used to validate and answer every candidate. |
| result.model | Underlying calculator description and actual input/output port definitions, including declared units. |
| result.replay | Seed, source kind, requested count/replacement policy and actual selection-source call count. |
| result.eligibleCandidateIds | All successfully validated candidate IDs in original candidate-bank order. |
| result.rejected | Original candidate ID/index and structured calculator or evidence-budget error. |
| result.exercises | Selected {candidateId,sourceIndex,prompt,answer} records in draw order; answers are actual calculator output objects. |
{
"input": {
"seed": "batch56-example",
"count": 1,
"withoutReplacement": true,
"candidatesJson": "[{\"id\":\"canonical\",\"input\":{\"densityKgPerCubicMeter\":1000,\"speedMetersPerSecond\":1500}}]"
},
"output": {
"result": {
"status": "ok",
"baseToolId": "acoustics/bulk-modulus-from-sound-speed",
"model": {
"description": "Adiabatic bulk modulus rho*c² from medium density and sound speed.",
"inputs": [
{
"id": "densityKgPerCubicMeter",
"label": "Density Kg Per Cubic Meter",
"required": true,
"valueType": {
"unit": "kg/m3",
"type": "number"
}
},
{
"id": "speedMetersPerSecond",
"label": "Speed Meters Per Second",
"required": true,
"valueType": {
"unit": "m/s",
"type": "number"
}
}
],
"outputs": [
{
"id": "bulkModulusPascals",
"label": "Bulk Modulus Pascals",
"valueType": {
"unit": "Pa",
"type": "number"
}
}
]
},
"replay": {
"seed": "batch56-example",
"source": "seeded",
"count": 1,
"withoutReplacement": true,
"draws": 1
},
"eligibleCandidateIds": [
"canonical"
],
"rejected": [],
"exercises": [
{
"candidateId": "canonical",
"sourceIndex": 0,
"prompt": {
"densityKgPerCubicMeter": 1000,
"speedMetersPerSecond": 1500
},
"answer": {
"bulkModulusPascals": 2250000000
}
}
]
}
}
} Limitations and assumptions
- This selects practice cases from a supplied finite bank. The linked calculator’s model assumptions, required units and executable validation remain in force. Empty or too-small eligible banks return explicit statuses without fabricated exercises.
- A nonblank seed of at most 256 UTF-16 code units is required. With ordinary use the seed initializes one deterministic advancing source; an application-injected random source takes precedence and the seed alone then cannot replay the result. Uniformity statements assume independent uniform source draws in [0,1). Source calls are bounded and degenerate injected sources can fail a rejection budget. This is not cryptographically secure.
- Candidate inputs and answers remain subject to the linked calculator’s model assumptions. The sampler tests its executable contract, not real-world truth, calibration, fitness for a decision or scientific validity.
- Candidates whose prompt/answer exceed portable evidence bounds are rejected with a structured evidence-budget error. The complete selected output also has a bounded size and can fail if the combined evidence exceeds it.
- Every declared outer field is required and unknown outer fields are rejected. Strings and JSON text have size limits, lists are bounded to 128 entries, and JSON nesting/node counts are bounded. Tighter operation-specific bounds stated above take precedence.
- Numeric outputs must remain finite and within safe-integer magnitude. Original record indexes and cell coordinates are zero-based; stated half-open ranges exclude their end.
Alternative or Complementary methods
Use the linked calculator to inspect an individual candidate directly. Use this generator to select and package already supplied cases; build or review the exercise bank separately so topic coverage and difficulty reflect the teaching objective.
References
Similar or alternative tools
- Random Acoustic Intensity From Spl Worked Example Generator
Sample validated practice cases for Acoustic Intensity From Spl from an explicit candidate bank, returning separate prompts and calculator answers with repeat policy and replay metadata.
- Random Acoustic Power From Intensity Area Worked Example Generator
Sample validated practice cases for Acoustic Power From Intensity Area from an explicit candidate bank, returning separate prompts and calculator answers with repeat policy and replay metadata.