(*^ ::[ fontset = title, "Helv", 22, L0, center, nohscroll, bold; fontset = subtitle, "Helv", 18, L0, center, nohscroll, bold; fontset = subsubtitle, "Helv", 12, L0, center, nohscroll, bold; fontset = section, "Helv", 12, L0, bold, grayBox; fontset = subsection, "Helv", 12, L0, bold, blackBox; fontset = subsubsection, "Helv", 10, L0, bold, whiteBox; fontset = text, "Helv", 12, L0; fontset = smalltext, "Helv", 10, L0; fontset = input, "Courier", 12, L0, nowordwrap; fontset = output, "Courier", 12, L0, nowordwrap; fontset = message, "Courier", 10, L0, nowordwrap, R65280; fontset = print, "Courier", 10, L0, nowordwrap; fontset = info, "Courier", 10, L0, nowordwrap; fontset = postscript, "Courier", 10, L0, nowordwrap; fontset = name, "Helv", 10, L0, nohscroll, italic, B65280; fontset = header, "Helv", 18, L0, nohscroll, bold; fontset = footer, "Helv", 18, L0, center, nohscroll, bold; fontset = help, "Helv", 10, L0, nohscroll; fontset = clipboard, "Helv", 12, L0, nohscroll; fontset = completions, "Helv", 12, L0, nowordwrap, nohscroll; fontset = network, "Courier", 10, L0, nowordwrap, nohscroll; fontset = graphlabel, "Courier", 10, L0, nowordwrap, nohscroll; fontset = special1, "Helv", 12, L0, nowordwrap, nohscroll; fontset = special2, "Helv", 12, L0, center, nowordwrap, nohscroll; fontset = special3, "Helv", 12, L0, right, nowordwrap, nohscroll; fontset = special4, "Helv", 12, L0, nowordwrap, nohscroll; fontset = special5, "Helv", 12, L0, nowordwrap, nohscroll; fontset = Left Header, "Helv", 12, L0, nowordwrap, nohscroll; fontset = Left Footer, "Helv", 12, L0, nowordwrap, nohscroll;] :[font = subtitle; inactive; ] 1. PRE-PROCESSING ;[s] 2:0,1;22,0;23,-1 2:1,24,19,Helv,1,18,0,0,0;1,24,19,Helv,1,18,0,0,0; :[font = subsection; inactive; ] The Pre-Processing involve the building up of finite element model by nodal coordinates, user have to prepare nodal and element listing in order to be read in by program. Table of nodal and elemental listing will be produced for user to counter check. Nodal plot in colour will be displayed as well, shape functions, element properties could be read in for pre-processing. :[font = subsubtitle; inactive; ] 1.1 Input Packages ;[s] 2:0,1;22,0;23,-1 2:1,16,13,Helv,1,12,0,0,0;1,16,13,Helv,1,12,0,0,0; :[font = input; ] <{Automatic, {"X - Coord","Y - Coord"}}]] >> resfile.m; :[font = subsubtitle; inactive; ] 1.3 Reading in and tablution of Element Connectivity ;[s] 2:0,1;58,0;59,-1 2:1,16,13,Helv,1,12,0,0,0;1,16,13,Helv,1,12,0,0,0; :[font = input; endGroup; ] ReadElem["elem"]; OutputForm[TableForm[elem,TableHeadings->{Automatic, {"Node - 1","Node -2","Node - 3","Node - 4"}}]] >>>resfile.m :[font = subsubtitle; inactive; ] 1.4 Reading in Shape Functions, Elasticity Matrix ;[s] 2:0,1;54,0;55,-1 2:1,16,13,Helv,1,12,0,0,0;1,16,13,Helv,1,12,0,0,0; :[font = input; ] (* Reading in Shape Functions -- dkl *) <>>resfile.m OutputForm[MatrixForm[dpss]]>>>resfile.m :[font = subsubtitle; inactive; ] 1.5 Generation and Assembly of Stiffness Matrix ;[s] 2:0,1;51,0;52,-1 2:1,16,13,Helv,1,12,0,0,0;1,16,13,Helv,1,12,0,0,0; :[font = input; ] FormGlobalStifMat[] :[font = subsubtitle; inactive; ] 1.6 Specification of Boundary Conditions ;[s] 2:0,1;40,0;41,-1 2:1,16,13,Helv,1,12,0,0,0;1,16,13,Helv,1,12,0,0,0; :[font = input; ] (* Reading in Displacement and Mechanical Boundary conditions *) ReadDispAnsys["disp"]; ReadLoadAnsys["load"]; paload=Table[0,{i,totdof},{j,1}]; dadisp=Table[0,{i,totdof},{j,1}]; :[font = input; ] ApplyDispAnsys[]; ApplyLoadAnsys[]; :[font = subsubtitle; inactive; ] 1.7 Nodal Plot and Element Plot ;[s] 2:0,1;34,0;35,-1 2:1,16,13,Helv,1,12,0,0,0;1,16,13,Helv,1,12,0,0,0; :[font = input; ] (* Routine to do element plot *) ModelPlot2D[elem, co, ielem, inode, nnode]; :[font = input; ] ModelMesh2D[elem, co, ielem, inode, nnode]; :[font = subtitle; inactive; ] 2. SOLUTION PHASE ;[s] 2:0,1;20,0;21,-1 2:1,24,19,Helv,1,18,0,0,0;1,24,19,Helv,1,18,0,0,0; :[font = subsection; inactive; ] In this phase, the assembled stiffness matrix with the known boundary conditions are called into user programmed routine to solve for the displacement unknowns. Gauss Elimination Method is used for the solution of simultaneous equations. Pivoting and row interchange procedures are used to treat ill-conditioned matrix. :[font = input; ] SolutionLinear[]; :[font = subtitle; inactive; ] 3. POST-PROCESSING ;[s] 2:0,1;18,0;19,-1 2:1,24,19,Helv,1,18,0,0,0;1,24,19,Helv,1,18,0,0,0; :[font = subsection; inactive; ] Post-Processing involved the print out of displacement and stress values of the analysis. Displacement plots are produced to give a better picture of final shape with magnification factor adjustable. :[font = subsubtitle; inactive; ] 3.1 Stress Computation and Print-out ;[s] 2:0,1;38,0;39,-1 2:1,16,13,Helv,1,12,0,0,0;1,16,13,Helv,1,12,0,0,0; :[font = input; ] StressCompu[];x=.;y=.; :[font = input; ] StressFunction[]; :[font = subsubtitle; inactive; ] 3.2 New coordinates and Print-out ;[s] 2:0,1;37,0;38,-1 2:1,16,13,Helv,1,12,0,0,0;1,16,13,Helv,1,12,0,0,0; :[font = input; ] newco=Table[0,{i,inode},{j,2}]; (* Set displacement manification *) mag=1.; Do[newco[[i,1]]=co[[i,1]]+dadisp[[i*2-1,1]]*mag; newco[[i,2]]=co[[i,2]]+dadisp[[i*2,1]]*mag; ,{i,inode}]; OutputForm[TableForm[newco-co,TableHeadings-> {Automatic,{"X - Disp", "Y - Disp"}}]] >>> resfile.m :[font = subsubtitle; inactive; ] 3.3 Displacement Plots ;[s] 2:0,1;22,0;23,-1 2:1,16,13,Helv,1,12,0,0,0;1,16,13,Helv,1,12,0,0,0; :[font = input; ] DispPlot2D[elem,newco,ielem,inode,nnode]; :[font = input; ] Show[pldisp,wiremesh,AspectRatio->Automatic]; :[font = subsubtitle; inactive; ] 3.4 Stress Plots ;[s] 2:0,1;16,0;17,-1 2:1,16,13,Helv,1,12,0,0,0;1,16,13,Helv,1,12,0,0,0; :[font = input; ] Plnssx[] :[font = input; ] Show[%,wiremesh,Frame->False] :[font = input; ] Plnssy[] :[font = input; ] Show[%,wiremesh,Frame->False] :[font = input; ] Plnssxy[] :[font = input; ] Show[%,wiremesh,Frame->False] :[font = subsubtitle; inactive; ] 3.5 Stress at Locations within Model ;[s] 2:0,1;38,0;39,-1 2:1,16,13,Helv,1,12,0,0,0;1,16,13,Helv,1,12,0,0,0; :[font = input; ] StressAtLocation[1.,2.] :[font = subtitle; inactive; ] 4. THEORETICAL COMPARISION ;[s] 2:0,1;28,0;29,-1 2:1,24,19,Helv,1,18,0,0,0;1,24,19,Helv,1,18,0,0,0; :[font = subsection; inactive; ] From the theory of beam bending, the stress at node 8 could be calculated through the following formulae : Moment at node 7 = M = force x distance = 5 x 10 Nm = 50 Nm Stress = ( M * y) / I where y = 1 m and I = (b d^3) / 12 = 0.6666 m^4 Theoretical Stress = ( 50 * 1 ) / 0.6666 N/m^2 = 75 N/m^2 :[font = input; ] theorystress=75;polystress=xpoly[0.,2.]; errorstress1=(75 - calstress )*100/(75); errorstress2=(75 - polystress )*100/(75); :[font = input; ] TableForm[{{theorystress,calstress,errorstress1, polystress,errorstress2}}, TableHeadings -> {{"Node 8"}, {"Theoy Stress", "Cal. Stress","% of Error","Poly. Stress","% of Error"}}] :[font = input; ] ^*)