Skip to content

Instantly share code, notes, and snippets.

@kenwebb
Created February 13, 2012 19:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kenwebb/1819233 to your computer and use it in GitHub Desktop.
Save kenwebb/1819233 to your computer and use it in GitHub Desktop.
Newton's Second Law of Motion
<?xml version="1.0" encoding="UTF-8"?>
<!--Xholon Workbook http://www.primordion.com/Xholon/wb/ (C) Ken Webb Mon Feb 13 2012 14:16:08 GMT-0500 (EST)-->
<XholonWorkbook>
<Notes><![CDATA[
Khan Academy
------------
Title: Newton's Second Law of Motion
Description: Newton's Second Law of Motion: F=ma
Url: http://www.khanacademy.org/video/newton-s-second-law-of-motion?playlist=Physics
InternalName: newton-s-second-law-of-motion
YoutubeId: ou9YMWlJgkE
Keywords: physics, newton, 2nd, second, law
My Notes
--------
- the constant velocity from the first law could be 0
- how does a net force effect a constant velocity?
the 2nd law
F = m * a
- where F is a force, m is a mass, and a is an acceleration
- acceleration is a vector
- force is a vector
example
- a Brick floating in Space
- if you apply a net force to one side of the Brick (which might be a sum of several forces),
then there will be a net acceleration in the same direction
- a is proportional to F
- the constant of proportionality is the object's mass
- Note: weight is a force, while mass says how much stuff there is
- unit of force is a "Newton" N = kg * m / s^2
a problem
- Brick with a mass of 2 kg
- F is 10 N to the right
- what is the acceleration?
- if the force doubles, then the acceleration doubles
- this is part of Sal's example, so it could be part of a code example
- also, if you double the mass, then the acceleration will be only half
]]></Notes>
<script implName="lang:python:inline:"><![CDATA[
# http://ideone.com/r92n6
m = 2
f = 10
a = f / m
print "a = " str(a) " meters per second squared"
]]></script>
<script implName="lang:javascript:inline:"><![CDATA[
// sequential code
m = 2; // mass in kg
f = 10; // force F in N
a = f / m; // acceleration in m/s^2
print("a = " a " meters per second squared");
// a function, that can be pasted into the browser address bar
// try doubling the force, and then doubling the mass, as mentioned by Sal
//javascript:(function(m,f){a=f/m;alert("a=" a "m/s^2");})(2.0,10.0)
]]></script>
<_-.XholonClass>
<!-- domain objects -->
<PhysicalSystem/>
<Brick/>
</_-.XholonClass>
<xholonClassDetails>
<Brick>
<port name="m" connector="#xpointer(Mass)"/>
<port name="f" connector="#xpointer(Force)"/>
<port name="a" connector="#xpointer(Acceleration)"/>
</Brick>
</xholonClassDetails>
<PhysicalSystem roleName="space">
<!-- 2 bricks -->
<Brick roleName="scalar">
<!-- scalar version, where the direction is assumed to be in the positive x direction (to the right) -->
<Mass>2.0 kg</Mass>
<Force>10.0 N</Force>
<Acceleration>0.0 m/s^2</Acceleration>
</Brick>
<Brick roleName="2D vector">
<!-- 2D vector version with x and y components (Sal said that a and F are vectors) -->
<Mass>2.0 kg</Mass>
<Force>10.0 0.0 N</Force>
<Acceleration>0.0 0.0 m/s^2</Acceleration>
</Brick>
</PhysicalSystem>
<Blockbehavior implName="lang:python:inline:"><![CDATA[
# TODO
]]></Blockbehavior>
<Brickbehavior implName="lang:javascript:inline:"><![CDATA[
// paste in as a last child of either the scalar or 2D vector Brick
if (contextNodeKey.roleName == "scalar") {
a.setVal(f.val / m.val);
println(a);
}
else { // vector
var magnitudeA = f.val / m.val;
a.setVal("" magnitudeA " 0.0 " a.unit);
println(a);
}
]]></Brickbehavior>
<Blockbehavior implName="lang:bsh:inline:"><![CDATA[
// TODO
]]></Blockbehavior>
<Blockbehavior implName="lang:jruby:inline:"><![CDATA[
# TODO
]]></Blockbehavior>
<Blockbehavior implName="lang:groovy:inline:"><![CDATA[
// TODO
]]></Blockbehavior>
<SvgClient><Attribute_String roleName="svgUri"><![CDATA[data:image/svg xml,
]]></Attribute_String><Attribute_String roleName="setup">${MODELNAME_DEFAULT},${SVGURI_DEFAULT}</Attribute_String></SvgClient>
</XholonWorkbook>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment