question.rb
solution.rb
playground.rb
1 require_relative "../physics" 2 3 question :air_squeezed_without_heat_to_thirty_two_atmospheres do 4 kind :numerical 5 describes "Air at %{starting_pressure} fills %{starting_volume} of a diesel engine's cylinder. It is compressed so " \ 6 "fast that no heat escapes, until its pressure is %{final_pressure}. Taking γ for air as %{gamma}, " \ 7 "%{final_volume}, in litres?" 8 given starting_pressure: "1 atm" 9 given starting_volume: "8 L" 10 given final_pressure: "32 atm" 11 given gamma: "1.4" 12 asks final_volume: "what volume does it then fill" 13 end
1 require_relative "../questions/air_squeezed_without_heat_to_thirty_two_atmospheres" 2 require_relative "../science/thermodynamics/adiabatic_process" 3 4 solve :air_squeezed_without_heat_to_thirty_two_atmospheres , using: AdiabaticProcess do 5 objects :air 6 air . goes ( :compressed ) 7 8 take starting_pressure: air . initial_pressure , starting_volume: air . initial_volume 9 take final_pressure: air . final_pressure , gamma: air . ratio_of_specific_heats 10 11 final_volume = air . final_volume 12 answer final_volume :, in: "L" , figures: 3 13 14 conclusion "With no heat let out the gas warms as it is squeezed, so its pressure climbs faster than the " \ 15 "volume falls, and a 32-fold rise in pressure needs only a 12-fold fall in volume." 16 end
1 require_relative "../solutions/air_squeezed_without_heat_to_thirty_two_atmospheres" 2 3 play_with :air_squeezed_without_heat_to_thirty_two_atmospheres do 4 title "Air Squeezed Without Heat" 5 end