question.rb
solution.rb
playground.rb
1 require_relative "../physics" 2 3 question :the_pressure_on_the_thighbones do 4 kind :numerical 5 describes "The two thigh bones (femurs), each of cross-sectional area %{area}, support the upper part of a " \ 6 "human body of mass %{mass}. Taking g as %{gravity}, %{pressure}, in N/m²?" 7 given area: "10 cm2" 8 given mass: "40 kg" 9 given gravity: "10 m/s2" 10 asks pressure: "what is the average pressure sustained by the femurs" 11 end
1 require_relative "../questions/the_pressure_on_the_thighbones" 2 require_relative "../science/mechanical_properties_of_fluids/pressure" 3 4 solve :the_pressure_on_the_thighbones , using: Pressure do 5 objects :femur , :upper_body , both: :f2 6 7 take area: femur . area 8 take mass: upper_body . mass 9 take gravity: g 10 11 deduce_from "The two thigh bones" , both . area => 2 * femur . area 12 deduce_from "support the upper part" , both . thrust => upper_body . mass * g 13 14 pressure = both . pressure 15 answer pressure :, in: "N/m2" , figures: 2 16 17 conclusion "The weight of the upper body is shared between both bones, so it is spread over the two " \ 18 "cross-sections together." 19 end
1 require_relative "../solutions/the_pressure_on_the_thighbones" 2 3 play_with :the_pressure_on_the_thighbones do 4 title "The Pressure on the Thighbones" 5 end