Skip to content

Commit 90245a8

Browse files
authored
Merge pull request #1035 from jirilebl/fix
Fix accepting answers due to excessive rounding in the
2 parents 6381499 + 54ead5a commit 90245a8

File tree

3 files changed

+32
-20
lines changed

3 files changed

+32
-20
lines changed

OpenProblemLibrary/FortLewis/DiffEq/2-Higher-order/06-Forcing-resonance/KJ-3-10-07.pg

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,11 @@ TEXT(beginproblem());
4444

4545
Context("Numeric");
4646
Context()->variables->are(t=>"Real");
47+
Context()->variables->set(t=>{limits=>[-1,0]});
48+
Context()->flags->set(
49+
reduceConstants => 0,
50+
reduceConstantFunctions => 0,
51+
);
4752

4853
$m = 2;
4954
$c = 8;
@@ -54,14 +59,14 @@ $w = 8;
5459

5560
$F = Formula("2*$a cos($w t)")->reduce();
5661

57-
$c1 = Compute("3*$a/200");
58-
$c2 = Compute("(2*$c1-8*$a/50)/6");
59-
$c3 = Compute("-3*$a/200");
60-
$c4 = Compute("$a/50");
62+
$c1 = Formula("3*$a/200");
63+
$c2 = Formula("-13*$a/600");
64+
$c3 = Formula("-3*$a/200");
65+
$c4 = Formula("$a/50");
6166

62-
$y = Compute("$c1 e^(-2t) cos(6t) + $c2 e^(-2t) sin(6t) + $c3 cos(8t) + $c4 sin(8t)");
67+
$y = Formula("$c1 e^(-2t) cos(6t) + $c2 e^(-2t) sin(6t) + $c3 cos(8t) + $c4 sin(8t)");
6368

64-
$yinfinity = Compute("$c3 cos(8t) + $c4 sin(8t)");
69+
$yinfinity = Formula("$c3 cos(8t) + $c4 sin(8t)");
6570

6671

6772
Context()->texStrings;

OpenProblemLibrary/FortLewis/DiffEq/2-Higher-order/06-Forcing-resonance/KJ-3-10-08.pg

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,11 @@ TEXT(beginproblem());
4444

4545
Context("Numeric");
4646
Context()->variables->are(t=>"Real");
47+
Context()->variables->set(t=>{limits=>[-1,0]});
48+
Context()->flags->set(
49+
reduceConstants => 0,
50+
reduceConstantFunctions => 0,
51+
);
4752

4853
$m = 2;
4954
$c = 8;
@@ -54,13 +59,14 @@ $w = 8;
5459

5560
$F = Formula("$a e^(-t)")->reduce();
5661

57-
$c1 = Compute("-$a/74");
58-
$c2 = Compute("($a/74 + 2*$c1)/6");
59-
$c3 = Compute("$a/74");
62+
$c1 = Formula("-$a/74");
63+
$c2 = Formula("-$a/444");
64+
$c3 = Formula("$a/74");
65+
6066

61-
$y = Compute("$c1 e^(-2t) cos(6t) + $c2 e^(-2t) sin(6t) + $c3 e^(-t)");
67+
$y = Formula("$c1 e^(-2t) cos(6t) + $c2 e^(-2t) sin(6t) + $c3 e^(-t)");
6268

63-
$yinfinity = Compute("0");
69+
$yinfinity = Formula("0");
6470

6571

6672
Context()->texStrings;

OpenProblemLibrary/FortLewis/DiffEq/2-Higher-order/06-Forcing-resonance/KJ-3-10-09.pg

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,10 @@ TEXT(beginproblem());
4545

4646
Context("Numeric");
4747
Context()->variables->are(t=>"Real");
48-
Context()->variables->set(t=>{limits=>[-3,2]});
48+
Context()->variables->set(t=>{limits=>[-1,0]});
4949
Context()->flags->set(
50-
tolerance => 0.001,
51-
tolType => "absolute",
50+
reduceConstants => 0,
51+
reduceConstantFunctions => 0,
5252
);
5353

5454
$m = 2;
@@ -60,14 +60,15 @@ $w = 6;
6060

6161
$F = Formula("$a sin($w t)")->reduce();
6262

63-
$c1 = Compute("6*$a/296");
64-
$c2 = Compute("(2*$c1 - 6*$a/296)/6");
65-
$c3 = Compute("-6*$a/296");
66-
$c4 = Compute("$a/296");
63+
$c1 = Formula("3*$a/148");
64+
$c2 = Formula("$a/296");
65+
$c3 = Formula("-3*$a/148");
66+
$c4 = Formula("$a/296");
6767

68-
$y = Compute("e^(-2t) ($c1 cos(6t) + $c2 sin(6t)) + $c3 cos(6t) + $c4 sin(6t)");
6968

70-
$yinfinity = Compute("$c3 cos(6t) + $c4 sin(6t)");
69+
$y = Formula("e^(-2t) ($c1 cos(6t) + $c2 sin(6t)) + $c3 cos(6t) + $c4 sin(6t)");
70+
71+
$yinfinity = Formula("$c3 cos(6t) + $c4 sin(6t)");
7172

7273

7374
Context()->texStrings;

0 commit comments

Comments
 (0)