Skip to content

Commit 8a53e0c

Browse files
committed
Fix bug 4752 (?)
Could not reproduce error but adding parentheses may help.
1 parent 6d9c3f8 commit 8a53e0c

File tree

1 file changed

+13
-17
lines changed

1 file changed

+13
-17
lines changed

OpenProblemLibrary/Wiley/setAnton_Section_8.2/Question7.pg

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -28,17 +28,15 @@ loadMacros(
2828
"PGstandard.pl",
2929
"MathObjects.pl",
3030
"littleneck.pl",
31-
"contextFraction.pl",
3231
"PGcourse.pl"
3332
);
3433
#--
3534
rand_button();
3635
#
3736
# Set Up - Set up variable context and formulation of problem
3837
#
39-
$CT = Context("Numeric");
40-
$CT->variables->add(y=>'Real', dy=>'Real', dx=>'Real', C=>'Real', c=>'Real');
41-
Parser::Numbers::NoDecimals;
38+
Context("Numeric");
39+
Context()->variables->add(y=>'Real', dy=>'Real', dx=>'Real', C=>'Real', c=>'Real');
4240
#*********************************************************************************
4341
# e^(-y) f(x) + y' g(x) = 0,
4442
# Separable ==> f(x)/g(x) dx = -e^y dy
@@ -62,8 +60,7 @@ $Fx = $Fs[$idx];
6260
$Gx = $Gs[$idx];
6361
$Solution1 = Formula("$Sol1[$idx]");
6462
$Solution2 = Formula("$Sol2[$idx]");
65-
$CT->flags->set(showExtraParens=>0);
66-
$Diffeq = Formula("e^(-y)*$Fx + dy/dx*$Gx")->reduce;
63+
$Diffeq = Formula("e^(-y)*($Fx) + dy/dx*($Gx)")->reduce;
6764
#*******************
6865
# Display stuff
6966
#*******************
@@ -73,24 +70,23 @@ $Solutiondisp = $SolTex[$idx];
7370
#***********************
7471
# Problem Statement
7572
#***********************
76-
$CT = Context("Numeric");
7773
TEXT(beginproblem());
7874
#
7975
# Strings in Tex form (formula)
8076
#
81-
$CT->texStrings;
77+
Context()->texStrings;
8278
BEGIN_TEXT
8379
Using separation of variables, solve the differential equation,
8480
\[ $Diffeq = 0. \]
85-
Use $BITALIC $BBOLD C $EBOLD $EITALIC to represent the arbitrary constant.
81+
Use $BBOLD C $EBOLD to represent the arbitrary constant.
8682
$PAR
87-
\(\small{y}\) = \{ ans_rule(30) \}
83+
\(y\) = \{ ans_rule(30) \}
8884
$PAR
8985
END_TEXT
9086
#
9187
# Expect strings in standard form
9288
#
93-
$CT->normalStrings;
89+
Context()->normalStrings;
9490
# *******************************
9591
# Answer and Solution section
9692
# *******************************
@@ -108,16 +104,16 @@ ANS( $Solution1->cmp( checker=>sub
108104
#***************************
109105
# Explanation of solution
110106
#***************************
111-
$CT->texStrings;
112-
SOLUTION(EV3(<<'END_SOLUTION'));
107+
Context()->texStrings;
108+
BEGIN_SOLUTION
113109
$PAR SOLUTION $PAR
114110
After separating and writing in differential form, the equation becomes,
115-
\[ \small{$Dform}. \]
111+
\[ $Dform. \]
116112
Integrating on both sides yields,
117-
\[ \small{$Afterint}. \]
113+
\[ $Afterint. \]
118114
Applying the natural logarithm to each side we get,
119-
\[ \small{y = $Solutiondisp}. \]
115+
\[ y = $Solutiondisp. \]
120116
$PAR
121117
END_SOLUTION
122-
$CT->normalStrings;
118+
Context()->normalStrings;
123119
ENDDOCUMENT();

0 commit comments

Comments
 (0)