Skip to content

Commit 77c3818

Browse files
committed
Update with math objects
1 parent 95cffda commit 77c3818

File tree

1 file changed

+19
-18
lines changed
  • OpenProblemLibrary/Utah/Calculus_II/set14_Differential_Equations

1 file changed

+19
-18
lines changed

OpenProblemLibrary/Utah/Calculus_II/set14_Differential_Equations/set14_pr6.pg

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
## Institution(Univeristy of Utah)
77
## Author(Utah ww group)
88
## Level(5)
9+
## MO(1)
910
## Static(1)
1011
## TitleText1('Calculus')
1112
## AuthorText1('Dale Varberg, Edwin J. Purcell, and Steve E. Rigdon')
@@ -18,46 +19,46 @@ DOCUMENT(); # This should be the first executable line in the problem.
1819

1920
loadMacros(
2021
"PGstandard.pl",
21-
"PGchoicemacros.pl",
22+
"MathObjects.pl",
2223
"PGcourse.pl"
2324
);
2425

2526
TEXT( beginproblem() );
2627

2728
$showPartialCorrectAnswers = 1;
2829

29-
$pi = 3.141592654;
30-
$ans1 = "(1/12)*cos(40*sqrt(2)*t)";
31-
$ans2 = 1;
32-
$ans3 = 2*$pi/40/sqrt(2);
30+
Context("Numeric");
31+
Context()->variables->are(t=>'Real');
3332

33+
34+
$ans1 = Compute("(1/12)*cos(40*sqrt(2)*t)");
35+
$ans2 = Real(1);
36+
$ans3 = Compute("2*pi/(40*sqrt(2))");
37+
38+
Context()->texStrings;
3439
BEGIN_TEXT
3540

3641
A spring with a spring constant \(k\) of 100 pounds per foot
3742
is loaded with 1-pound weight and brought to equilibrium. It
3843
is then stretched an additional 1 inch and released. Find
3944
the equation of motion, the amplitude, and the period. Neglect
40-
friction. Then
41-
42-
$BR
43-
$BR
45+
friction.
4446

47+
$PAR
48+
The displacement \(y\), in feet from equilibrium is
4549
\( y(t) = \) \{ans_rule(80)\} $BR
46-
where \(t\) is time in (seconds) and \(y(t)\) is displacement (in feet).
47-
$BR
48-
$BR
50+
where \(t\) is time in seconds since the spring was released, and the initial 1 in. stretch is regarded as a positive displacement.
51+
$PAR
4952

5053
Amplitude: \{ans_rule(15)\} inch(es) $BR
5154

5255
Period: \{ans_rule(15)\} second(s).
5356

5457
END_TEXT
58+
Context()->normalStrings;
5559

56-
#Answer: \( y(x) = C_{1} \) \{NAME_ANS_RULE(second_answer,25)\} \( + C_{2} \) \{NAMED_ANS_RULE(answer_rule,25)\}.
57-
58-
59-
ANS(fun_cmp($ans1, vars=>"t"));
60-
ANS(num_cmp($ans2));
61-
ANS(num_cmp($ans3));
60+
ANS($ans1->cmp());
61+
ANS($ans2->cmp());
62+
ANS($ans3->cmp());
6263

6364
ENDDOCUMENT(); # This should be the last executable line in the problem.

0 commit comments

Comments
 (0)