Acceleration
Calculating the acceleration of a Porshe
<?xml version="1.0" encoding="UTF-8"?>
<!--Xholon Workbook http://www.primordion.com/Xholon/wb/ Mon Feb 27 2012 22:41:30 GMT-0500 (EST)-->
<XholonWorkbook>
<Notes><![CDATA[
Khan Academy
------------
Title: Acceleration
Description: Calculating the acceleration of a Porshe
Url: http://www.khanacademy.org/video/acceleration?playlist=Physics
InternalName: acceleration
YoutubeId: FOkQszg1-j8
Keywords: physics, kinematics
My Notes
--------
see code
]]></Notes>
<script implName="lang:python:inline:"><![CDATA[
changeInVelocity = 60.0
direction = "East"
changeInTime = 3.0
acceleration = changeInVelocity / changeInTime
print str(acceleration) + " m/s^2 to the " + str(direction)
# http://ideone.com/4Y0ot
# result: 20.0 m/s^2 to the East
]]></script>
<script implName="lang:javascript:inline:"><![CDATA[
var changeInVelocity = 60.0;
var direction = "East";
var changeInTime = 3.0;
var acceleration = changeInVelocity / changeInTime;
println(acceleration + " m/s^2 to the " + direction);
//javascript:(function(){changeInVelocity = 60.0;var direction = "East";var changeInTime = 3.0;var acceleration = changeInVelocity / changeInTime;alert(acceleration + " m/s^2 to the " + direction);})()
]]></script>
<_-.XholonClass>
<!-- domain objects -->
<PhysicalSystem/>
<Car/>
<!-- quantities -->
<ChangeInVelocity superClass="Velocity"/>
<ChangeInTime superClass="Duration"/>
</_-.XholonClass>
<xholonClassDetails>
<Car>
<port name="changeInVelocity" connector="#xpointer(ChangeInVelocity)"/>
<port name="changeInTime" connector="#xpointer(ChangeInTime)"/>
<port name="acceleration" connector="#xpointer(Acceleration)"/>
</Car>
</xholonClassDetails>
<PhysicalSystem>
<Car roleName="Porsche 911">
<ChangeInVelocity>60.0 mph</ChangeInVelocity>
<Attribute_String roleName="direction">East</Attribute_String>
<ChangeInTime>3.0 s</ChangeInTime>
<Acceleration>0.0 (mph)/s</Acceleration>
</Car>
</PhysicalSystem>
<Carbehavior implName="lang:python:inline:"><![CDATA[
# TODO
]]></Carbehavior>
<Carbehavior implName="lang:javascript:inline:"><![CDATA[
acceleration.setVal(changeInVelocity.val / changeInTime.val);
println(acceleration.val + " m/s^2 to the " + direction.val);
]]></Carbehavior>
<Carbehavior implName="lang:webEditionjs:inline:"><![CDATA[
this.bindPorts(this.parent());
this.acceleration.attr('val', (this.changeInVelocity.attr('val') / this.changeInTime.attr('val')));
print('\n' + this.acceleration.attr('val') + ' m/s^2');
]]></Carbehavior>
<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>
<SvgClient><Attribute_String roleName="svgUri"><![CDATA[data:image/svg+xml,
]]></Attribute_String><Attribute_String roleName="setup">${MODELNAME_DEFAULT},${SVGURI_DEFAULT}</Attribute_String></SvgClient>
</XholonWorkbook>