Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function fun(){
- console.log(3);
- var lfixed = document.getElementById('lfixed').checked;
- var rfixed = document.getElementById('rfixed').checked;
- var lpinned = document.getElementById('lpinned').checked;
- var rpinned = document.getElementById('rpinned').checked;
- var pointed = document.getElementById('pointed').checked;
- var uniform = document.getElementById('uniform').checked;
- console.log(3);
- var l = parseFloat(document.getElementById('length').value);
- var E = parseFloat(document.getElementById('elasticity').value);
- var I = parseFloat(document.getElementById('inertia').value);
- var a = parseFloat(document.getElementById('pos_a').value);
- var W = parseFloat(document.getElementById('weight').value);
- var x = parseFloat(document.getElementById('pos_x').value);
- var b = parseFloat(l-a);
- var d, V, M;
- console.log(3);
- if(lfixed && rfixed && pointed) {
- // V = Pb/L – P (x-a)0
- // M = Pbx/L – P (x-a)1
- // δ = P/6EI [bx3/L – abx/L (2L – a) – (x – a)3]
- // DONE
- V = W*b/l - W;
- M = W*b*x/l - W*(x-a);
- d = (W*(b*Math.pow(x,3)/l - a*b*x*(2*l-a)/l - Math.pow((x-a), 3)))/6*E*I;
- alert(V);
- alert(M);
- alert(d);
- // document.getElementById("answer").value = string(V);
- // document.getElementById("answer").innerHTML= V;
- // parseFloat(document.getElementById("answer").value) = V;
- window.open('/beam1.html');
- }
- else if(lfixed && rfixed && uniform) {
- // V = W (L/2 – x)
- // M = W/12 (6Lx – L2 – 6x2)
- // δ = wx2/24EI (L – x)2
- // DONE
- V = W*(l/2 - x);
- M = W*(6*l*x - l*l - 6*x*x);
- d = W*x*x*(l-x)*(l-x)/(24*E*I);
- alert(V);
- alert(M);
- alert(d);
- // document.getElementById("answer").value = string(V);
- // document.getElementById("answer").innerHTML= V;
- // parseFloat(document.getElementById("answer").value) = V;
- window.open('/beam2.html');
- }
- else if(lpinned && rpinned && pointed) {
- // V = Pb/L – P (x-a)0
- // M = Pbx/L – P (x-a)1
- // δ = P/6EI [bx3/L – abx/L (2L – a) – (x – a)3]
- // done
- V = W*(b/l - 1);
- M = W*(b*x/l - (x-a));
- d = W*(b*Math.pow(x,3)/l - a*b*x*(2*l - a)/l - Math.pow((x-a), 3))/(6*E*I);
- alert(V);
- alert(M);
- alert(d);
- // document.getElementById("answer").value = string(V);
- // document.getElementById("answer").innerHTML= V;
- // parseFloat(document.getElementById("answer").value) = V;
- window.open('/beam3.html');
- }
- else if(lpinned && rpinned && uniform) {
- // V = w (L/2 – x)
- // M = wx/2 (L – x)
- // δ = wx/24EI (L3 – 2 Lx2 + x3)
- // done
- V = W*(l/2 - x);
- M = W*(l/2 - x)*x/2;
- d = W*x*(l*l*l - 2*l*x*x + x*x*x)/(24*E*I);
- alert(V);
- alert(M);
- alert(d);
- // document.getElementById("answer").value = string(V);
- // document.getElementById("answer").innerHTML= V;
- // parseFloat(document.getElementById("answer").value) = V;
- window.open('/beam4.html');
- }
- else if(lpinned && rfixed && pointed) {
- // V = Pb2/2L3 (2L + a) – P(x – a)0
- // M = Pb2x/2L3(2L + a) – P (x – a)1
- // δ = P/6EI[b2x3/2L3 (2L + a) – 3ab2x/2L – (x – a)3]
- // done
- V = W*b*b*(2*l + a)/(2*l*l*l) - W;
- M = W*b*b*x*(2*l + a)/(2*l*l*l) - W*(x-a);
- d = W*((b*b*x*x*x*(2*l + a))/(2*l*l*l) - 3*a*b*b*x/(2*l) - Math.pow((x-a), 3))/(6*E*I);
- alert(V);
- alert(M);
- alert(d);
- // document.getElementById("answer").value = string(V);
- // document.getElementById("answer").innerHTML= V;
- // parseFloat(document.getElementById("answer").value) = V;
- window.open('/beam5.html');
- }
- else {
- document.write("Condotion not matched");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement