[npl] / branches / UWSP / SS4e / Chapter_02 / Section_07 / SS4e_02_07_027.pg Repository: Repository Listing bbplugincoursesdistsnplrochestersystemwww

# View of /branches/UWSP/SS4e/Chapter_02/Section_07/SS4e_02_07_027.pg

Tue Nov 1 02:43:54 2011 UTC (19 months, 2 weeks ago) by nwodarz
File size: 2708 byte(s)
`Importing Section 2.7 files`

```    1 ##DESCRIPTION
2 ##   Mathematical modeling -- distance and constant velocity
3 ##ENDDESCRIPTION
4
5 ##KEYWORDS('modeling','optimization')
6
7 ## DBsubject('Algebra')
8 ## DBchapter('Functions')
9 ## DBsection('Modeling with Functions')
10 ## Author('Nathan Wodarz')
11 ## Institution('UWSP')
12 ## TitleText1('Precalculus Enhanced with Graphing Utilities')
13 ## EditionText1('4')
14 ## AuthorText1('Sullivan, Sullivan')
15 ## Section1('2.7')
16 ## Problem1('27')
17 #
18 # First comes some stuff that appears at the beginning of every problem
19 #
20
21 DOCUMENT();        # This should be the first executable line in the problem.
22
24 # Always call these
25 "PGstandard.pl",
26 "MathObjects.pl",
27 "PGcourse.pl",
28 "PGunion.pl",
29 # Extra calls for this problem
30 "parserNumberWithUnits.pl",
31 "parserFormulaWithUnits.pl",
32 );
33
34 TEXT(&beginproblem);
36
37 do {
38   \$dist_1 = random(2,10,1);
39   \$dist_2 = random(2,10,1);
40
41   \$speed_1 = random(25,70,5);
42   \$speed_2 = random(25,70,5);
43
44   \$min = 60*(\$dist_1*\$speed_1 + \$dist_2*\$speed_2)/(\$speed_1**2 + \$speed_2**2);
45 } until (int(10*\$min) != 10*\$min);
46 # Don't want to give too easy a problem to some students, so we require at
47 #  least two decimal places in the answer.
48
49 Context()->variables->are(t=>'Real');
50
51 \$dist = Formula("sqrt((\$dist_1 - \$speed_1 t/60)^2 + (\$dist_2 - \$speed_2 t/60)^2) ")->reduce;
52
53 \$min_d = \$dist->eval(t=>\$min);
54
55
56 ###################################
57 # Main text
58
59 Context()->texStrings;
60
61 BEGIN_TEXT
62 Two cars are approaching an intersection. One is \$dist_1 miles south of the intersection and is moving at a constant speed of \$speed_1 miles per hour. At the same time, the other car is \$dist_2 miles east of the intersection and is moving at a constant speed of \$speed_2 miles per hour.\$PAR
63 Express the distance \(d\) between the cars as a function of time \(t\) in minutes. \(d(t) = \) \{ans_rule(30)\} (Use appropriate \{helpLink('units')\})\$PAR
64 Use a graphing utility to graph \(d = d(t)\). For what value of \(t\) is \(d\) smallest? \(t = \) \{ans_rule(10)\} (Use appropriate \{helpLink('units')\})\$PAR
65 How far apart are the cars when \(d\) is smallest? \(d = \) \{ans_rule(10)\} (Use appropriate \{helpLink('units')\})\$PAR
66 END_TEXT
67 Context()->normalStrings;
68
69 Context()->texStrings;
70 BEGIN_HINT
71 At \(t = 0\), the cars are \$dist_1 miles south and \$dist_2 miles east of the intersection, respectively.\$PAR
72 Be sure to convert hours to minutes.
73 END_HINT
74 Context()->normalStrings;
75
76 ###################################