Skip to content

Commit 7d7e63f

Browse files
authored
Merge pull request #916 from benwalt/master
Optimizations, corrections, and new problems from fall semester
2 parents 7b04cfc + e8ae253 commit 7d7e63f

File tree

107 files changed

+4827
-280
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

107 files changed

+4827
-280
lines changed

Contrib/METU-NCC/Applied_Math/fourier/Fast_Fourier.pg

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -142,35 +142,35 @@ Combine the Fourier transforms of the even and odd components to get the transfo
142142

143143
\(\mathcal{F}_0\Bigl\lbrace \vec{\mathbf{f}} \Bigr\rbrace = \frac{1}{2} \Bigl( \)
144144
\{ ans_rule(10) \} \( +\ \ \phantom{\omega^2}\)
145-
\{ ans_rule(10) \} \(\Bigr)\ =\ \) \{ ans_rule(15) \}$BR
145+
\{ ans_rule(10) \} \(\Bigr)\ =\ \) \{ ans_rule(22) \}$BR
146146

147147
\(\mathcal{F}_1\Bigl\lbrace \vec{\mathbf{f}} \Bigr\rbrace = \frac{1}{2} \Bigl( \)
148148
\{ ans_rule(10) \} \( +\ \ \overline{\omega}\phantom{^1}\)
149-
\{ ans_rule(10) \} \(\Bigr)\ =\ \) \{ ans_rule(15) \}$BR
149+
\{ ans_rule(10) \} \(\Bigr)\ =\ \) \{ ans_rule(22) \}$BR
150150

151151
\(\mathcal{F}_2\Bigl\lbrace \vec{\mathbf{f}} \Bigr\rbrace = \frac{1}{2} \Bigl( \)
152152
\{ ans_rule(10) \} \( +\ \ \overline{\omega}^2 \)
153-
\{ ans_rule(10) \} \(\Bigr)\ =\ \) \{ ans_rule(15) \}$BR
153+
\{ ans_rule(10) \} \(\Bigr)\ =\ \) \{ ans_rule(22) \}$BR
154154

155155
\(\mathcal{F}_3\Bigl\lbrace \vec{\mathbf{f}} \Bigr\rbrace = \frac{1}{2} \Bigl( \)
156156
\{ ans_rule(10) \} \( +\ \ \overline{\omega}^3 \)
157-
\{ ans_rule(10) \} \(\Bigr)\ =\ \) \{ ans_rule(15) \}$BR
157+
\{ ans_rule(10) \} \(\Bigr)\ =\ \) \{ ans_rule(22) \}$BR
158158

159159
\(\mathcal{F}_4\Bigl\lbrace \vec{\mathbf{f}} \Bigr\rbrace = \frac{1}{2} \Bigl( \)
160160
\{ ans_rule(10) \} \( -\ \ \phantom{\omega^2}\)
161-
\{ ans_rule(10) \} \(\Bigr)\ =\ \) \{ ans_rule(15) \}$BR
161+
\{ ans_rule(10) \} \(\Bigr)\ =\ \) \{ ans_rule(22) \}$BR
162162

163163
\(\mathcal{F}_5\Bigl\lbrace \vec{\mathbf{f}} \Bigr\rbrace = \frac{1}{2} \Bigl( \)
164164
\{ ans_rule(10) \} \( -\ \ \overline{\omega}\phantom{^1}\)
165-
\{ ans_rule(10) \} \(\Bigr)\ =\ \) \{ ans_rule(15) \}$BR
165+
\{ ans_rule(10) \} \(\Bigr)\ =\ \) \{ ans_rule(22) \}$BR
166166

167167
\(\mathcal{F}_6\Bigl\lbrace \vec{\mathbf{f}} \Bigr\rbrace = \frac{1}{2} \Bigl( \)
168168
\{ ans_rule(10) \} \( -\ \ \overline{\omega}^2 \)
169-
\{ ans_rule(10) \} \(\Bigr)\ =\ \) \{ ans_rule(15) \}$BR
169+
\{ ans_rule(10) \} \(\Bigr)\ =\ \) \{ ans_rule(22) \}$BR
170170

171171
\(\mathcal{F}_7\Bigl\lbrace \vec{\mathbf{f}} \Bigr\rbrace = \frac{1}{2} \Bigl( \)
172172
\{ ans_rule(10) \} \( -\ \ \overline{\omega}^3 \)
173-
\{ ans_rule(10) \} \(\Bigr)\ =\ \) \{ ans_rule(15) \}$BR
173+
\{ ans_rule(10) \} \(\Bigr)\ =\ \) \{ ans_rule(22) \}$BR
174174

175175

176176

Contrib/METU-NCC/Applied_Math/springs/oscillate-2mass-3springs_alt.pg

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,9 @@ $BR
111111
\{ image( "spring-2mass-3springs_alt.png", width=>170, height=>220,
112112
tex_size=>170, extra_html_tags=>'alt="Spring System"' ) \}
113113

114-
\(c_1 = $c1,\quad c_2 = $c2,\quad c_3 = $c3 \\
115-
m_1 = $m1,\quad m_2 = $m2f \)
114+
\(\begin{align}
115+
c_1 &= $c1, & c_2 &= $c2, & c_3 &= $c3 \\
116+
m_1 &= $m1, & m_2 &= $m2f && \end{align} \)
116117

117118
$BR
118119
$HR

Contrib/METU-NCC/Applied_Math/springs/oscillate-2mass-4springs_alt.pg

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,9 @@ $BR
118118

119119
\{ image( "spring-2mass-4springs_alt.png", width=>190, height=>200,
120120
tex_size=>190, extra_html_tags=>'alt="Spring System"' ) \}
121-
\(c_1 = $c1f,\quad c_2 = $c2f,\quad c_3 = $c3f,\quad c_4 = $c4 \\
122-
m_1 = $m1f,\quad m_2 = $m2f \)
121+
\(\begin{align}
122+
c_1 &= $c1f, & c_2 &= $c2f, & c_3 &= $c3f, & c_4 &= $c4 \\
123+
m_1 &= $m1f, & m_2 &= $m2f &&&& \end{align}\)
123124

124125
$BR
125126
$HR

Contrib/METU-NCC/Applied_Math/springs/oscillate-detatched.pg

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -107,10 +107,11 @@ $BR
107107

108108
\{ image( "spring-2mass-1springs-line.png", width=>36, height=>150,
109109
tex_size=>40, extra_html_tags=>'alt="Spring System"' ) \}
110-
\(
111-
c_1 = $c1, \\
112-
m_1 = $m1, \ \
113-
m_2 = $m2
110+
\( \begin{align}
111+
m_1 &= $m1, \\
112+
c_1 &= $c1,\vphantom{\frac{x}{x}} \\
113+
m_2 &= $m2
114+
\end{align}
114115
\)
115116

116117
$BR

Contrib/METU-NCC/Applied_Math/trusses/truss-2node-4bar.pg

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,13 @@ $angleRad = $anglesRad[$i];
3232
Context('Matrix');
3333

3434

35-
$A= Matrix([
35+
$A = Matrix([
3636
[-1,0,1,0],
3737
[0,1,0,0],
3838
[0,0,cos(pi/$angleRad),sin(pi/$angleRad)],
3939
[0,0,0,1],
4040
]);
41-
41+
$B = $A->transpose;
4242

4343

4444
#######################################
@@ -51,18 +51,18 @@ Consider the following truss system.
5151
$BR
5252

5353
\{ image( "truss-2node-4bar.png", width=>165, height=>135,
54-
tex_size=>900, extra_html_tags=>'alt="Truss System"' ) \}
54+
tex_size=>170, extra_html_tags=>'alt="Truss System"' ) \}
5555
All bars are either vertical, horizontal, or at \($angleDeg^\circ\) from horizontal.
5656

5757
$BR
5858
$HR
5959
$BR
6060

61-
Enter the elongation matrix: $BR
62-
(in the form "node 1 horiz", "node 1 vert", "node 2 horiz" etc.)$BR
61+
Enter the force-balance matrix (\(B = A^\mathrm{T}\)): $BR
62+
(in the form "joint 1 horiz", "joint 1 vert", "joint 2 horiz" etc.)$BR
6363

6464
$BCENTER
65-
\(A = \) \{ $A->ans_array() \}
65+
\(B = \) \{ $B->ans_array() \}
6666
$BR
6767
(Remember that webwork uses ${BBOLD}radians$EBOLD for computations.)
6868
$ECENTER
@@ -73,7 +73,7 @@ $BR
7373

7474
This truss system should be stable. The matrix is square, which is good.
7575
However, you should be able to verify that \(A\) has a pivot
76-
in each column it its LU decomposition. This means that it has no
76+
in each column of its LU decomposition. This means that it has no
7777
nullspace.
7878

7979
END_TEXT
@@ -84,8 +84,8 @@ Context()->normalStrings;
8484

8585
$showPartialCorrectAnswers = 1 ;
8686

87-
ANS( $A->cmp() );
87+
ANS( $B->cmp() );
8888

89-
COMMENT('Elongation matrix');
89+
COMMENT('Force-balance matrix: rows are joints, columns are bars');
9090

9191
ENDDOCUMENT();

Contrib/METU-NCC/Applied_Math/trusses/truss-3node-4bar.pg

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ $A=Matrix([
3636
[ 0, 1, 0, 0, 0, 0],
3737
[ 0, 0, 0, 0, 0, 1]
3838
]);
39+
$B=$A->transpose;
3940

4041
$null1 = Matrix([[0],[0],[0],[1],[0],[0]]);
4142
$null2 = Matrix([[1],[0],[1],[0],[1],[0]]);
@@ -70,13 +71,13 @@ $V4N = PopUp(["?","Yes","No"], "Yes");
7071
$multians = MultiAnswer($null1,$null2)->with( singleResult => 1, separator => ', ', tex_separator => ', ', allowBlankAnswers=>0, checker => ~~&basis_checker_columns, );
7172

7273
$image1=image("truss-3node-4bar-motion1.png",
73-
width=>140,height=>90,tex_size=>900);
74+
width=>140,height=>90,tex_size=>140);
7475
$image2=image("truss-3node-4bar-motion2.png",
75-
width=>140,height=>90,tex_size=>900);
76+
width=>140,height=>90,tex_size=>140);
7677
$image3=image("truss-3node-4bar-motion3.png",
77-
width=>140,height=>90,tex_size=>900);
78+
width=>140,height=>90,tex_size=>140);
7879
$image4=image("truss-3node-4bar-motion4.png",
79-
width=>140,height=>90,tex_size=>900);
80+
width=>140,height=>90,tex_size=>140);
8081

8182

8283
#######################################
@@ -89,25 +90,25 @@ Consider the following truss system.
8990
$BR
9091

9192
\{ image( "truss-3node-4bar.png", width=>180, height=>145,
92-
tex_size=>900, extra_html_tags=>'alt="Truss System"' ) \}
93+
tex_size=>180, extra_html_tags=>'alt="Truss System"' ) \}
9394
All bars are vertical or horizontal.
9495

9596
$BR
9697
$HR
9798
$BR
9899

99-
Enter the elongation matrix: $BR
100-
(in the form "node 1: horiz", "node 1: vert", "node 2: horiz" etc.)$BR
100+
Enter the force-balance matrix (\(B=A^\mathrm{T}\)): $BR
101+
(in the form "joint 1: horiz", "joint 1: vert", "joint 2: horiz" etc.)$BR
101102

102103
$BCENTER
103-
\(A = \) \{ $A->ans_array() \}
104+
\(B = \) \{ $B->ans_array() \}
104105
$ECENTER
105106

106107
$BR
107108
$HR
108109
$BR
109110

110-
Compute a basis for the nullspace of \(A\).
111+
Compute a basis for the nullspace of \(B^\mathrm{T}\).
111112
$BR
112113
$BCENTER
113114
Basis = \(\displaystyle \Bigg\lbrace\)
@@ -120,22 +121,22 @@ $BR
120121
$HR
121122
$BR
122123

123-
Match the following vectors with the movements they would represent and
124-
state whether they are in the nullspace of \(A\)
124+
Match the following force vectors \(f_m\) with the motions they would induce
125+
and state whether they are in the nullspace of \(A\)
125126
$BR
126127

127128
\{
128129
BeginTable().
129-
AlignedRow(["\($V1 \)", "Movement:$BR $SPACE ". $V1M->menu() .
130+
AlignedRow(["\($V1 \)", "Motion:$BR $SPACE ". $V1M->menu() .
130131
"${BR}In nullspace? $BR $SPACE ". $V1N->menu(),
131132
, "\(\qquad\)" ,
132-
"\($V2 \)", "Movement:$BR $SPACE ". $V2M->menu() .
133+
"\($V2 \)", "Motion:$BR $SPACE ". $V2M->menu() .
133134
"${BR}In nullspace? $BR $SPACE ". $V2N->menu(),
134135
, "\(\qquad\)" ,
135-
"\($V3 \)", "Movement:$BR $SPACE ". $V3M->menu() .
136+
"\($V3 \)", "Motion:$BR $SPACE ". $V3M->menu() .
136137
"${BR}In nullspace? $BR $SPACE ". $V3N->menu(),
137138
, "\(\qquad\)" ,
138-
"\($V4 \)", "Movement:$BR $SPACE ". $V4M->menu() .
139+
"\($V4 \)", "Motion:$BR $SPACE ". $V4M->menu() .
139140
"${BR}In nullspace? $BR $SPACE ". $V4N->menu()],
140141
align=>LEFT, separation=>1).
141142
EndTable() \}
@@ -162,7 +163,7 @@ Context()->normalStrings;
162163

163164
$showPartialCorrectAnswers = 1 ;
164165

165-
ANS( $A->cmp );
166+
ANS( $B->cmp );
166167
ANS( $multians->cmp );
167168

168169
install_problem_grader(~~&std_problem_grader);
@@ -174,6 +175,6 @@ ANS( $V3M->cmp ); ANS( $V3N->cmp );
174175
ANS( $V4M->cmp ); ANS( $V4N->cmp );
175176

176177

177-
COMMENT('Elongation matrix');
178+
COMMENT('Force-balance matrix: rows are joints, columns are bars');
178179

179180
ENDDOCUMENT();

Contrib/METU-NCC/Applied_Math/trusses/truss-3node-4bar_diamond.pg

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ $A=1/2*Matrix([
4040
[ 0, 0,-$h, $v, 0, 0],
4141
[ 0, 0, 0, 0, $h, $v]
4242
]);
43+
$B=$A->transpose;
4344

4445
$null1 = Matrix([[-$v],[$h], [0], [0],[-$v],[$h]]);
4546
$null2 = Matrix([[$v], [$h],[$v],[$h], [0], [0]]);
@@ -73,13 +74,13 @@ $V4M = PopUp(["?","A","B","C","D"], "A");
7374
$V4N = PopUp(["?","Yes","No"], "No");
7475

7576
$image1=image("truss-3node-4bar_diamond-motion1.png",
76-
width=>140,height=>90,tex_size=>900);
77+
width=>140,height=>90,tex_size=>140);
7778
$image2=image("truss-3node-4bar_diamond-motion2.png",
78-
width=>140,height=>90,tex_size=>900);
79+
width=>140,height=>90,tex_size=>140);
7980
$image3=image("truss-3node-4bar_diamond-motion3.png",
80-
width=>140,height=>90,tex_size=>900);
81+
width=>140,height=>90,tex_size=>140);
8182
$image4=image("truss-3node-4bar_diamond-motion4.png",
82-
width=>140,height=>90,tex_size=>900);
83+
width=>140,height=>90,tex_size=>140);
8384

8485
#######################################
8586
# Main text
@@ -91,18 +92,18 @@ Consider the following truss system.
9192
$BR
9293

9394
\{ image( "truss-3node-4bar_diamond.png", width=>180, height=>145,
94-
tex_size=>900, extra_html_tags=>'alt="Truss System"' ) \}
95+
tex_size=>180, extra_html_tags=>'alt="Truss System"' ) \}
9596
All angles are as marked.
9697

9798
$BR
9899
$HR
99100
$BR
100101

101-
Enter the elongation matrix: $BR
102-
(in the form "node 1 horiz", "node 1 vert", "node 2 horiz" etc.)$BR
102+
Enter the force-balance matrix (\(B = A^\mathrm{T}\)): $BR
103+
(in the form "joint 1 horiz", "joint 1 vert", "joint 2 horiz" etc.)$BR
103104

104105
$BCENTER
105-
\(A = \) \{ $A->ans_array() \}
106+
\(B = \) \{ $B->ans_array() \}
106107
$BR
107108
(Remember that webwork uses ${BBOLD}radians$EBOLD for computations.)
108109
$ECENTER
@@ -111,7 +112,7 @@ $BR
111112
$HR
112113
$BR
113114

114-
Compute a basis for the nullspace of \(A\).
115+
Compute a basis for the nullspace of \(B^\mathrm{T}\).
115116
$BR
116117
$BCENTER
117118
Basis = \(\displaystyle \Bigg\lbrace\)
@@ -124,22 +125,22 @@ $BR
124125
$HR
125126
$BR
126127

127-
Match the following vectors with the movements they would represent and
128+
Match the following force vectors \(f_m\) the motions they would induce and
128129
state whether they are in the nullspace of \(A\)
129130
$BR
130131

131132
\{
132133
BeginTable().
133-
AlignedRow(["\(\left[\begin{matrix}2\\0\\1\\ \sqrt{3}\\1\\-\sqrt{3}\end{matrix}\right]\) ", "Movement:$BR $SPACE ". $V1M->menu() .
134+
AlignedRow(["\(\left[\begin{matrix}2\\0\\1\\ \sqrt{3}\\1\\-\sqrt{3}\end{matrix}\right]\) ", "Motion:$BR $SPACE ". $V1M->menu() .
134135
"${BR}In nullspace? $BR $SPACE ". $V1N->menu(),
135136
, "\(\qquad\)" ,
136-
"\($V2 \)", "Movement:$BR $SPACE ". $V2M->menu() .
137+
"\($V2 \)", "Motion:$BR $SPACE ". $V2M->menu() .
137138
"${BR}In nullspace? $BR $SPACE ". $V2N->menu(),
138139
, "\(\qquad\)" ,
139-
"\($V3 \)", "Movement:$BR $SPACE ". $V3M->menu() .
140+
"\($V3 \)", "Motion:$BR $SPACE ". $V3M->menu() .
140141
"${BR}In nullspace? $BR $SPACE ". $V3N->menu(),
141142
, "\(\qquad\)" ,
142-
"\($V4 \)", "Movement:$BR $SPACE ". $V4M->menu() .
143+
"\($V4 \)", "Motion:$BR $SPACE ". $V4M->menu() .
143144
"${BR}In nullspace? $BR $SPACE ". $V4N->menu()],
144145
align=>LEFT, separation=>1).
145146
EndTable() \}
@@ -163,7 +164,7 @@ Context()->normalStrings;
163164

164165
$showPartialCorrectAnswers = 1 ;
165166

166-
ANS( $A->cmp );
167+
ANS( $B->cmp );
167168
ANS( $multians->cmp );
168169

169170
install_problem_grader(~~&std_problem_grader);

0 commit comments

Comments
 (0)