-
Notifications
You must be signed in to change notification settings - Fork 4
/
PhysicsResistance.html
338 lines (284 loc) · 10.1 KB
/
PhysicsResistance.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta charset="UTF-8">
<meta name="Author" content="Leslie Bondaryk" />
<meta name="Owner" content="Pearson" />
<meta name="Copyright" content="Copyright (c) 2013 Pearson. All rights reserved." />
<meta content="width=device-width, initial-scale=1.0" name="viewport" />
<meta content="Carmen Santiago, Demo Book" name="description" />
<title class="setTitle"></title>
<!-- bootstrap_plus.css contains styling for the dropdown menu and other common core styles -->
<link href="css/bootstrap_plus.css" rel="stylesheet" media="screen">
<!-- widgets.css contains styling for the interactive brix -->
<link href="css/widgets.css" rel="stylesheet">
<!-- eCourse-master.css contains styling for all the navigation -->
<link href="css/eCourse-master.css" rel="stylesheet" media="screen">
<!-- content_styles.css contains styling for the narrative layout and responsive design -->
<link href="css/content_styles.css" rel="stylesheet" media="screen">
</head>
<body>
<div class="container">
<div class="span12 lc_ec_page">
<section class="lc_ec_fiftyFifty lc_ec_pageInner">
<div class="lc_ec_content">
<h2 class="lc_ec_bHead"><span class='number setId'></span>
<span class="setTitle"></span>
</h2>
<div class="lc_ec_leading">
<p><b>Resistivity</b> is an electrical material property that specifies how difficult it is to pass current through the material. Every material has its own characteristic resistivity – for example, rubber's resistivity is far larger than copper's. </p>
<p>You can think of passing current through a low-resistivity material as pushing water through an empty pipe. Nothing impedes the water. In reality, it's actually the presence rather than abscence of free electrons to pass along the charge that lowers the resistivity. </p>
<p>Resistivity is different from <b>resistance</b>, which is dependent on length and cross section of the physical object. A long, thin copper wire has a much larger resistance than a thick, short copper wire. </p>
<p>Experiment with the effect on resistance of the physical properties of a wire, then make these statements correct for the variable you are changing: </p>
<div id="resCross"></div>
<div id="resLength"></div>
</div>
<div class="lc_ec_trailing">
<div id="sliders">
<div id="rhoSlider"></div>
<div id="LSlider"></div>
<div id="ASlider"></div>
</div>
<p>Resistance in a wire is defined by the expression
<div>
<span id="resistance">R</span> =
<span id="resistivity">ρ</span> · <span id="length">L</span> /
<span id="area">A</span> = <span id="resVal"></span>
</div>
<div id="defs"></div>
</p>
<div id="diagram"></div>
</div>
</div>
</section>
</div>
</div>
<script src="js/jquery-latest.js"></script>
<script src="js/bootstrap.min.js"></script>
<script src="js/jquery-ui-1.10.2.custom.js"></script>
<script src="js/toc-structure.js"></script>
<script src="js/eCourse-master.js"></script>
<script src="js/d3.v3.min.js"></script>
<script src="../closure/closure-library/closure/goog/base.js"></script>
<script src="js/brixlib-deps.js"></script>
<script>
goog.require('pearson.brix.BricLayer');
</script>
<script src="js/widget-multiplechoicequestion-old.js"></script>
<script>
// local aliases for convenience
var Size = pearson.utils.Size;
var SVGContainer = pearson.brix.SVGContainer;
var Image = pearson.brix.Image;
var CaptionedImage = pearson.brix.CaptionedImage;
var Carousel = pearson.brix.Carousel;
var ImageViewer = pearson.brix.ImageViewer;
var Callouts = pearson.brix.Callouts;
var LineGraph = pearson.brix.LineGraph;
var Slider = pearson.brix.Slider;
var Readout = pearson.brix.Readout;
var Sketch = pearson.brix.Sketch;
var EventManager = pearson.utils.EventManager;
var SubmitManager = pearson.brix.utils.SubmitManager;
var MultipleChoiceQuestion = pearson.brix.MultipleChoiceQuestionOld;
var SelectGroup = pearson.brix.SelectGroup;
var eventManager = new EventManager();
var submitManager = new SubmitManager(eventManager);
// Select widget config
var selector1 = [
{
content: "smaller",
answerKey: "smaller",
},
{
content: "greater",
answerKey: "greater",
},
{
content: "the same",
answerKey: "same",
}];
var selector2 = [
{
content: "smaller",
answerKey: "smaller",
},
{
content: "greater",
answerKey: "greater",
},
{
content: "approximately the same",
answerKey: "same",
}];
var Q1 = new MultipleChoiceQuestion({
questionId: "Resist1",
question: "What is the change in resistance for a wire of greater cross-section?",
choices: selector1,
order: "randomized",
widget: SelectGroup,
widgetConfig: {
numberFormat: "latin-lower",
question: true,
},
}, eventManager);
Q1.draw(d3.select("#resCross"));
submitManager.handleRequestsFrom(Q1);
var Q2 = new MultipleChoiceQuestion({
questionId: "Resist2",
question: "What is the change in resistance for a wire of shorter length?",
choices: selector2,
order: "random",
widget: SelectGroup,
widgetConfig: {
numberFormat: "latin-lower",
question: true,
},
}, eventManager);
Q2.draw(d3.select("#resLength"));
submitManager.handleRequestsFrom(Q2);
var rhoExtent = [0,1],
LExtent = [1,10],
AExtent = [1,50];
var rhoSlide = new Slider ({
id: "rhoVal",
startVal: 0.5,
minVal: rhoExtent[0],
maxVal: rhoExtent[1],
stepVal: .01,
unit: "Ω cm",
label: "Resistivity, ρ =",
format: d3.format('5.2f'),
}, eventManager);
rhoSlide.draw(d3.select("#rhoSlider"));
var LSlide = new Slider ({
id: "LVal",
startVal: 7,
minVal: LExtent[0],
maxVal: LExtent[1],
stepVal: .1,
unit: "cm",
label: "Length, L = ",
format: d3.format('5.2f'),
}, eventManager);
LSlide.draw(d3.select("#LSlider"));
var ASlide = new Slider ({
id: "AVal",
startVal: 27,
minVal: AExtent[0],
maxVal: AExtent[1],
stepVal: .1,
unit: "cm<sup>2</sup>",
label: "Area, A = ",
format: d3.format('5.2f'),
}, eventManager);
ASlide.draw(d3.select("#ASlider"));
// Create the ee readout widget
var resReadout = new Readout({
node: d3.select("#resVal"),
id: 'resRead',
startVal: resist(rhoSlide.getValue(),LSlide.getValue(),ASlide.getValue()),
readOnly: true,
size: 5,
unit: "Ω",
//label: "R ="
}, eventManager);
function resist(rho, len, area)
{
return d3.round(rho * len / area, 2);
}
//generate the random data based on the slider values
function randomXYData(inputVals)
{
var pts = inputVals.pts;
var amplitudeX = inputVals.amplitudeX;
var amplitudeY = inputVals.amplitudeY;
var data = [];
for (i = 0; i < pts; i++)
{
data[i] = { x: amplitudeX * Math.random(), y: amplitudeY * Math.random() };
}
return data;
}
var factor = 100;
var diam = 2 * Math.abs(Math.sqrt(ASlide.getValue() / Math.PI));
console.log("diameter",diam);
var maxDiam = 2*Math.sqrt(AExtent[1]/Math.PI);
var electrons = randomXYData({
pts: Math.floor(factor * rhoSlide.getValue()),
amplitudeX: LSlide.getValue(),
amplitudeY: diam,
});
var cont1 = new SVGContainer({
node: d3.select("#diagram"),
maxWid: 450,
maxHt: 300
});
var dots = new LineGraph({
id: "lg0",
Data: [electrons],
type: "points",
xAxisFormat: { type: "linear",
ticks: [0, LExtent[1]],
orientation: "bottom",
label: "wire length" },
yAxisFormat: { type: "linear",
orientation: "right",
label: "wire height",
ticks: [0,maxDiam],
},
});
var rect = new Sketch({
id: "wire",
drawShape:
[
{ shape: "rectangle", data: [{xyPos: [0, diam], width: LSlide.getValue(), height: diam }]},
],
});
dots.append(rect);
cont1.append(dots, {topPercentOffset: 0, leftPercentOffset: 0, heightPercent: 1, widthPercent: 1});
// Handle changes of the three input values
eventManager.subscribe(rhoSlide.changedValueEventId,
handleChangedValue);
eventManager.subscribe(LSlide.changedValueEventId,
handleChangedValue);
eventManager.subscribe(ASlide.changedValueEventId,
handleChangedValue);
/* **************************************************************************
* handleInputValueChanged *//**
*
* handleInputValueChanged is called from the event handler for one of
* the input widgets when the user changes its value. It updates the
* given matching input widget's value to match the new value and then
* updates the bar chart.
*
* @param {NumericInput} otherInputWidget -This is the other input widget
* whose value needs to be updated
* to match the user changed widget.
* @param {number} newValue - The value of the widget that was changed.
*
****************************************************************************/
function handleChangedValue(newValue)
{
//get the values of all the sliders, calculate new resistance
newRes = resist(rhoSlide.getValue(), LSlide.getValue(), ASlide.getValue());
//write that resistance to the readout
resReadout.setValue(newRes);
//recalculate the data
var diam = 2 * Math.sqrt(ASlide.getValue() / Math.PI);
var electrons = randomXYData({
pts: Math.floor(factor * rhoSlide.getValue()),
amplitudeX: LSlide.getValue(),
amplitudeY: 2 * Math.sqrt(ASlide.getValue() / Math.PI),
});
// update the linegraph w/ the new data
dots.data_[0] = electrons;
rect.drawShape[0].data =
[{xyPos: [0, diam], width: LSlide.getValue(), height: diam }];
//redraw the dots
dots.redraw();
}
</script>
</body>
</html>