Heat, fluids & energy

Gas Piston Transient Lab

A heavy piston released in an upright cylinder of ideal gas, with weight, viscous damping, outside air, the friction heat sent to the gas or the surroundings, and insulated or heat-exchanging walls: 200 classic Runge-Kutta steps with a stop rule, the three exact end states (isothermal, reversible adiabat, first-law end), the settle time, the first turning point, the measured period against the small-bob period, the extremes, an energy ledger whose balance error measures the method error, the step ratio against the stability limit and a double-step error estimate, with the p-V path between the isotherm and the adiabat. Five challenges are scored for you. For learning how work, heat and friction decide where a gas spring comes to rest.

Last updated

Calculator overview

Inputs and outputs

This summary comes from the calculator's published input and output contract.

Inputs

Your prediction: the settled height
When omitted Blank
About this input

Challenge 1 only: your prediction of the height at which the piston settles, in metres. Blank until you predict; 0 is a real prediction.

Unit m Default Not set Range 0 to 100
Piston mass (required)
About this input

The mass of the piston, 0.1 to 500 kg. Its weight, with the outside air, sets the load pressure the gas must hold.

Unit kg Default 50 Range 0.1 to 500
Piston damping (required)
About this input

The viscous damping of the piston, 0 to 10000 N s/m: the drag that slows it in proportion to its speed. 0 means it bobs for ever with insulated walls.

Unit N s/m Default 300 Range 0 to 10000
Start height (required)
About this input

The height of the gas column at the latch, 0.05 to 1 m. Set by dragging the latch on the cylinder in the canvas, or typed in its popover.

Unit m Default 0.2 Range 0.05 to 1
Wall time constant (required)
About this input

With heat-exchanging walls, how fast the gas relaxes toward the wall temperature, 0.01 to 1000 s. Shown only while the walls exchange heat; it is still checked.

Unit s Default 0.5 Range 0.01 to 1000
Wall temperature (required)
About this input

With heat-exchanging walls, the temperature of the walls, 200 to 600 K. Shown only while the walls exchange heat; it is still checked.

Unit K Default 300 Range 200 to 600
Gas start temperature (required)
About this input

The gas temperature at the latch, 200 to 600 K.

Unit K Default 300 Range 200 to 600
Piston area (required)
About this input

The piston and bore area, 10 to 2000 square centimetres.

Unit cm2 Default 100 Range 10 to 2000
Run duration (required)
About this input

The simulated time, 0.1 to 60 s. The model takes 200 equal steps, so the time step is the duration over 200.

Unit s Default 3 Range 0.1 to 60
Cylinder walls (required)
About this input

Insulated walls let no heat through. Heat-exchanging walls pull the gas toward the wall temperature with one time constant, so the gas ends at the wall temperature.

Default Insulated Allowed Insulated, Heat-exchanging
Challenge number (required)
About this input

Pick a challenge from 1 to 5, or 0 for none. A challenge fixes its own settings and leaves one input to you.

Default 0 Range 0 to 5
Fill pressure (required)
About this input

The absolute gas pressure at the latch, 10 to 1000 kPa. If it is above the load pressure the piston rises when released; below it, the piston drops.

Unit kPa Default 300 Range 10 to 1000
Outside pressure (required)
About this input

The absolute air pressure above the piston, 0 to 200 kPa; 101.325 kPa is one standard atmosphere.

Unit kPa Default 101.325 Range 0 to 200
Gas type (required)
About this input

The gas in the cylinder: Monatomic (like helium or argon, gamma 5/3) or Diatomic (like air or nitrogen at room temperature, gamma 7/5). It sets how much the gas heats or cools when it is squeezed or expands.

Default Diatomic Allowed Monatomic, Diatomic
Friction heat goes to (required)
About this input

Where the heat made by the damping goes: to the Surroundings, or into the Gas. With insulated walls the piston ends higher and warmer when the heat stays in the gas.

Default Surroundings Allowed Surroundings, Gas

Outputs

Small-bob period (insulated)
About this output

The period of small bobs about the reversible-adiabat height with insulated walls (the gas as an adiabatic spring), seconds.

Unit s
Peak gas pressure
About this output

The highest gas pressure over the computed frames, kPa.

Unit kPa
Outside pressure used
About this output

The outside pressure the model used, kPa.

Unit kPa
Piston damping used
About this output

The damping the model used, N s/m.

Unit N s/m
Piston area used
About this output

The piston area the model used, square centimetres.

Unit cm2
Measured bob period
About this output

The mean time between upward crossings of the exact end height, seconds. Blank with fewer than two crossings.

Unit s
Which way the piston ends up
About this output

Whether the piston ends higher (the gas expands), lower (the gas is compressed) or at the same height, from the exact end height.

No unit declared
Lowest gas temperature
About this output

The coldest the gas gets over the computed frames, kelvin.

Unit K
Lowest gas pressure
About this output

The lowest gas pressure over the computed frames, kPa.

Unit kPa
Lowest height
About this output

The lowest piston height over the computed frames, metres.

Unit m
Formula module versions
About this output

The formula modules the model is built from, with their versions.

No unit declared
Model version
About this output

The model version.

No unit declared
Model Status
About this output

OK:, CHECK: (the results are shown but need care) or NOT VALID: (an input cannot be used; the results are empty), with the reason.

No unit declared
First turning point: height
About this output

The height of the first turning point (the first top of a rise or bottom of a fall), refined by a parabola through three frames, metres.

Unit m
Time step
About this output

The time step, the duration over 200, seconds.

Unit s
Step ratio
About this output

The time step times the fastest rate in the model, the largest over the frames. Above 1 the frames lose accuracy; above 2.615, the method's stability limit, they can blow up.

No unit declared
Wall time constant used
About this output

The wall time constant the model used, seconds (blank with insulated walls).

Unit s
Wall temperature used
About this output

The wall temperature the model used, kelvin (blank with insulated walls).

Unit K
First turning point: time
About this output

The time of the first turning point, seconds.

Unit s
Gas start temperature used
About this output

The gas start temperature the model used, kelvin.

Unit K
The p-V diagram: the isotherm and the adiabat through the start, and the load pressure, at 41 volumes
About this output

The p-V diagram at 41 volumes spanning the run: the isotherm and the adiabat through the start, and the load pressure.

No unit declared
Piston mass used
About this output

The piston mass the model used, kilograms.

Unit kg
The run, frame by frame: time, height, velocity, pressure, temperature, volume, wall heat rate, friction heat and the energy balance error
About this output

The run frame by frame, n = 0 to 200: the time, the piston height and velocity, the gas pressure, temperature and volume, the wall heat rate, the friction heat so far and the energy balance error. Frames after a stop are blank; while challenge 1 waits for a prediction only frame 0 is given.

No unit declared
Start height used
About this output

The start height the model used, metres.

Unit m
Settle time (within 2% of the move)
About this output

When the piston comes within 2% of its move from the exact end height and stays there, read from the frames by linear interpolation, seconds. Blank when it does not settle within the run.

Unit s
Estimated method error at the end
About this output

An estimate of the method's relative error at the end of the run, from a second run with half as many steps of twice the length.

No unit declared
End state that applies
About this output

Which exact end state applies: the isothermal end with heat-exchanging walls, the reversible adiabat with insulated walls and the friction heat leaving, or the first-law end with the friction heat kept in the gas.

No unit declared
Run duration used
About this output

The simulated time the model used, seconds.

Unit s
Damping ratio (small bobs, insulated)
About this output

The damping ratio of small bobs with insulated walls: the damping over the critical damping.

No unit declared
Exact end temperature
About this output

The exact gas temperature at rest, kelvin.

Unit K
The three exact end states
About this output

The three exact end states (isothermal, reversible adiabat, first-law end): height, temperature and pressure, and which one applies here.

No unit declared
Exact end height
About this output

The exact height at which the piston comes to rest (the centre of the bob when nothing removes energy), metres.

Unit m
Cylinder walls used
About this output

The cylinder walls the model used.

No unit declared
Challenge: the value scored
About this output

The value the selected challenge scores (blank while challenge 1 waits for a prediction).

No unit declared
Challenge goal
About this output

What the selected challenge asks.

No unit declared
Challenge feedback
About this output

The prompt while challenge 1 waits for a prediction, then a hint or the explanation once met.

No unit declared
Critical damping (small bobs, insulated)
About this output

The damping at which small bobs with insulated walls stop overshooting, N s/m.

Unit N s/m
Challenge result
About this output

No challenge selected, MET or NOT MET.

No unit declared
Challenge score
About this output

100 when the selected challenge is met, else 0.

No unit declared
Net work done by the gas
About this output

The net work done by the gas on the piston and the outside air by the last frame, from the gas's own energy balance, joules.

Unit J
Gas type used
About this output

The gas the model used (a challenge may fix it).

No unit declared
Amount of gas
About this output

The amount of gas in the cylinder, from the gas law at the latch, moles.

Unit mol
Longest stable duration (estimate)
About this output

An estimate of the longest duration whose time step stays within the stability limit, from the rates at the start and at the three end states, seconds.

Unit s
Highest gas temperature
About this output

The warmest the gas gets over the computed frames, kelvin.

Unit K
Highest height
About this output

The highest piston height over the computed frames, metres.

Unit m
Friction heat goes to (used)
About this output

Where the friction heat went in the run the model used.

No unit declared
Load pressure (the pressure at rest)
About this output

The load pressure: the outside pressure plus the piston's weight over its area. Every end state sits at this pressure, kPa.

Unit kPa
Energy balance error
About this output

The energy balance error at the last frame: the energy ledger's changes added up. It is zero for the exact motion, so it measures the method's error, joules.

Unit J
The energy ledger at the end of the run
About this output

Where the energy went by the last frame: the piston's kinetic and height energy, the work on the outside air, the gas's internal energy, the friction heat that left and the heat from the walls, and their sum, the balance error, with each as a share of the gas's starting energy.

No unit declared
Gas temperature at the end of the run
About this output

The gas temperature at the last computed frame, kelvin.

Unit K
Height at the end of the run
About this output

The piston height at the last computed frame, metres.

Unit m
Fill pressure used
About this output

The fill pressure the model used, kPa.

Unit kPa
This page is provided by LogicCommons for informational purposes only. Results are analysis outputs computed from the inputs you supply and are not professional advice. Verify all inputs and results independently.

LogicCommons is in beta. If a result, label, or reference looks wrong, tell us here; we read every message.

Methodology

Purpose and model boundary

This lab releases a heavy piston in an upright cylinder of ideal gas. The piston has weight and viscous damping, and outside air presses on its top. It starts latched at rest; when released it rises or drops, bobs on the gas as on a spring, and comes to rest where the gas pressure holds the load. The heat made by the damping goes either into the gas or to the surroundings, and the walls are either insulated or exchange heat with one time constant. The model steps the motion through 200 classic fourth-order Runge-Kutta (RK4) steps with a stop rule, and beside the run gives the three exact end states (isothermal, reversible adiabat, first-law end), the settle time, the first turning point, the measured bob period against the small-bob period, the extremes, an energy ledger whose balance error measures the method's error, the step ratio against the method's stability limit and a double-step error estimate, with the run's path on the p-V diagram between the isotherm and the adiabat through the start. Five scored challenges go with it.

It is a lab for learning how work, heat and friction decide where a gas spring comes to rest: why an expanding insulated gas cools and settles lower than a constant-temperature estimate, why keeping the friction heat in the gas lifts the end, why heat-exchanging walls bring the gas back to the wall temperature, and how a time step that is too long spoils the energy balance. It is not a model of a real engine or actuator: the gas is ideal and uniform, the damping is purely viscous, and there are no valves, leaks, springs or stops.

The model is the calculation authority. The page sends the values you set to the model and draws only what it returns: the cylinder with the piston at each frame, the gas temperature shading, the exact end height, and the p-V diagram with the isotherm, the adiabat and the load pressure all come from the model's own rows. The page computes no height, pressure, temperature or energy itself.

Inputs and units

Input Meaning and unit
Gas type Monatomic (like helium or argon, γ = 5/3) or Diatomic (default; like air or nitrogen at room temperature, γ = 7/5).
Fill pressure p0, the absolute gas pressure at the latch, from 10 to 1,000 kPa (default 300 kPa).
Start height x0, the height of the gas column at the latch, from 0.05 to 1 m (default 0.2 m).
Gas start temperature T0, from 200 to 600 K (default 300 K).
Piston mass m, from 0.1 to 500 kg (default 50 kg).
Piston area The piston and bore area, from 10 to 2,000 cm² (default 100 cm²).
Outside pressure The absolute air pressure above the piston, from 0 to 200 kPa (default 101.325 kPa, one standard atmosphere).
Piston damping c, the viscous damping, from 0 to 10,000 N s/m (default 300 N s/m).
Friction heat goes to Surroundings (default) or Gas.
Cylinder walls Insulated (default) or Heat-exchanging.
Wall time constant τ, from 0.01 to 1,000 s (default 0.5 s): how fast heat-exchanging walls pull the gas toward their temperature. Checked always.
Wall temperature Tw, from 200 to 600 K (default 300 K). Checked always.
Run duration From 0.1 to 60 s (default 3 s), always in 200 equal steps, so the time step is the duration over 200.
Challenge number 0 for free exploration, or 1 to 5 to load a challenge.
Your prediction: the settled height Challenge 1 only, from 0 to 100 m. It starts blank, and a blank means not yet predicted; 0 is a real prediction.

Where each input is set:

  • On the canvas only: the start height, by dragging the latch on the cylinder, in steps of 0.005 m, or typed in its popover. It is not in the input panel.
  • In the input panel: every other input. The wall time constant and wall temperature are shown only while the walls exchange heat. Your prediction appears only while challenge 1 is selected.

Every input except your prediction is checked on its entered value, even when the current settings do not use it.

Governing relationships

The gas. The gas is ideal, with uniform pressure and temperature. Its amount is fixed at the latch: n·R = p0·A·x0/T0, with A the piston area. Its heat capacity at constant volume is C = n·R/(γ - 1), where γ - 1 is 2/3 (monatomic) or 2/5 (diatomic), and its pressure is p = n·R·T/(A·x).

The load pressure. The piston comes to rest where the gas holds the outside air and the piston's weight: p_eq = p_out + m·g/A, with g = 9.80665 m/s². If the fill pressure is above it the piston first rises; below it, the piston first drops.

The motion. With the height x, the velocity v (up positive) and the gas temperature T:

  • dx/dt = v;
  • m·dv/dt = n·R·T/x - p_out·A - c·v - m·g (the gas force, the outside air, the damping and the weight);
  • dT/dt = -(γ - 1)·T·v/x + φ·c·v²/C + k_w·(Tw - T).

The first term of dT/dt is the gas doing work as it expands (or having work done on it as it is squeezed); the second is the friction heat, with φ = 1 when it goes into the gas and 0 when it goes to the surroundings; the third is the wall heat, with k_w = 1/τ for heat-exchanging walls and 0 for insulated ones. The friction heat made so far, F, grows at c·v², and the heat from the walls, Q, at C·k_w·(Tw - T).

Energy. For the exact motion, the piston's kinetic energy, its height energy, the work pushing the outside air and the gas's internal energy change, plus the friction heat that left, less the heat from the walls, add up to zero at every moment. RK4 does not keep this exactly, so that sum, the energy balance error, measures the method's error.

RK4 with a stop rule. Each of the 200 steps of length h = duration/200 takes the four classic RK4 stages. A stage height that is not positive, or a new state with a height below 0.1% or above 100 times the start, a temperature outside 1 to 10,000 K or a speed above 100,000 m/s, stops the run there; later frames are blank.

The step ratio. On each frame, h times the larger of two local rates: the gas-spring frequency √(γ·p·A/(m·x)) plus the damping rate c/m, and the wall rate k_w plus the expansion rate (γ - 1)·|v|/x. The step ratio is the largest over the frames. RK4 is stable for any decaying mode while the step ratio stays below 2.615 (the smallest radius of its stability region in the left half of the plane, rounded down); above 1 the frames lose accuracy. Because the system is nonlinear this is a local estimate, so it is a warning, not a refusal. The longest stable duration is estimated as 200 × 2.615 over the largest of these rates at the start and at the three end states.

The three exact end states, all at the load pressure:

  • heat-exchanging walls, the isothermal end: x = x0·(p0/p_eq)·(Tw/T0) and T = Tw, whatever the damping or the route;
  • insulated, friction heat to the surroundings, the reversible adiabat: x = x0·(p0/p_eq)^(1/γ) and T = T0·(p_eq/p0)^((γ - 1)/γ);
  • insulated, friction heat into the gas, the first-law end: no energy leaves, so T = T0·(1 + (γ - 1)·p_eq/p0)/γ and x = x0·(p0/p_eq)·(T/T0).

The end that applies follows from the walls and the route. With no damping and insulated walls nothing removes energy, so the piston bobs for ever about the reversible-adiabat height, which then serves as the centre.

Small bobs. About the reversible-adiabat height, with insulated walls, the gas acts as a spring of angular frequency ω = √(γ·p_eq·A/(m·x_ad)): the small-bob period is 2π/ω, the critical damping 2·m·ω and the damping ratio c/(2·m·ω).

Measures on the frames. The settle time is when the piston comes within 2% of its move from the exact end height and stays there, by linear interpolation between frames. The first turning point (the first top of a rise or bottom of a fall) is refined by a parabola through three frames. The measured period is the mean time between upward crossings of the exact end height. The extremes are the lowest and highest height, temperature and pressure over the computed frames.

Double-step estimate. A second RK4 run takes 100 steps of 2·h. Since RK4's error shrinks with the fourth power of the step, the relative error at the end is estimated as the larger of the height and temperature differences, over the start values, divided by 15.

The p-V diagram. At 41 volumes spanning the run, the isotherm p = p0·V0/V and the adiabat p = p0·(V0/V)^γ through the start, and the load pressure as a level line.

Calculation sequence

  1. The model checks your values in the order of the status list under Errors and warnings, up to the challenge number and your prediction.
  2. It fixes the values in use: yours, or in a challenge the challenge's, except the input that challenge leaves free.
  3. It works out the gas amount, the heat capacity, the load pressure and the direction of the first motion.
  4. It runs the 200 RK4 steps, with the friction heat and wall heat accumulated alongside, and stops the run if it leaves the model's range; each frame also carries the pressure, volume, wall heat rate, step ratio and balance error.
  5. It runs the 100-step double-step run.
  6. It computes the three exact end states and picks the one that applies, then reads the settle time, turning point, period, extremes and final values from the frames, and the small-bob values.
  7. It builds the energy ledger and the p-V curves.
  8. It sets the status and, in a challenge, scores the challenge and withholds what the challenge keeps back.

Outputs and interpretation

  • Exact end height (m) and exact end temperature (K), which way the piston ends up (higher, lower or the same height) and the end state that applies; the three exact end states side by side (height, temperature and pressure, and which applies).
  • Height at the end of the run (m) and gas temperature at the end of the run (K), from the last computed frame.
  • Settle time (s), blank when the piston does not settle within the run; the first turning point (time and height); the measured bob period (s), blank with fewer than two crossings.
  • Extremes: the lowest and highest height (m), the lowest and highest gas temperature (K), and the lowest and peak gas pressure (kPa).
  • Load pressure (kPa), the amount of gas (mol), the time step (s) and the net work done by the gas (J).
  • Small bobs with insulated walls: the period (s), the damping ratio and the critical damping (N s/m).
  • Method checks: the step ratio, the longest stable duration (an estimate, s), the estimated method error at the end (relative) and the energy balance error (J).
  • The energy ledger: by the last frame, the piston's kinetic energy, its height energy, the work pushing the outside air, the gas's internal energy, the friction heat lost to the surroundings and the heat from the walls (subtracted), their sum (the balance error, ideally 0), each also as a share of the gas's starting energy C·T0.
  • The run, frame by frame: for frames 0 to 200, the time, height, velocity, gas pressure, temperature and volume, the wall heat rate, the friction heat so far and the energy balance error.
  • Settings used and the model and module versions.

Reading the canvas: pressing play releases the piston, and the drawing follows the frames, with the gas shaded by its temperature and the exact end height marked. The p-V diagram draws the run's path against the isotherm and the adiabat through the start and the load pressure: an insulated run with the friction heat sent away ends on the adiabat, one with heat-exchanging walls ends on the isotherm.

What to take from the lab: the end height is set by the load pressure and by how much energy the gas keeps. An expanding insulated gas does work on the piston and the outside air and cools, so it ends lower than at constant temperature; keeping the friction heat in the gas makes it end higher and warmer; heat-exchanging walls return the gas to the wall temperature, so it ends on the isotherm. The damping decides only how fast it gets there, and the energy balance error shows when the time step is too long to trust.

Challenges

Each challenge uses the diatomic gas, a 0.2 m start, 300 K, a 50 kg piston of 100 cm², one standard atmosphere outside and a 300 K wall, and leaves one input to you. The model scores each one MET (100) or NOT MET (0) and gives a one-line hint while it is not met.

  1. Predict the settled height (introductory). Insulated walls, friction heat to the surroundings, a fill pressure of 200 kPa. Predict the height at which the piston settles after release, within 5 mm of the exact end height. The value scored is your prediction less the exact end height.
  2. Land on the mark (intermediate). Insulated walls, with the friction heat kept in the gas. Choose the fill pressure so the piston settles within the run at 0.300 m, within 1 mm. The value scored is the height at the end of the run.
  3. Keep it warm (intermediate). Heat-exchanging walls at 300 K, a fill pressure of 200 kPa. Choose the wall time constant so the coldest the gas gets is between 275 and 276 K, in a run that completes. The value scored is the lowest gas temperature.
  4. Settle fast (intermediate). Insulated walls, a fill pressure of 200 kPa. Choose the damping so the piston stays within 2% of its move from its end height after at most 0.35 s. The value scored is the settle time.
  5. Honest energy (advanced). No damping and insulated walls. Choose a run of at least 8 s, completed, whose energy balance error stays within 1 J. The value scored is the energy balance error.

Challenge 1 holds back its answer until you predict: while your prediction is blank, the end states and direction, the final values, settle time, turning point, period, extremes, small-bob values, method checks, net work, energy ledger, p-V curves and every frame after frame 0 are blank, and the feedback asks you to predict first. Any prediction, 0 included, reveals everything, met or not. Challenge 4 withholds the small-bob period, damping ratio and critical damping until it is met, since they point straight at the answer; your own run, settle time and measured period stay. Challenges 2, 3 and 5 withhold nothing.

Validation and status logic

The status reads the first match in the list under Errors and warnings. The NOT VALID checks read the values you entered; the CHECK items and the final OK read the values in use and apply inside challenges too. A challenge number that is not a whole number from 0 to 5 counts as no challenge selected. The status reads OK when the gas already balances the load and nothing will move, when there is no damping and the walls are insulated (so the piston bobs for ever about the reversible-adiabat height), or when the piston settles within the run; otherwise it reads CHECK because the piston is still moving at the end of the run.

Assumptions and limitations

  • An ideal gas of fixed amount with uniform pressure and temperature: the piston is taken to move much more slowly than sound travels in the gas, which a very light piston under a large pressure difference breaks, and the model does not check it.
  • γ is 5/3 or 7/5, from room-temperature heat capacities of 3/2·R and 5/2·R.
  • Viscous damping only; one wall time constant; no valves, leaks, springs, stops or second chamber.
  • Exactly 200 RK4 steps over the run. The step ratio is a local estimate, not an exact stability limit, so coarse and unstable steps are flagged rather than refused. A run that leaves the model's range stops and its later frames are blank.
  • The settle time counts only the run's frames, so a run that enters the band just before its end reads settled. The small-bob period, damping ratio and critical damping are for small bobs with insulated walls.
  • A value within about 1×10⁻⁹ (relative) of a threshold may flip a status or a challenge result.

Restrictions and non-computing states

Under NOT VALID every result and every table is blank, except the model and module versions; the challenge status (No challenge selected, or NOT MET when a challenge is selected), a score of 0, and the goal and not-met hint of a selected challenge.

When the run stops early, every frame after the stop is blank, and the results read from the frames use the computed frames only; the double-step error estimate is blank unless both runs complete.

While challenge 1 awaits a prediction, and while challenge 4 is not met, the results listed under Challenges stay blank.

Errors and warnings

The status messages, first match wins:

  • NOT VALID: choose the gas type from the list
  • NOT VALID: the fill pressure must be from 10 to 1000 kPa
  • NOT VALID: the start height must be from 0.05 to 1 m
  • NOT VALID: the gas start temperature and the wall temperature must be from 200 to 600 K
  • NOT VALID: the piston mass must be from 0.1 to 500 kg
  • NOT VALID: the piston area must be from 10 to 2000 cm2
  • NOT VALID: the outside pressure must be from 0 to 200 kPa
  • NOT VALID: the damping must be from 0 to 10000 N s/m
  • NOT VALID: choose where the friction heat goes from the list
  • NOT VALID: choose the cylinder walls from the list
  • NOT VALID: the wall time constant must be from 0.01 to 1000 s
  • NOT VALID: the run duration must be from 0.1 to 60 s
  • NOT VALID: the challenge number must be a whole number from 0 to 5, and the settled-height prediction blank or a number from 0 to 100 m
  • CHECK: the run stopped after frame N of 200 because the piston or the gas left the model's range (height below 0.1% or above 100 times the start, temperature outside 1 to 10000 K, or speed above 100000 m/s); a coarse step usually causes this, so shorten the duration: N is the last computed frame.
  • CHECK: the time step is beyond the method's stability limit for this piston (step ratio above 2.615), so the frames can blow up; shorten the duration
  • CHECK: the time step is coarse for this piston (step ratio above 1), so the frames lose accuracy; check the energy balance error or shorten the duration
  • OK: the gas already balances the load, or there is no damping with insulated walls, or the piston settles within the run.
  • CHECK: the piston is still moving at the end of the run; a longer run lets it settle

A blank list choice is refused by the page before the model runs.

References

This laboratory is an educational model of a gas spring: a weighted, damped piston on a fixed amount of ideal gas. It couples Newton's second law for the piston with the first law of thermodynamics for the gas, using the room-temperature heat capacities of monatomic and diatomic gases, and steps the motion by the classical fourth-order Runge-Kutta method, with a double-step error estimate and the method's stability region as a check on the step. The end states come in closed form from the isothermal and reversible adiabatic relations of an ideal gas and from an energy balance, and an energy ledger measures the method's error.

Sources and further reading

  • Quasi-static adiabatic processes of an ideal gas (pV^γ and TV^(γ - 1) constant) and the isotherm and adiabat on a p-V diagram: OpenStax, University Physics Volume 2, section 3.6, Adiabatic Processes for an Ideal Gas. OpenStax
  • The molar heat capacities of monatomic and diatomic ideal gases at room temperature: OpenStax, University Physics Volume 2, section 3.5, Heat Capacities of an Ideal Gas. OpenStax
  • Viscous damping and underdamped, critically damped and overdamped motion: OpenStax, University Physics Volume 1, section 15.5, Damped Oscillations. OpenStax
  • The fourth-order Runge-Kutta method and the absolute stability of explicit methods: L. R. Hellevik, Numerical Methods for Engineers, Department of Structural Engineering, NTNU, 2020, chapter 2, sections 2.11 and 2.15. NTNU course text
  • Runge-Kutta methods, step doubling and Richardson error estimates: W. H. Press, S. A. Teukolsky, W. T. Vetterling and B. P. Flannery, Numerical Recipes: The Art of Scientific Computing, 3rd edition, Cambridge University Press, 2007, chapter 17, Integration of Ordinary Differential Equations.

No table or text from any of these publications is reproduced, and none of their authors or publishers has reviewed or endorses this laboratory.

This laboratory is for learning. Its results hold only within its stated ranges; a real cylinder has seal friction, leaks and pressure waves in the gas that this uniform, purely viscous model leaves out.

Links were current at build time. If one moves, search the document's title rather than reporting a broken link as a defect.

Results are informational and not professional advice. See our Terms of Use. Powered by SpreadsheetWeb · About · Privacy · Terms