Along a Straight Line
Q. A body starts at the originm with velocity and speeds up or slows down steadily at . Where is it after , and how fast is it going?
Inputs
Outputs
position21.00 m
velocity4.0 m/s
How it's solved
Solved with UniformAcceleration
Given
- m from “the origin”
- , , yours to vary
Find , .
Working
- position after a time
- m
- velocity after a time
- m/s
Conclusion
Where the steady change of velocity has taken it: its velocity changes by the same amount every second, and its position by that velocity, second after second.
The web of concepts
given read from the words equation asked
The Ruby that solves it
The question and its solution are small Ruby files. The engine runs them.
1require_relative "../physics"23question :along_a_straight_line do4 describes "A body starts at the origin with velocity %{starting_velocity} and speeds up or slows down steadily at %{acceleration}. " \5 "%{position} after %{time}, and %{velocity}?"6 given :starting_velocity7 given :acceleration8 given :time9 asks position: "Where is it", velocity: "how fast is it going"10end1require_relative "../questions/along_a_straight_line"2require_relative "../science/motion_in_a_straight_line/uniform_acceleration"34solve :along_a_straight_line, using: UniformAcceleration do5 take starting_velocity: :v_0, acceleration: :a, time: :t, position: :x, velocity: :v6 deduce_from "the origin", x_0: "0 m"7 find_value :position8 find_value :velocity910 conclusion "Where the steady change of velocity has taken it: its velocity changes by the same " \11 "amount every second, and its position by that velocity, second after second."12endplayground.rb
1require_relative "../solutions/along_a_straight_line"23play_with :along_a_straight_line do4 title "Along a Straight Line"56 input :starting_velocity, -20.0..20.0, in: "m/s", step: 0.5, default: 10.0, as: "starting velocity"7 input :acceleration, -10.0..10.0, in: "m/s2", step: 0.5, default: -2.0, as: "acceleration"8 input :time, 0.0..10.0, in: "s", step: 0.1, default: 3.0, as: "time"910 output :position, in: "m"11 output :velocity, in: "m/s"12endThe laws it drew on
| quantity | written | units | within | from |
|---|---|---|---|---|
| position | m | — | Velocity | |
| displacement | m | — | Velocity | |
| path length | m | — | Velocity | |
| time taken | s | 0 … 1e+05 | Velocity | |
| average velocity | m/s | — | Velocity | |
| average speed | m/s | — | Velocity | |
| starting position | m | — | Velocity | |
| final position | m | — | Velocity | |
| velocity | m/s | — | Acceleration | |
| change of velocity | m/s | — | Acceleration | |
| average acceleration | m/s² | — | Acceleration | |
| starting velocity | m/s | — | Acceleration | |
| final velocity | m/s | — | Acceleration | |
| acceleration | m/s² | — | UniformAcceleration | |
| gravity | m/s² | — | UniformAcceleration | |
| time | s | 0 … 1e+05 | UniformAcceleration |