Annotation of loncom/homework/templates/functionplotone.problem, revision 1.3
1.1 www 1: <problem>
2: <script type="loncapa/perl">$maxacc=&random(3,5,1);
1.2 www 3: $maxbraketime=&random(6,10,2);
4: $wait=&random(2,4,1);</script>
1.1 www 5: <startouttext />
1.2 www 6: At t=0 s, a car cruises at a constant positive velocity. Suddenly, a light switches to red. At t=$maxbraketime s, the driver is maximum on the brake. The car then stops in front of the red light for over $wait seconds. Eventually, it drives off, and then again cruises at a constant velocity. The car cannot accelerate with more than $maxacc m/s<sup>2</sup>.<br />
7: Provide a graph of its acceleration as a function of time.<br /> <endouttext />
1.1 www 8: <functionplotresponse xaxisvisible="yes" xlabel="t [s]" gridvisible="yes" ylabel="a(t) [m/s^2]" id="11" xmax="30" yaxisvisible="yes" xmin="-4" ymin="-8" ymax="8">
1.3 ! www 9: <functionplotelements>
1.1 www 10: <spline initx="-2" inity="0" index="A" order="8" scalex="28" />
1.3 ! www 11: </functionplotelements>
! 12: <functionplotruleset>
1.2 www 13: <functionplotrule relationship="eq" xinitiallabel="start" xfinallabel="brake" value="0" derivativeorder="0" percenterror="1" minimumlength="1" />
14: <functionplotrule relationship="eq" xinitial="0" value="0" derivativeorder="0" percenterror="1" />
15: <functionplotrule relationship="lt" xinitiallabel="brake" xfinallabel="stop" value="-0.1" derivativeorder="0" />
16: <functionplotrule relationship="eq" xinitial="$maxbraketime" value="0" derivativeorder="1" percenterror="40" />
17: <functionplotrule relationship="eq" xinitiallabel="stop" xfinallabel="driveoff" value="0" derivativeorder="0" percenterror="1" minimumlength="$wait" />
18: <functionplotrule relationship="gt" xinitiallabel="driveoff" xfinallabel="cruise" value="0.1" derivativeorder="0" />
19: <functionplotrule relationship="le" xinitiallabel="driveoff" xfinallabel="cruise" value="$maxacc" derivativeorder="0" />
20: <functionplotrule relationship="eq" xinitiallabel="cruise" xfinallabel="end" value="0" derivativeorder="0" percenterror="1" minimumlength="1" />
1.3 ! www 21: </functionplotruleset>
1.1 www 22: </functionplotresponse>
23: </problem>
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>