play phryzby with physics

Along a Straight Line

solved UniformAcceleration

Q. A body starts at the originx0=0m with velocity v0 and speeds up or slows down steadily at a. Where is it after t, and how fast is it going?

x₀ = 0 mv₀ = 10 m/sx = ?v = ?Δt = 3 sa = -2 m/s²
Inputs
v0
10.0 m/s
a
-2 m/s²
t
3.00 s
Outputs
positionx21.00 m
velocityv4.0 m/s

How it's solved

Solved with UniformAcceleration

Given

  • x0=0m from “the origin”
  • v0, a, t yours to vary

Find x, v.

Working
  1. position after a timex=x0+v0⋅t+a⋅t22
  2. x=0+10⋅3+(−2)⋅322
  3. x=21m
  4. velocity after a timev=v0+a⋅t
  5. v=10+(−2)⋅3
  6. v=4m/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.

question.rb
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"10end
solution.rb
1require_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."12end
playground.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"12end
The laws it drew on
quantitywrittenunitswithinfrom
positionxm—Velocity
displacementΔxm—Velocity
path lengthdm—Velocity
time takenΔts0 … 1e+05Velocity
average velocityvavm/s—Velocity
average speedcavm/s—Velocity
starting positionx0m—Velocity
final positionxm—Velocity
velocityvm/s—Acceleration
change of velocityΔvm/s—Acceleration
average accelerationaavm/s²—Acceleration
starting velocityv0m/s—Acceleration
final velocityvm/s—Acceleration
accelerationam/s²—UniformAcceleration
gravitygm/s²—UniformAcceleration
timets0 … 1e+05UniformAcceleration
x0≡xi(start of motion)
starting position
x≡xi(end of motion)
final position
v0≡vi(start of motion)
starting velocity
v≡vi(end of motion)
final velocity
t≡Δtm
time
di(whole)=di(part 1)+di(part 2)
path in parts
Δtw=Δtp+Δtp
time in parts
ai(part 1)=ai(whole)
steady through its parts
Δx=x-x0
change of position
vav=ΔxΔt
displacement a time
cav=dΔt
path a time
Δv=v-v0
velocity gained
aav=ΔvΔt
velocity gained a time
v=v0+a⋅t
velocity after a time
x=x0+v0⋅t+a⋅t22
position after a time
v2=v02+2⋅a⋅(x-x0)
velocity after a distance
x-x0=(v+v0)⋅t2
mean of the velocities