[npl] / branches / UGA / 3.2.3a.pg Repository: Repository Listing bbplugincoursesdistsnplrochestersystemwww

# View of /branches/UGA/3.2.3a.pg

Sat Jul 24 17:09:50 2010 UTC (2 years, 10 months ago) by ted shifrin
File size: 2316 byte(s)
Log message

    1 ##DESCRIPTION
2 #
3
4 #
5 # Asks for the tangent plane to a surface.
6 #
7 ##ENDDESCRIPTION
8
9 ##KEYWORDS('Multivariable','Tangent Plane')
10
11 ## DBsubject('Calculus')
12 ## DBchapter('Partial Derivatives')
13 ## DBsection('Tangent Planes')
14 ## Date('9/7/2009')
15 ## Author('Shifrin')
16 ## Institution('UGA')
17
18
19 DOCUMENT();        # This should be the first executable line in the problem.
20
22   "PGstandard.pl",
23   "PGunion.pl",
24   "Parser.pl",
25   "alignedChoice.pl",
26   "PGcourse.pl",
28   "PGbasicmacros.pl",
29  );
30
31
32
34 #           "PGbasicmacros.pl",
35 #           "PGchoicemacros.pl",
37 #           "PGauxiliaryFunctions.pl");
38
39
40 TEXT(beginproblem());
41 BEGIN_PROBLEM();
42
43
44 Context("Numeric")->variables->are(x=>'Real',y=>'Real');
45 $showPartialCorrectAnswers = 1; 46 47$a = non_zero_random( -4, 4, 1 );
48 $aa = random(1,5,1); 49 do{$b = non_zero_random( -4, 4, 1 )} until ($b!=$a);
50 do{$bb = random(1,5,1)} until ($bb!=$aa); 51 do{$c = random( 1, 10, 1 )} until ($c**2 >$a**2+$b**2); 52$d = non_zero_random( -4, 4, 1 );
53
54 @func = ("e^($d x y)", "sqrt($c^2 - x^2 - y^2)", "sqrt($aa x^2+$bb y^2)",
55 "$a x^2+$b y^2");
56
57 @choice=NchooseK($#func,2); 58 @sub_func=@func[@choice]; 59 60 for ($k=0; $k<2;$k++){
61 $f[$k] = Formula("$sub_func[$k]")->reduce;
62 $fx[$k] = $f[$k]->D('x');
63 $fy[$k] = $f[$k]->D('y');
64 $evalf[$k] = $f[$k]->eval(x=>$a,y=>$b);
65 $evalfx[$k] = $fx[$k]->eval(x=>$a,y=>$b);
66 $evalfy[$k] = $fy[$k]->eval(x=>$a,y=>$b);}
67
68
69 $ans1x =$evalfx[0]->cmp; $ans1y =$evalfy[0]->cmp; $ans1z=$evalf[0]->cmp;
70 $ans2x =$evalfx[1]->cmp; $ans2y =$evalfy[1]->cmp; $ans2z=$evalf[1]->cmp;
71
72
73 Context()->texStrings;
74 BEGIN_TEXT
75
76 Let $$f(x,y) = f[0]$$.
77 Find the equation of the tangent plane of the graph $$z = f(x,y)$$ at the point $$\left( a, b, f(a,b) \right)$$.
78  $PAR 79 $$z =$$\{ans_rule(10)\}$$x +$$ \{ans_rule(10)\} $$y +$$ \{ans_rule(15)\}. 80$PAR
81 $PAR 82 Now let $$f(x,y) = f[1]$$. 83 Find the equation of the tangent plane of the graph $$z = f(x,y)$$ at the point $$\left( a, b, f(a,b) \right)$$. 84$PAR
85 $$z =$$\{ans_rule(10)\}$$x +$$ \{ans_rule(10)\} $$y +$$ \{ans_rule(15)\}.
86  $PAR 87$PAR
88
89 END_TEXT
90
91 ANS($ans1x); ANS($ans1y); ANS($ans1z); 92 ANS($ans2x); ANS($ans2y); ANS($ans2z);
93
94 END_PROBLEM();
95 ENDDOCUMENT();        # This should be the last executable line in the problem.