Fluids (part 1)
What a fluid is. Difference between liquids and gasses (both fluids).
<?xml version="1.0" encoding="UTF-8"?>
<!--Fri Jan 13 2012 23:23:51 GMT-0500 (EST)-->
<XholonWorkbook>
<Notes>
Khan Academy
------------
Title: Fluids (part 1)
Description: What a fluid is. Difference between liquids and gasses (both fluids).
Url: http://www.khanacademy.org/video/fluids--part-1?playlist=Physics
InternalName: fluids--part-1
YoutubeId: Pn5YEMwQb4Y
Keywords: physics, chemistry, fluids, liquids, gasses, pressure
My Notes
--------
This is the first physics video that is not about mechanics (as of Jan 2012).
I want to see if I can do the same type of coding exercises that I've been doing for mechanics.
A fluid is something that takes the shape of its container.
Example: a rubber sphere completely filled with water.
liquids and gases
A gas is compressible. A liquid is incompressible.
ex: balloon filled with gas or water
In this video, Sal concentrates on liquids.
Example
-------
container with two openings at the top, with areas A1 and A2
each opeing is a different size
fill the container with a liquid
work = force * distance
W = F * D
Win = Wout
Force in * Distance in = Force out * Distance out
Fi * Di = Fo * Do
push down on one of the openings in the container with a piston
with a force of F1
push it a distance of D1
How much water is displaced? Waht is the volume displaced?
= A1 * D1
The liquid has to push upwards at the other opening because it's incompressible.
the 2 volumes are the same
A1 * D1 = A2 * D2
</Notes>
<script implName="lang:python:inline:"><![CDATA[
a1 = 3.0 # m^2
d1 = 0.2 # m
v1 = a1 * d1 # m^3
a2 = 2.0 # m^2
v2 = v1 # the volume is the same for both openings
d2 = v2 / a2
print "d2 = " + str(d2)
# result: d2 = 0.3
]]></script>
<script implName="lang:javascript:inline:"><![CDATA[
var a1 = 3.0; // m^2
var d1 = 0.2; // m
var v1 = a1 * d1; // m^3
var a2 = 2.0; // m^2
var v2 = v1; // the volume is the same for both openings
var d2 = v2 / a2;
print("d2 = " + d2);
//javascript:(function(){var a1=3.0;var d1=0.2;var v1=a1*d1;var a2=2.0;var v2=v1;var d2=v2/a2;alert("d2 = "+d2);})()
// result: d2 = 0.30000000000000004
]]></script>
<_-.XholonClass>
<!-- domain objects -->
<PhysicalSystem/>
<CyclopsContainer/>
<Opening/>
<!-- quantities -->
<Distance superClass="Length"/>
</_-.XholonClass>
<xholonClassDetails>
<Opening>
<port name="area" connector="#xpointer(Area)"/>
<port name="distance" connector="#xpointer(Distance)"/>
<port name="volume" connector="#xpointer(Volume)"/>
</Opening>
</xholonClassDetails>
<PhysicalSystem>
<CyclopsContainer>
<Opening roleName="leftside">
<Area>3.0 m^2</Area>
<Distance>0.2 m</Distance>
<Volume>0.0 m^3</Volume>
</Opening>
<Opening roleName="rightside">
<Area>2.0 m^2</Area>
<Distance>0.0 m</Distance>
<Volume>0.0 m^3</Volume>
</Opening>
<SvgClient>
<Attribute_String roleName="setup">${MODELNAME_DEFAULT},http://upload.wikimedia.org/wikipedia/commons/6/69/Round_bottom_flasks_en_2.svg</Attribute_String>
</SvgClient>
</CyclopsContainer>
</PhysicalSystem>
<Blockbehavior implName="lang:python:inline:"><![CDATA[
# TODO
]]></Blockbehavior>
<Openingbehavior implName="lang:javascript:inline:"><![CDATA[
if (contextNodeKey.roleName == "leftside") {
volume.setVal(area.val * distance.val);
}
else {
volume.setVal(contextNodeKey.getXPath().evaluate("../Opening[@roleName='leftside']/Volume", contextNodeKey).val);
distance.setVal(volume.val / area.val);
}
]]></Openingbehavior>
<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>