@@ -28,17 +28,15 @@ loadMacros(
2828 "PGstandard.pl",
2929 "MathObjects.pl",
3030 "littleneck.pl",
31- "contextFraction.pl",
3231 "PGcourse.pl"
3332);
3433#--
3534rand_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");
7773TEXT(beginproblem());
7874#
7975# Strings in Tex form (formula)
8076#
81- $CT ->texStrings;
77+ Context() ->texStrings;
8278BEGIN_TEXT
8379Using 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
8985END_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
114110After separating and writing in differential form, the equation becomes,
115- \[ \small{ $Dform} . \]
111+ \[ $Dform. \]
116112Integrating on both sides yields,
117- \[ \small{ $Afterint} . \]
113+ \[ $Afterint. \]
118114Applying the natural logarithm to each side we get,
119- \[ \small{ y = $Solutiondisp} . \]
115+ \[ y = $Solutiondisp. \]
120116$PAR
121117END_SOLUTION
122- $CT ->normalStrings;
118+ Context() ->normalStrings;
123119ENDDOCUMENT();
0 commit comments