//first find deformations due to end rotation and translation var ldxSt = dxSt * c + dySt * s; //start and end displacements in local coordinates var ldySt = -dxSt * s + dySt * c; var ldxEnd = dxEnd * c + dyEnd * s; var ldyEnd = -dxEnd * s + dyEnd * c; //FOR HINGED MEMBERS, MUST ADJUST END ROTATIONS!!! if (this.hingeSt>0){rotSt=0} //adjust rotation for hinges! else(rotSt=drSt); if (this.hingeEnd>0){rotEnd=0} else(rotEnd=drEnd); var defl=new Array(); var x=0; // - use shape function: http://www.eng.fsu.edu/~chandra/courses/eml4536/ for (var i = 0; i <= lens.length-1; i++){ x=lens[i]; defl[i]=(1-3*x*x/l/l+2*x*x*x/l/l/l)*ldySt+(x-2*x*x/l+x*x*x/l/l)*rotSt+(3*x*x/l/l-2*x*x*x/l/l/l)*ldyEnd+((-1)*x*x/l+x*x*x/l/l)*rotEnd; }; //console.log("defl1: ", defl); //end deformations due to end rotation and translation //secondly find deformations due to internal forces - integrate member bending moments if (this.hingeSt!=0 ){ if (lens.length>6){mzSt=(-1)*this.getFEMs(lc)[0];} else {mzSt=0;}; }; //adjust start/end moments for hinges! if (this.hingeEnd!=0){ if(lens.length>6){mzEnd=this.getFEMs(lc)[1];} else{mzEnd=0}; }; var mei = new Array(); var defl2 = new Array(); defl2[0]=0; //console.log("mzSt: ", mzSt," mzEnd: ",mzEnd); for (var i = 0; i<=lens.length-1; i++){ //find M/EI values if (this.orientation==0){ mei[i] = (-mzSt*(1-lens[i]/l)+mzEnd*(lens[i]/l)-moments[i])/this.Ex/this.Ix;} // M/EI else{mei[i] = (-mzSt*(1-lens[i]/l)+mzEnd*(lens[i]/l)-moments[i])/this.Ex/this.Iy;}; //n.b. use fixed end moments to form M/EI values for a fixed end beam }; //console.log("mei: ",mei); var leverArm=0; var area=0 for (var i = 1; i<=lens.length-1; i++){ //apply moment-area theorem to find deflections due to member moments // http://books.google.rs/books?id=_IOw1aiAxVAC&pg=PA35&lpg=PA35&dq=moment-area+theorem+fixed+beam&source=bl&ots=QWzSEjHinJ&sig=2xCYCcNBLdrVTvfaKaGlCUomq38&hl=en&sa=X&ei=IzdhUYS6JsTf4QTd_YHYBA&redir_esc=y#v=onepage&q=moment-area%20theorem%20fixed%20beam&f=false // book Graphical Methods in Structural Analysis By D.S. Prakash and // youtube lecture: http://www.youtube.com/watch?v=BFisP060YFQ defl2[i]=0; for (var j = 1; j<=i; j++){ area=(mei[j]+mei[j-1])/2*(lens[j]-lens[j-1]); //slope = integral of M/EI = area under the M/EI diagram for a segment leverArm=lens[i]-lens[j]+(lens[j]-lens[j-1])/2; //lever arm = distance from a point along the beam to the c/l of the segment //console.log("liverArm: ",Math.round(leverArm*10)/10,"area: ",area); defl2[i]=defl2[i] + area * leverArm; //and finally deflection equals integral of slope = second integral of M/EI = area of the segment x lever arm }; }; //end deformations due to internal forces //REPEAT FOR OUT-OF-PLANE DEFORMATIONS! //first find deformations due to end rotation and translation //n.b. no rotation of end deflections required because beam lies in x-y plane! if (this.hingeSt>0){rotSt=0} //adjust rotation for hinges! else{rotSt=-drzSt}; if (this.hingeEnd>0){rotEnd=0} //will need to be tackled further! else{rotEnd=-drzEnd}; //rotSt=-drzSt;rotEnd=-drzEnd; var deflY=new Array(); //dzSt=-dzSt; //dzEnd=-dzEnd; //console.log("rotZst:",rotSt, "ZdeflSt:", dzSt, "rotZEnd:",rotEnd, "ZdeflEnd:", dzEnd); var x=0; // - use shape function: http://www.eng.fsu.edu/~chandra/courses/eml4536/ for (var i = 0; i <= lens.length-1; i++){ x=lens[i]; deflY[i]=(1-3*x*x/l/l+2*x*x*x/l/l/l)*dzSt+(x-2*x*x/l+x*x*x/l/l)*rotSt+(3*x*x/l/l-2*x*x*x/l/l/l)*dzEnd+((-1)*x*x/l+x*x*x/l/l)*rotEnd; }; //console.log("deflY:", deflY); //end deformations due to end rotation and translation //secondly find deformations due to internal forces - integrate member bending moments FOR OUT OF PLANE MOMENTS //console.log(this.getFEMs(lc)[1]); if (this.hingeSt!=0 ){ if (lens.length>6){mySt=(-1)*this.getFEMs(lc)[2];} else {mySt=0;}; }; //adjust start/end moments for hinges! if (this.hingeEnd!=0){ if(lens.length>6){myEnd=this.getFEMs(lc)[3];} else{myEnd=0}; }; var mei = new Array(); var deflY2 = new Array(); deflY2[0]=0; //console.log("mzSt: ", mySt," mzEnd: ",myEnd); //console.log("momentsY",momentsY); for (var i = 0; i<=lens.length-1; i++){ //find M/EI values if (this.orientation==0){ mei[i] = (-mySt*(1-lens[i]/l)+myEnd*(lens[i]/l)-momentsY[i])/this.Ex/this.Iy;} // M/EI else{mei[i] = (-mySt*(1-lens[i]/l)+myEnd*(lens[i]/l)-momentsY[i])/this.Ex/this.Ix;}; //n.b. use fixed end moments to form M/EI values for a fixed end beam }; //console.log("mei: ",mei); var leverArm=0; var area=0 for (var i = 1; i<=lens.length-1; i++){ //apply moment-area theorem to find deflections due to member moments // http://books.google.rs/books?id=_IOw1aiAxVAC&pg=PA35&lpg=PA35&dq=moment-area+theorem+fixed+beam&source=bl&ots=QWzSEjHinJ&sig=2xCYCcNBLdrVTvfaKaGlCUomq38&hl=en&sa=X&ei=IzdhUYS6JsTf4QTd_YHYBA&redir_esc=y#v=onepage&q=moment-area%20theorem%20fixed%20beam&f=false // book Graphical Methods in Structural Analysis By D.S. Prakash and // youtube lecture: http://www.youtube.com/watch?v=BFisP060YFQ deflY2[i]=0; for (var j = 1; j<=i; j++){ area=(mei[j]+mei[j-1])/2*(lens[j]-lens[j-1]); //slope = integral of M/EI = area under the M/EI diagram for a segment leverArm=lens[i]-lens[j]+(lens[j]-lens[j-1])/2; //lever arm = distance from a point along the beam to the c/l of the segment //console.log("liverArm: ",Math.round(leverArm*10)/10,"area: ",area); deflY2[i]=deflY2[i] + area * leverArm; //and finally deflection equals integral of slope = second integral of M/EI = area of the segment x lever arm }; }; //end deformations due to internal forces