File:  [LON-CAPA] / loncom / homework / templates / functionplotvector.problem
Revision 1.1: download - view: text, annotated - select for diffs
Sat Nov 26 02:12:45 2011 UTC (12 years, 5 months ago) by www
Branches: MAIN
CVS tags: loncapaMITrelate, language_hyphenation_merge, language_hyphenation, HEAD, BZ4492-merge, BZ4492-feature_horizontal_radioresponse, BZ4492-feature_Support_horizontal_radioresponse, BZ4492-Support_horizontal_radioresponse
Function Plot with Vectors Template

<problem>
<script type="loncapa/perl">$slope=&random(0.5,0.8,0.1);
$function="2+$slope*x";
$massx=&random(3.5,6.5,0.1);
$massy=2.1+$slope*$massx;
$angle=180.*atan($slope)/$pi;
$perp=$angle+90.;</script>
<startouttext />
A mass is sliding down the indicated incline with a constant velocity. Construct the free body diagram, making sure the forces are approximately proportionally correct. Leave unused vectors unattached.<br /> <endouttext />
<functionplotresponse xaxisvisible="no" xlabel="x" gridvisible="yes" ylabel="y" id="11" xmax="10" yaxisvisible="no" xmin="0" ymin="0" ymax="10" width="450" height="450">
<functionplotelements>

<backgroundplot function="$function" fixed="yes" />
<plotobject label="Mass" x="$massx" y="$massy" />
<plotvector label="Gravity" tailx="6" taily="1" tipx="9" tipy="1" />
<plotvector label="KineticFriction" tailx="6" taily="2" tipx="9" tipy="2" />
<plotvector label="StaticFriction" tailx="6" taily="3" tipx="9" tipy="3" />
<plotvector label="NormalForce" tailx="6" taily="4" tipx="9" tipy="4" />

</functionplotelements>
<functionplotruleset>
<functionplotvectorrule index="Grav" vector="Gravity" attachpoint="Mass" angle="270" angleerror="2" />
<functionplotvectorrule index="Norm" vector="NormalForce" attachpoint="Mass" angle="$perp" angleerror="3" />
<functionplotvectorrule index="KFriction" vector="KineticFriction" attachpoint="Mass" angle="$angle" angleerror="2" />
<functionplotvectorrule index="SFriction" vector="StaticFriction" notattachpoint="Mass" />
<functionplotvectorsumrule vectors="Gravity,NormalForce,KineticFriction" length="0" lengtherror="1" index="Total" />
</functionplotruleset>
<hintgroup showoncorrect="no">
    
<hintpart on="Grav">
    <startouttext />Gravity acts on the mass and points straight down.<endouttext />
</hintpart>
<hintpart on="SFriction">
    <startouttext />The mass is sliding.<endouttext />
</hintpart>
<hintpart on="Total">
    <startouttext />What should be the net force on the mass?<endouttext />
</hintpart>
</hintgroup>
</functionplotresponse>
</problem>

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>