WeBWorK Problems

"BEGIN_PGML_SOLUTION" is causing errors

"BEGIN_PGML_SOLUTION" is causing errors

by tim Payer -
Number of replies: 2


Hello, I am writing solutions to problem sets and have been using the previous standard of BEGIN_SOLUTION, END_SOLUTION but when I try to use the new from of BEGIN_PGML_SOLUTION, END_PGML_SOLUTION, format for solutions I have encountered an error. 

Can you see where there is a problem here? I only entered a single line of text to begin the solution but it is this part of problem that is the source of the error even if the error message points to line 44.

Any help is most appreciated. Thanks,  Tim

       Problem11
ERROR caught by Translator while processing problem file:tmpEdit/Payer/M105_HW_16/Fish_harvest11.pg.tim.payer.tmp
****************
ERRORS from evaluating PG file: 
Undefined subroutine &PGML::Format2 called at line 44 of (eval 12289)
****************
------Input Read 1 ## DBsubject(Calculus - single variable) 2 ## DBchapter(Applications of differentiation) 3 ## DBsection(Rates of change - natural and social sciences) 4 ## Institution(UCSB) 5 ## Level(5) 6 ## Static(1) 7 ## TitleText1('Calculus: Early Transcendentals') 8 ## AuthorText1('Stewart') 9 ## EditionText1('5') 10 ## Section1('3.3') 11 ## Problem1('34') 12 ## KEYWORDS('Product','Quotient','Differentiation') 13 ## Library/UCSB/Stewart5_3_3/Stewart5_3_3_34 14 15 DOCUMENT(); 16 17 loadMacros( 18 "PG.pl", 19 "PGbasicmacros.pl", 20 "PGchoicemacros.pl", 21 "PGanswermacros.pl", 22 "PGauxiliaryFunctions.pl" 23 ); 24 25 TEXT(&beginproblem); 26 $showPartialCorrectAnswers = 1; 27 $a=random(72,90,1); 28 29 BEGIN_TEXT 30 31 $PAR 32 33 In a fish farm, a population of fish is introduced into a pond and is harvested regularly. A model for the rate of change of the fish population is given by the equation 34 \(\displaystyle \frac{dP}{dt}= r_0 \left(1-\frac{P(t)}{P_c}\right) P(t)-\beta P(t)\), where \(r_0\) is the birth rate of the fish, \(P_c\) is the maximum population that the pond can sustain, and \(\beta\) is the percentage of the population that can be harvested.$PAR 35 36 (a) What value of \(dP/dt\) corresponds to a stable population? $BR 37 (b) If the pond can sustain 10,000 fish, the birth rate is 5 percent and the harvesting rare is 4 percent, find the stable population level. 38 39 $PAR 40 41 (a)\{ans_rule(20)\} $BR 42 (b)\{ans_rule(20)\} 43 44 END_TEXT 45 46 ANS(num_cmp(0)); 47 ANS(num_cmp(2000)); 48 49 BEGIN_PGML_SOLUTION 50 *SOLUTION* 51 52 * We must take the derivative and set it equal to zero to solve for [`t`], the critical point that occurs at the time of maximum concentration for the drug. 53 54 55 END_PGML_SOLUTION 56 57 58 ENDDOCUMENT();

In reply to tim Payer

Re: "BEGIN_PGML_SOLUTION" is causing errors

by tim Payer -
NEVER MIND,

I SEE the error of my ways, 

PGML solutions are only appropriate for PGML problems, not PG problems...

Thanks,  Tim
In reply to tim Payer

Re: "BEGIN_PGML_SOLUTION" is causing errors

by Davide Cervone -
You can use PGML solutions with PG problems, but you do need to include the "PGML.pl" file in your loadMacros() call.