Parent Directory
|
Revision Log
Cleaned problem code using convert-functions.pl
1 ## DESCRIPTION 2 ## Compute div and curl 3 ## ENDDESCRIPTION 4 5 ## KEYWORDS('Vector Fields', 'Curl', 'Div') 6 ## Tagged by nhamblet 7 8 ## DBsubject('Calculus') 9 ## DBchapter('Vector Calculus') 10 ## DBsection('Curl and Divergence') 11 ## Date('') 12 ## Author('') 13 ## Institution('ASU') 14 ## TitleText1('Calculus') 15 ## EditionText1('') 16 ## AuthorText1('Stewart') 17 ## Section1('16.5') 18 ## Problem1('') 19 20 DOCUMENT(); 21 loadMacros("PG.pl", 22 "PGbasicmacros.pl", 23 "PGchoicemacros.pl", 24 "PGanswermacros.pl", 25 "PGauxiliaryFunctions.pl", 26 "PGgraphmacros.pl", 27 "Dartmouthmacros.pl"); 28 29 30 ## Do NOT show partial correct answers 31 $showPartialCorrectAnswers = 1; 32 33 ## Lots of set up goes here 34 $a = random(-9,9,1); 35 $a_yz = clean_scalar_string($a, "yz"); 36 37 $b = random(-9,9,1); 38 $b_xz = clean_scalar_string($b, "xz"); 39 40 $c = random(-9,9,1); 41 $c_xy = clean_scalar_string($c, "xy"); 42 43 $aa = random(-9,9,1); 44 $aa_x2 = clean_scalar_string($aa, "x^2"); 45 46 $bb = random(-9,9,1); 47 $bb_xpy2 = clean_scalar_string($bb, "(x+y)^2"); 48 49 $cc = random(-9,9,1); 50 $cc_xpypz2 = clean_scalar_string($cc, "(x+y+z)^2"); 51 52 ## Ok, we are ready to begin the problem... 53 ## 54 TEXT(beginproblem()); 55 56 57 BEGIN_TEXT 58 $BR A) $BR 59 Consider the vector field 60 \( F(x,y,z) = ($a_yz, $b_xz, $c_xy) \). 61 $BR 62 Find the divergence and curl of \(F \). 63 $BR 64 \( \textrm{div}(F) = \nabla \cdot F = \) \{ans_rule(20)\}. 65 $BR 66 \( \textrm{curl}(F) = \nabla \times F = (\) 67 \{ans_rule(20)\}, \{ans_rule(20)\},\{ans_rule(20)\}\()\). 68 69 $PAR 70 $BR B) $BR 71 Consider the vector field 72 \( F(x,y,z) = ($aa_x2, $bb_xpy2, $cc_xpypz2) \). 73 $BR 74 Find the divergence and curl of \(F \). 75 $BR 76 \( \textrm{div}(F) = \nabla \cdot F = \) \{ans_rule(20)\}. 77 $BR 78 \( \textrm{curl}(F) = \nabla \times F = (\) 79 \{ans_rule(20)\}, \{ans_rule(20)\},\{ans_rule(20)\}\()\). 80 81 END_TEXT 82 83 ANS(num_cmp(0)); 84 ANS(fun_cmp("($c - $b)*x", vars=>3)); 85 ANS(fun_cmp("($a - $c)*y", vars=>3)); 86 ANS(fun_cmp("($b - $a)*z", vars=>3)); 87 88 ANS(fun_cmp("2*$aa*x + 2*$bb*(x+y) + 2*$cc*(x+y+z)", vars=>3)); 89 ANS(fun_cmp("2*$cc*(x+y+z)", vars=>3)); 90 ANS(fun_cmp("-2*$cc*(x+y+z)", vars=>3)); 91 ANS(fun_cmp("2*$bb*(x+y)", vars=>3)); 92 ENDDOCUMENT(); 93 94 95 96
| aubreyja at gmail dot com | ViewVC Help |
| Powered by ViewVC 1.0.9 |