rolling.html: Observe that the page can be saved for offline use.
[dep-ui] / rolling.html
CommitLineData
ac26861c
MW
1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
2 "http://www.w3c.org/TR/html4/strict.dtd">
3<html>
4<head>
5 <title>Rolling wire-strip calculator</title>
9c4e8d7f 6 <meta name=viewport content="width=device-width initial-scale=1.0">
ac26861c
MW
7 <link rel=stylesheet type="text/css" href="dep-ui.css">
8 <link rel=stylesheet type="text/css" href="rolling.css">
daa2a01c
MW
9 <script type="text/javascript" src="dep.js"></script>
10 <script type="text/javascript" src="dep-ui.js"></script>
ac26861c
MW
11<head>
12<body>
13
14<h1>Rolling wire-strip calculator</h1>
15
c6150f2f 16<div id=trace style="white-space: pre"></div>
ac26861c
MW
17<script type="text/javascript"><!--
18--></script>
19
20<table class=widgets>
21 <tr><td colspan=2><h3>Required size</h3>
22 <tr>
23 <td class=label><label for=width>Width: </label>
24 <td><input id=width>
25 <script type="text/javascript"><!--
26 var width = new DEP.Dep();
27 DEP_UI.input_field('width', width, DEP_UI.convert_to_numeric);
28 --></script>
29 <tr>
30 <td class=label><label for=thick>Thickness: </label>
31 <td><input id=thick>
32 <script type="text/javascript"><!--
33 var thick = new DEP.Dep();
34 DEP_UI.input_field('thick', thick, DEP_UI.convert_to_numeric);
35 --></script>
36 <tr>
37 <td class=label><label for=length>Length: </label>
38 <td><input id=length>
39 <script type="text/javascript"><!--
40 var length = new DEP.Dep();
41 DEP_UI.input_field('length', length, DEP_UI.convert_to_numeric);
42 --></script>
43
44 <tr><td colspan=2><h3>You should start with</h3>
45 <tr>
46 <td class=label><label for=sq-size>Square side: </label>
47 <td><input id=sq-size readonly>
48 <script type="text/javascript"><!--
49 var sq_size = new DEP.Dep(function () {
50 return Math.pow(Math.pow(width.value(), 2) * thick.value(), 1/3);
51 });
52 DEP_UI.output_field('sq-size', sq_size, DEP_UI.convert_from_numeric);
53 --></script>
54 <tr>
55 <td class=label><label for=rnd-diam>Round diameter: </label>
56 <td><input id=rnd-diam readonly>
57 <script type="text/javascript"><!--
58 var rnd_diam = new DEP.Dep(function () {
59 return 2*sq_size.value()/Math.sqrt(Math.PI);
60 });
61 DEP_UI.output_field('rnd-diam', rnd_diam,
62 DEP_UI.convert_from_numeric);
63 --></script>
64 <tr>
65 <td class=label><label for=start-length>Length: </label>
66 <td><input id=start-length readonly>
67 <script type="text/javascript"><!--
68 var volume = new DEP.Dep(function () {
69 return width.value() * thick.value() * length.value();
70 });
71 volume.name = 'volume';
72 var start_length = new DEP.Dep(function () {
73 return volume.value()/(Math.pow(sq_size.value(), 2));
74 });
75 DEP_UI.output_field('start-length', start_length,
76 DEP_UI.convert_from_numeric);
77 --></script>
78
79 <tr><td colspan=2><h3>Initial stock</h3>
80 <tr><td colspan=2>
81 <input type=radio name=stock-type value=round id=stock-round checked>
82 <label for=stock-round>Round section</label>
83 <script type="text/javascript"><!--
84 var stock_type = new DEP.Dep();
85 DEP_UI.input_radio('stock-round', stock_type);
86 --></script>
87 <tr><td colspan=2>
88 <input type=radio name=stock-type value=square id=stock-square>
89 <label for=stock-square>Square section</label>
90 <script type="text/javascript"><!--
91 DEP_UI.input_radio('stock-square', stock_type);
92 --></script>
93 <tr>
94 <td class=label><label for=stock-size>Stock size: </label>
95 <td><input id=stock-size>
96 <script type="text/javascript"><!--
97 var stock_size = new DEP.Dep();
98 DEP_UI.input_field('stock-size', stock_size,
99 DEP_UI.convert_to_numeric);
100 --></script>
101 <tr>
102 <td class=label><label for=stock-length>Stock length: </label>
103 <td><input id=stock-length readonly>
104 <script type="text/javascript"><!--
105 var stock_length = new DEP.Dep(function () {
106 var cross;
107 switch (stock_type.value()) {
108 case 'round':
109 cross = 1/4 * Math.PI * Math.pow(stock_size.value(), 2);
110 break;
111 case 'square':
112 cross = Math.pow(stock_size.value(), 2);
113 break;
114 default:
115 dep_bad();
116 }
117 return volume.value()/cross;
118 });
119 DEP_UI.output_field('stock-length', stock_length,
120 DEP_UI.convert_from_numeric);
121 --></script>
122</table>
123
124<script type="text/javascript"><!--
125 function toggle_help() {
126 var e = DEP_UI.elt('help');
127 var b = DEP_UI.elt('toggle-help');
128 if (e.className.match(/\bconceal\b/)) {
129 b.textContent = 'Hide help';
130 DEP_UI.rm_elt_class(e, 'conceal');
131 } else {
132 b.textContent = 'Show help';
133 DEP_UI.add_elt_class(e, 'conceal');
134 }
135 }
136 document.write(
137 '<button id=toggle-help onclick="toggle_help()">' +
138 'Show help</button>');
139--></script>
140<div id=help>
141<script type="text/javascript"><!--
142 DEP_UI.add_elt_class(DEP_UI.elt('help'), 'conceal');
143--></script>
144<h2>What this program does</h2>
145
146<div id=js-note>
147<script type="text/javascript"><!--
148 DEP_UI.add_elt_class(DEP_UI.elt('js-note'), 'conceal');
149--></script>
150<p>This page is only really interesting because it contains a Javascript
ea8c4d68 151program. You seem to have Javascript turned off, so it won&rsquo;t work very
6903bc5d
MW
152well. It only requires first-party scripts;
153see <a href="#privacy">Privacy</a> for more details.
ac26861c
MW
154</div>
155
156<h3>Background</h3>
157
158<p>When you pass round or square wire through flat rolls it gets flatter
159and longer, but it also gets wider. You can exploit this to make thin
160wire strip of almost any dimensions, but it&rsquo;s rather difficult to
161predict the result. That&rsquo;s what this calculator does.
162
163<p>You specify the width and thickness of the strip you want, and the
164program calculates what size round or square wire you should start with.
165Additionally, if you specify the length of strip you need, it will
166calculate the length of the input wire.
167
168<p>The chances are that you don&rsquo;t actually have the required
169thickness of round or square wire to start with, but you do have some
170that&rsquo;s thicker. Just enter the size of the round or square
171initial stock that you do have and the program will calculate how much
172of it you need to create the required starting size that you can then
173roll down to the required thickness of strip.
174
175<p>For best results, roll the strip in as few passes as you can handle.
176
ef43c701 177<p>You can see the <a href="rolling-eqn.html">detailed equations</a>
ea8c4d68 178used for this calculation if you&rsquo;re interested.
ef43c701 179
ac26861c
MW
180<h3>Use</h3>
181
182<p>Boxes with light red or white backgrounds are entry boxes for you to
183type in your requirements; boxes with dark red or grey backgrounds are
184where the calculator puts its answers. White and grey mean that the box
185is showing useful information: an input box contains a valid number, for
186example, and an output box has calculated a correct answer. Red, on the
187other hand, means that there&rsquo;s something wrong: either the
188calculator can&rsquo;t understand what you&rsquo;ve typed in an input
189box, or it&rsquo;s hit trouble &ndash; usually this means that some
190necessary input is missing.
191
4e97c6e3
MW
192<p>You specify the width and thickness of the strip you want, and the
193program calculates what size round or square wire you should start with.
194Additionally, if you specify the length of strip you need, it will
195calculate the length of the input wire.
196
197<p>You can use whatever units you like, as long as they are consistent,
198but you cannot use wire gauges. If you use millimetres, the results
199will be in millimetres; if you use inches, the results will be in
200inches. Whatever you use, the results are displayed to only 3 decimal
201places.
202
57cb467b 203<h3>Code and credits</h3>
45051e06
MW
204
205<p>The code which makes this page work
8a0fc4a2 206is <a href="https://www.gnu.org/philosophy/free-sw.html">free
45051e06 207software</a>. You
8a0fc4a2 208can <a href="https://git.distorted.org.uk/~mdw/dep-ui/">browse or download
45051e06 209it</a>, modify it, and/or redistribute it under the terms of the
8a0fc4a2 210<a href="https://www.gnu.org/licenses/old-licenses/gpl-2.0.html">GNU
45051e06
MW
211General Public License, version 2</a> or, at your option, any later
212version.
213
c690b9b8
MW
214<p>If you make interesting changes, I&rsquo;d be very grateful to know
215about them. Please <a href="mailto:mdw@distorted.org.uk">mail me
216patches</a>.
45051e06 217
2c03671e 218<p>The Javascript machinery on this page was written by Mark Wooding;
57cb467b
MW
219the text was written by Mark Wooding and Gary Wooding. The data used
220to derive the computation was provided by Gary Wooding.
221
6903bc5d
MW
222<h3 id="privacy">Privacy</h3>
223
224<p>There are no cookies or other trackers here. This page does not use
225externally hosted scripts, fonts, images, or anything else. The server
226has logged your IP address, which helps me fix things if they go wrong;
227mostly things work fine and the logs are discarded after a couple of
228weeks.
229
c3d1ecfb
MW
230<p>Most web browsers can save a version of this page which can be used
231offline.
232
ac26861c
MW
233</div>
234</body>
235</html>