<html>
<head>
<script>
function calculatefunction(){
//Width = base. Set width to variable B:
var B = document.getElementById("width").value;
//Set height to variable H:
var H = document.getElementById("height").value;
//Set thickness to variable T:
var T = document.getElementById("thick").value;
//Length = span. Set length to variable L:
var L = document.getElementById("length").value;
//Concentrared load = P. Set load to variable P:
var CL = document.getElementById("load").value;
//Set span to variable S
var S = document.getElementById("span").value;
//Find positive space (b*h^3)/12
var Ipos = ((B) * (H*H*H)) / 12;
//Find negative space, two negative spaces. ((Width - 1 thickness) * (h-2t)^3)/12
var Ineg = ((B - T) * ((H - (2 * T)) * (H - (2 * T)) * (H - (2 * T)))) / 12;
//Find Itotal:
var Itotal = Ipos - Ineg;
//Formula for Delta: ((P)(S^3))/(48(E)(I))
//The average Modulus of Elasticity for basswood is 1,460,000 Lbf/in^2. I am simply substituting for E.
var Delta = (CL * (S*S*S))/(48 * 1460000 * Itotal);
//Output Delta as Deflection:
var Deflection = document.getElementById("deflectionid");
Deflection.value = Delta;
//Out put Itotal as Inertia in in^4
var inertiaAnswer = document.getElementById("inertiaAnswer");
inertiaAnswer.value = Itotal;
//Calculate density:
//Density = mass/volume
//Max density of basswood = 37 Lb/ft^3
//37 Lb/ft^3 * 1ft^3/(12in)^3 = 0.02141 Lb/in^3
//Density * volume = mass
var volume = (Itotal * L);
var mass = volume * .02141;
var MoB = document.getElementById("MoB");
MoB.value = mass;
}
</script>
</head>
<body>
<h3> Basic Beam Calculator</h3>
</br>
<img src="https://4.bp.blogspot.com/-znTGRfr0jno/VsjVEDr-6zI/AAAAAAAACcc/qMJ9_xifSIs/s1600/I%2Bbeam%2Bdrawing.png" alt="Width, height, thickness" style="float:right;width:300px;height:200px;">
This is a calculator for a basswood I-beam.
</br>
This calculator has two fixed variables, the density and elasticity.
</br>
The maxium density of basswood is 37 Lbs per cubic Ft
</br>
The elasticity of basswood is 1,460,000 Lbf per square inch.
</br>
</br>
<input type="number" placeholder="Width" name="width" id="width" /> (in)
</br>
<input type="number" placeholder="Height" name="height" id="height" /> (in)
</br>
<input type="number" placeholder="Length" name="length" id="length" /> (in)
</br>
<input type="number" placeholder="Span of Beam" name="span" id="span" /> (in)
</br>
<input type="number" placeholder="Thickness of Wood" name="thick" id="thick" /> (in)
</br>
</br>
<img src="https://1.bp.blogspot.com/-gxNlAg1rrTI/VsjENjl2fRI/AAAAAAAACb8/ABifkzIH5jg/s1600/I%2Bbeam%2Blength%2Bvs%2Bspan.png" alt="Length vs Span" style="float:right;width:300px;height:200px;">
<input type="number" placeholder="Concentrated Load" name="load" id="load" /> (Lbs)
</br>
</br>
<input type="submit" name="calculatebutton" id="calculatebutton" onclick="calculatefunction()" value="Calculate" />
</br>
</br>
<input type="number" placeHolder="Moment of Inertia" name="inertiaAnswer" id="inertiaAnswer" /> (in^4)
</br>
</br>
<input type="number" name="Deflection" placeholder="Deflection" id= "deflectionid" readonly="true" /> (in)
</br>
</br>
<input type= "number" name="MoB" placeholder="Mass of Beam" id= "MoB" readonly="true" /> (lbs)
</body>
</html>
Output
You can jump to the latest bin by adding /latest
to your URL
Keyboard Shortcuts
Shortcut | Action |
---|---|
ctrl + [num] | Toggle nth panel |
ctrl + 0 | Close focused panel |
ctrl + enter | Re-render output. If console visible: run JS in console |
Ctrl + l | Clear the console |
ctrl + / | Toggle comment on selected lines |
ctrl + ] | Indents selected lines |
ctrl + [ | Unindents selected lines |
tab | Code complete & Emmet expand |
ctrl + shift + L | Beautify code in active panel |
ctrl + s | Save & lock current Bin from further changes |
ctrl + shift + s | Open the share options |
ctrl + y | Archive Bin |
Complete list of JS Bin shortcuts |
JS Bin URLs
URL | Action |
---|---|
/ | Show the full rendered output. This content will update in real time as it's updated from the /edit url. |
/edit | Edit the current bin |
/watch | Follow a Code Casting session |
/embed | Create an embeddable version of the bin |
/latest | Load the very latest bin (/latest goes in place of the revision) |
/[username]/last | View the last edited bin for this user |
/[username]/last/edit | Edit the last edited bin for this user |
/[username]/last/watch | Follow the Code Casting session for the latest bin for this user |
/quiet | Remove analytics and edit button from rendered output |
.js | Load only the JavaScript for a bin |
.css | Load only the CSS for a bin |
Except for username prefixed urls, the url may start with http://jsbin.com/abc and the url fragments can be added to the url to view it differently. |