Skip to content

Commit b2fcee7

Browse files
committed
Fix accepting answers due to excessive rounding in the
problem setup. Just give the rational expressions exactly (simplified). Change the limits to [-1,0] as there the exponential is of reasonable size. This should fix the previous problem that I suppose wasn't quite fixed. The problem was reported against a problem based on KJ-3-10-09.pg by Andras Balogh (UTRGV) for seed 4407
1 parent 6381499 commit b2fcee7

File tree

3 files changed

+46
-20
lines changed

3 files changed

+46
-20
lines changed

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

Lines changed: 16 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,19 @@ $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+
## this does too much rounding for some seeds
63+
#$c1 = Compute("3*$a/200");
64+
#$c2 = Compute("(2*$c1-8*$a/50)/6");
65+
#$c3 = Compute("-3*$a/200");
66+
#$c4 = Compute("$a/50");
67+
$c1 = Formula("3*$a/200");
68+
$c2 = Formula("-13*$a/600");
69+
$c3 = Formula("-3*$a/200");
70+
$c4 = Formula("$a/50");
6171

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

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

6676

6777
Context()->texStrings;

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

Lines changed: 15 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,18 @@ $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+
## this does too much rounding for some seeds
63+
#$c1 = Compute("-$a/74");
64+
#$c2 = Compute("($a/74 + 2*$c1)/6");
65+
#$c3 = Compute("$a/74");
66+
$c1 = Formula("-$a/74");
67+
$c2 = Formula("-$a/444");
68+
$c3 = Formula("$a/74");
69+
6070

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

63-
$yinfinity = Compute("0");
73+
$yinfinity = Formula("0");
6474

6575

6676
Context()->texStrings;

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

Lines changed: 15 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,20 @@ $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+
## this does too much rounding for some seeds
64+
#$c1 = Compute("6*$a/296");
65+
#$c2 = Compute("(2*$c1 - 6*$a/296)/6");
66+
#$c3 = Compute("-6*$a/296");
67+
#$c4 = Compute("$a/296");
68+
$c1 = Formula("3*$a/148");
69+
$c2 = Formula("$a/296");
70+
$c3 = Formula("-3*$a/148");
71+
$c4 = Formula("$a/296");
6772

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

70-
$yinfinity = Compute("$c3 cos(6t) + $c4 sin(6t)");
74+
$y = Formula("e^(-2t) ($c1 cos(6t) + $c2 sin(6t)) + $c3 cos(6t) + $c4 sin(6t)");
75+
76+
$yinfinity = Formula("$c3 cos(6t) + $c4 sin(6t)");
7177

7278

7379
Context()->texStrings;

0 commit comments

Comments
 (0)