Why Distance is Area under Velocity-Time Line
Understanding why distance is area under velocity-time line
<?xml version="1.0" encoding="UTF-8"?>
<!--Fri Jan 13 2012 09:58:23 GMT-0500 (EST)-->
<XholonWorkbook>
<Notes>
Khan Academy
------------
Title: Why Distance is Area under Velocity-Time Line
Description: Understanding why distance is area under velocity-time line
Url: http://www.khanacademy.org/video/why-distance-is-area-under-velocity-time-line?playlist=Physics
InternalName: why-distance-is-area-under-velocity-time-line
YoutubeId: d-_eqgj5-K8
Keywords: physics, area, integral, accleration, slope
My Notes
--------
An object is moving at 5 m/s to the right.
velocity v is a vector
displacement s is a vector
Sal draws a graph 0:20
the velocity is constant
How far does it travel after 5 seconds?
v = s / delta t
v * delta t = s
5 m/s * 5 s = 25 m
this is exactly the area under the velocity curve in the graph 2:15
In general, if you plot the magnitude of the velocity, the area under the curve will be the displacement.
An example 2:50
acceleration = 1 m/s^2
Sal draws another graph
magnitude of initial velocity (initial speed) = 0
acceleration is the slope of the curve
a = delta v / delta t
the slope is constant because the acceleration is constant
How far does the object travel if it moves at constant acceleration for 5 seconds? 5:27
vi = 0, a is constant
Sal draws increasingly tiny rectangles under the curve (a diagonal line)
Can calculate the answer as the area of a triangle = 0.5 * base * height
displacement s = 0.5 * 5 seconds * 5 m/s = 12.5 meters
x axis is time
y axis is magnitude of the velocity
slope is the acceleration
area under the curve is the displacement
For this example, I will draw a chart using google or JFreeChart.
</Notes>
<script implName="lang:python:inline:"><![CDATA[
dt = 5.0 # delta t in seconds (base of a triangle)
dv = 5.0 # delta v in m/s (height of a triangle)
s = 0.5 * dt * dv # displacement in meters
print "displacement = " + str(s) + " meters"
# result: displacement = 12.5 meters
]]></script>
<script implName="lang:javascript:inline:"><![CDATA[
dt = 5.0; // delta t in seconds (base of a triangle)
dv = 5.0; // delta v in m/s (height of a triangle)
s = 0.5 * dt * dv; // displacement in meters
println("displacement = " + s + " meters");
//javascript:(function(){dt=5;dv=5;s=0.5 * dt * dv;alert("displacement = "+s+" meters");})()
// result: displacement = 12.5 meters
]]></script>
<_-.XholonClass>
<!-- domain objects -->
<PhysicalSystem/>
<Block/> <!-- the object that's moving -->
<!-- quantities -->
<Time superClass="Duration"/>
<Displacement superClass="Length"/>
</_-.XholonClass>
<xholonClassDetails>
<Block>
<port name="acceleration" connector="#xpointer(Acceleration)"/>
<port name="time" connector="#xpointer(Time)"/>
<port name="velocity" connector="#xpointer(Velocity)"/>
<port name="displacement" connector="#xpointer(Displacement)"/>
</Block>
<!-- Velocity will be graphed -->
<Velocity xhType="XhtypePurePassiveObject"/>
</xholonClassDetails>
<PhysicalSystem>
<Block>
<Acceleration>1.0 m/s^2</Acceleration>
<Time>0.0 s</Time>
<Velocity>0.0 m/s</Velocity>
<Displacement>0.0 m</Displacement>
<Blockbehavior implName="org.primordion.script.Behavior_javascript"><![CDATA[
var behaviorObject = new Object();
behaviorObject.postConfigure = function() {
var app = applicationKey;
app.setUseDataPlotter('JFreeChart'); // google JFreeChart
app.setDataPlotterParams('Graph of an object moving at constant acceleration,Time (s),||Velocity|| (m/s),./statistics/,stats,1,WRITE_AS_LONG');
app.createChart(contextNodeKey.getParentNode());
println(time.val + ',' + velocity.val + ',' + displacement.val);
}
behaviorObject.act = function() {
var dt = 1.0;
time.incVal(dt);
var dv = acceleration.val * dt;
// displacement is the total area under the curve
// = current displacement + a rectangular area due to velocity + a triangular area due to acceleration
displacement.setVal(displacement.val + (velocity.val * dt) + (dv * dt * 0.5));
velocity.incVal(dv);
println(time.val + ',' + velocity.val + ',' + displacement.val);
}]]></Blockbehavior>
</Block>
</PhysicalSystem>
<Blockbehavior implName="lang:python:inline:"><![CDATA[
# TODO
]]></Blockbehavior>
<Blockbehavior implName="lang:javascript:inline:"><![CDATA[
// TODO ?
]]></Blockbehavior>
<Blockbehavior implName="lang:bsh:inline:"><![CDATA[
// This works if pasted in as a last child of Block.
//height.incVal(0.02);
//System.out.print("Java/Beanshell wants something to do. Height:" + height + "\n");
]]></Blockbehavior>
<Blockbehavior implName="lang:jruby:inline:"><![CDATA[
#require 'java'
# This works if pasted in as a last child of Block.
#$height.incVal(0.02)
#puts "Ruby wants something to do. Height: #{$height}"
]]></Blockbehavior>
<Blockbehavior implName="lang:groovy:inline:"><![CDATA[
// This works if pasted in as a last child of Block.
//height.incVal(0.02);
//System.out.print("Groovy wants something to do. Height:" + height + "\n");
]]></Blockbehavior>
</XholonWorkbook>