[npl] / branches / UGA / 3.2.2.pg Repository:
ViewVC logotype

Annotation of /branches/UGA/3.2.2.pg

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1457 - (view) (download)

1 : ted shifri 1457 ## DESCRIPTION
2 :     ## Calculating directional derivative
3 :     ## ENDDESCRIPTION
4 :    
5 :     ## KEYWORDS('Directional Derivative', 'homogeneous function')
6 :     ##
7 :    
8 :     ## DBsubject('Calculus')
9 :     ## DBchapter('')
10 :     ## DBsection('')
11 :     ## Date('8/22/2009')
12 :     ## Author('Ted Shifrin')
13 :     ## Institution('UGA')
14 :     ## TitleText1('')
15 :     ## EditionText1('')
16 :     ## AuthorText1('')
17 :     ## Section1('')
18 :     ## Problem1('')
19 :    
20 :     DOCUMENT(); # This should be the first executable line in the problem.
21 :    
22 :     loadMacros("PG.pl",
23 :     "PGbasicmacros.pl",
24 :     "PGchoicemacros.pl",
25 :     "PGanswermacros.pl",
26 :     "PGauxiliaryFunctions.pl",
27 :     "PGstandard.pl",
28 :     "PGunion.pl",
29 :     "Parser.pl",
30 :     "MathObjects.pl"
31 :     );
32 :    
33 :    
34 :     TEXT(beginproblem());
35 :     BEGIN_PROBLEM();
36 :    
37 :     ##############################################
38 :     # Setup
39 :    
40 :     Context("Vector")->variables->are(
41 :     x=>'Real', y=>'Real',
42 :     );
43 :    
44 :     TEXT(beginproblem());
45 :     $showPartialCorrectAnswers = 1;
46 :    
47 :     $a = non_zero_random(-3, 3, 1);
48 :     do{$b = non_zero_random(-3, 3, 1)} until $b!=$a;
49 :     $c = random(3,6,1);
50 :     $d = $c-2;
51 :     $e = non_zero_random(-2,2,1);
52 :     $f = non_zero_random(-2,2,1);
53 :     do{$k = non_zero_random(-5,5,1)} until ($k!=$a and $k!=$b);
54 :     $F = Formula("($a x^$c+$b y^$c)/(x^2+y^2)")->reduce;
55 :     $Feval = $F->eval(x=>$e,y=>$f);
56 :    
57 :     $arg = '\left(\begin{array}{c} x\\y \end{array}\right)';
58 :     $P = ColumnVector($e,$f);
59 :    
60 :     $ans = $k*$d*$Feval;
61 :    
62 :     Context()->texStrings;
63 :    
64 :     if ($k==1) {$kk = "";}
65 :     else {
66 :     if ($k==-1) {$kk = "-";}
67 :     else {$kk = $k;}}
68 :    
69 :    
70 :     BEGIN_TEXT
71 :     Let \(f $arg = \displaystyle $F\ \) and \(\ \mathbf a = $P \).
72 :     Find the directional derivative \(D_{$kk \mathbf a}f(\mathbf a)\). $BR
73 :    
74 :     \{ans_rule(10)\} $BR
75 :    
76 :     END_TEXT
77 :    
78 :     ANS(num_cmp($ans));
79 :    
80 :    
81 :    
82 :    
83 :     ENDDOCUMENT(); # This should be the last executable line in the problem.

aubreyja at gmail dot com
ViewVC Help
Powered by ViewVC 1.0.9