(************** Content-type: application/mathematica ************** CreatedBy='Mathematica 4.2' Mathematica-Compatible Notebook This notebook can be used with any Mathematica-compatible application, such as Mathematica, MathReader or Publicon. The data for the notebook starts with the line containing stars above. To get the notebook into a Mathematica-compatible application, do one of the following: * Save the data starting with the line of stars above into a file with a name ending in .nb, then open the file inside the application; * Copy the data starting with the line of stars above to the clipboard, then use the Paste menu command inside the application. Data for notebooks contains only printable 7-bit ASCII and can be sent directly in email or through ftp in text mode. Newlines can be CR, LF or CRLF (Unix, Macintosh or MS-DOS style). NOTE: If you modify the data for this notebook not in a Mathematica- compatible application, you must delete the line below containing the word CacheID, otherwise Mathematica-compatible applications may try to use invalid cache data. For more information on notebooks and Mathematica-compatible applications, contact Wolfram Research: web: http://www.wolfram.com email: info@wolfram.com phone: +1-217-398-0700 (U.S.) Notebook reader applications are available free of charge from Wolfram Research. *******************************************************************) (*CacheID: 232*) (*NotebookFileLineBreakTest NotebookFileLineBreakTest*) (*NotebookOptionsPosition[ 38255, 809]*) (*NotebookOutlinePosition[ 39354, 844]*) (* CellTagsIndexPosition[ 39310, 840]*) (*WindowFrame->Normal*) Notebook[{ Cell[TextData[{ StyleBox["Instructions:\n1. Execute Cells 1 through 7 in that order \ (twice each if you want to get rid of \n annoying warning messages) to \ initialize all necessary modules. \n Shortcut for ", FontFamily->"Palatino"], StyleBox["Mathematica 4.0 or 5.0 ", FontFamily->"Palatino", FontSlant->"Italic"], StyleBox[" users: select \n Kernel ->Evaluation->Evaluate \ Initialization \n To check individual cells, run test code (blue) for \ that cell only.\n2. Cell 8 contains the driver program script for the \ bridge truss example. \n Run by selecting the cell and executing.\n3. \ Execute Cell 8A to generate deformed shape plot frames. Animate by double\n \ clicking one of the frames. Animation speed may be controlled by the \ playback\n button controls on the left side of the bottom window bar.\n4. \ If the plots produced by running a program appear too small, click \n \ on the top one (only) with the mouse, grap a corner \"handle\" and \ enlarge it. \n Then rerun the program. \n5. To prepare a problem \ driver for the homework, open up a new cell, say 9,\n and write the \ script using Cell 8 as \"template\". Don't try to do the whole\n thing \ at once. Write a few statements and run the script up to that point\n \ (before running don't forget to have initialized Cells 1-7 as indicated \ above).\n Examine output and resolve error messages (if any) before \ proceeding.\n ", FontFamily->"Palatino"] }], "Text", CellFrame->True, CellMargins->{{17, 19}, {Inherited, Inherited}}, CellLabelMargins->{{10, Inherited}, {Inherited, Inherited}}, ImageRegion->{{-0, 1}, {0, 1}}, Background->RGBColor[0.896483, 0.770001, 1]], Cell[TextData[{ StyleBox[" ", FontFamily->"Palatino"], "Cell 0. Mathematica version-dependent settings (to get plots displayed \ correctly)" }], "Text", CellFrame->True, CellMargins->{{17, 19}, {Inherited, Inherited}}, CellLabelMargins->{{10, Inherited}, {Inherited, Inherited}}, ImageRegion->{{-0, 1}, {0, 1}}, Background->RGBColor[1, 1, 0]], Cell[CellGroupData[{ Cell["\<\ DisplayChannel=$DisplayFunction; If [$VersionNumber>=6.0, DisplayChannel=Print]; (* fix for Mathematica 6 & later *)\ \>", "Input", CellFrame->True, CellMargins->{{17, 19}, {Inherited, Inherited}}, InitializationCell->True, CellLabelMargins->{{10, Inherited}, {Inherited, Inherited}}, ImageRegion->{{-0, 1}, {0, 1}}, Background->RGBColor[0, 1, 0]], Cell["\<\ Cell 1. Assembly module for space truss structure. The element \ stiffness module that supports the assembler has been described in Chapter 20.\ \>", "Text", CellFrame->True, CellMargins->{{17, 19}, {Inherited, Inherited}}, CellLabelMargins->{{10, Inherited}, {Inherited, Inherited}}, ImageRegion->{{-0, 1}, {0, 1}}, Background->RGBColor[1, 1, 0]], Cell[TextData[{ "\nSpaceTrussMasterStiffness[nodxyz_,elenod_,\n \ elemat_,elefab_,prcopt_]:=Module[\n \ {numele=Length[elenod],numnod=Length[nodxyz],neldof,\n \ e,eftab,ni,nj,i,j,ii,jj,ncoor,Em,A,options,Ke,K},\n \ K=Table[0,{3*numnod},{3*numnod}];\n For [e=1, e<=numele, e++, \ {ni,nj}=elenod[[e]]; \n eftab={3*ni-2,3*ni-1,3*ni,3*nj-2,3*nj-1,3*nj};", StyleBox[" ", FontColor->RGBColor[1, 0, 0]], "\n ncoor={nodxyz[[ni]],nodxyz[[nj]]}; ", StyleBox[" ", FontColor->RGBColor[1, 0, 0]], " \n Em=elemat[[e]]; A=elefab[[e]]; options=prcopt; \n \ Ke=SpaceBar2Stiffness[ncoor,Em,A,options];\n neldof=Length[Ke];\n \ For [i=1, i<=neldof, i++, ii=eftab[[i]];\n For [j=i, j<=neldof, j++, \ jj=eftab[[j]];\n K[[jj,ii]]=K[[ii,jj]]+=Ke[[i,j]] ];\n \ ];\n ]; Return[K];\n ];\n\ SpaceBar2Stiffness[ncoor_,Em_,A_,options_]:=Module[\n \ {x1,x2,y1,y2,z1,z2,x21,y21,z21,EA,numer,L,LL,LLL,Ke},", StyleBox[" ", FontColor->RGBColor[1, 0, 0]], "\n {{x1,y1,z1},{x2,y2,z2}}=ncoor; {x21,y21,z21}={x2-x1,y2-y1,z2-z1};\n \ EA=Em*A; {numer}=options; LL=x21^2+y21^2+z21^2; L=Sqrt[LL];\n If \ [numer,{x21,y21,z21,EA,LL,L}=N[{x21,y21,z21,EA,LL,L}]];\n If [!numer, \ L=PowerExpand[L]]; LLL=Simplify[LL*L];\n Ke=(Em*A/LLL)*\n {{ x21*x21, \ x21*y21, x21*z21,-x21*x21,-x21*y21,-x21*z21},\n { y21*x21, y21*y21, \ y21*z21,-y21*x21,-y21*y21,-y21*z21},\n { z21*x21, z21*y21, \ z21*z21,-z21*x21,-z21*y21,-z21*z21},\n {-x21*x21,-x21*y21,-x21*z21, \ x21*x21, x21*y21, x21*z21},\n {-y21*x21,-y21*y21,-y21*z21, y21*x21, \ y21*y21, y21*z21},\n {-z21*x21,-z21*y21,-z21*z21, z21*x21, z21*y21, \ z21*z21}};\n Return[Ke]];\n \n", StyleBox["ClearAll[nodxyz,elemat,elefab,eleopt];\n\ nodxyz={{0,0,0},{10,0,0},{10,10,0}};\nelenod= {{1,2},{2,3},{1,3}};\nelemat= \ Table[100,{3}]; elefab= {1,1/2,2*Sqrt[2]}; prcopt= {False};\n\ K=SpaceTrussMasterStiffness[nodxyz,elenod,elemat,elefab,prcopt];\n\ Print[\"Master Stiffness of Example Truss in 3D:\\n\",K//MatrixForm];\nPrint[\ \"eigs of K:\",Chop[Eigenvalues[N[K]]]]; ", FontColor->RGBColor[0, 0, 1]] }], "Input", CellFrame->True, CellMargins->{{17, 19}, {Inherited, Inherited}}, InitializationCell->True, CellLabelMargins->{{10, Inherited}, {Inherited, Inherited}}, ImageRegion->{{-0, 1}, {0, 1}}, Background->RGBColor[0, 1, 0]] }, Open ]], Cell["\<\ Cell 2. These modules apply the displacement boundary conditions \ by modifying the force vector and the master stiffness matrix. This implementation of \ ModifyNodeForces handles nonzero prescribed displacements.\ \>", "Text", CellFrame->True, CellMargins->{{17, 19}, {Inherited, Inherited}}, CellLabelMargins->{{10, Inherited}, {Inherited, Inherited}}, ImageRegion->{{-0, 1}, {0, 1}}, Background->RGBColor[1, 1, 0]], Cell[TextData[{ "ModifiedMasterStiffness[nodtag_,K_] := Module[\n \ {i,j,k,n=Length[K],pdof,np,Kmod=K},\n pdof=PrescDisplacementDOFTags[nodtag]; \ np=Length[pdof];\n For [k=1,k<=np,k++, i=pdof[[k]]; \n For \ [j=1,j<=n,j++, Kmod[[i,j]]=Kmod[[j,i]]=0];\n Kmod[[i,i]]=1]; \n \ Return[Kmod]]; \n \nModifiedNodeForces[nodtag_,nodval_,K_,f_]:= Module[\n \ {i,j,k,n=Length[K],pdof,pval,np,d,c,fmod=f},\n \ pdof=PrescDisplacementDOFTags[nodtag]; np=Length[pdof];\n \ pval=PrescDisplacementDOFValues[nodtag,nodval]; c=Table[1,{n}]; \n For \ [k=1,k<=np,k++, i=pdof[[k]]; c[[i]]=0];\n For [k=1,k<=np,k++, i=pdof[[k]]; \ d=pval[[k]]; \n fmod[[i]]=d; If [d==0, Continue[]];\n For \ [j=1,j<=n,j++, fmod[[j]]-=K[[i,j]]*c[[j]]*d]; \n ]; \n Return[fmod]];\n\ \nPrescDisplacementDOFTags[nodtag_]:= Module [\n \ {j,n,numnod=Length[nodtag],pdof={},k=0,m},\n For [n=1,n<=numnod,n++, \ m=Length[nodtag[[n]]];\n For [j=1,j<=m,j++, If [nodtag[[n,j]]>0, \n \ AppendTo[pdof,k+j]];\n ]; k+=m;\n ]; Return[pdof]]; \n \ \nPrescDisplacementDOFValues[nodtag_,nodval_]:= Module [\n \ {j,n,numnod=Length[nodtag],pval={},k=0,m},\n For [n=1,n<=numnod,n++, \ m=Length[nodtag[[n]]];\n For [j=1,j<=m,j++, If [nodtag[[n,j]]>0, \n \ AppendTo[pval,nodval[[n,j]]]];\n ]; k+=m;\n ]; \ Return[pval]];\n\n", StyleBox["ClearAll[K,f,v1,v2,v4]; Km=Array[K,{6,6}];\nPrint[\"Master \ Stiffness: \",Km//MatrixForm];\nnodtag={{1,1},{0,1},{0,0}}; \ nodval={{v1,v2},{0,v4},{0,0}};\nKmod=ModifiedMasterStiffness[nodtag,Km];\n\ Print[\"Modified Master Stiffness:\",Kmod//MatrixForm];\nfm=Array[f,{6}]; \ Print[\"Master Force Vector:\",fm];\n\ fmod=ModifiedNodeForces[nodtag,nodval,Km,fm];\nPrint[\"Modified Force Vector:\ \",fmod//MatrixForm];\n\n(*nodtag= {{0,1,0},{0,0,0},{1,0,1},{0,1,1},{0,0,1}};\ \nnodval=-{{1,2,3},{4,5,6},{7,8,9},{10,11,12},{13,14,15}};\n\ Print[PrescDisplacementDOFTags[nodtag]];\n\ Print[PrescDisplacementDOFValues[nodtag,nodval]];*)", FontColor->RGBColor[0, 0, 1]] }], "Input", CellFrame->True, CellMargins->{{17, 19}, {Inherited, Inherited}}, InitializationCell->True, CellLabelMargins->{{10, Inherited}, {Inherited, Inherited}}, ImageRegion->{{-0, 1}, {0, 1}}, Background->RGBColor[0, 1, 0]], Cell["\<\ Cell 3. Computation of internal forces (axial forces) for all \ elements of a space truss, from the computed nodal displacements.\ \>", "Text", CellFrame->True, CellMargins->{{17, 19}, {Inherited, Inherited}}, CellLabelMargins->{{10, Inherited}, {Inherited, Inherited}}, ImageRegion->{{-0, 1}, {0, 1}}, Background->RGBColor[1, 1, 0]], Cell[TextData[{ "SpaceTrussIntForces[nodxyz_,elenod_,elemat_,elefab_,\n noddis_,prcopt_]:= \ Module[{ numnod=Length[nodxyz],\n \ numele=Length[elenod],e,ni,nj,ncoor,Em,A,options,ue,p},\n \ p=Table[0,{numele}]; \n For [e=1, e<=numele, e++, {ni,nj}=elenod[[e]]; \n \ ncoor={nodxyz[[ni]],nodxyz[[nj]]}; \n ue=Flatten[{ \ noddis[[ni]],noddis[[nj]] }]; ", StyleBox[" ", FontColor->RGBColor[1, 0, 0]], " \n Em=elemat[[e]]; A=elefab[[e]]; options=prcopt; \n \ p[[e]]=SpaceBar2IntForce[ncoor,Em,A,ue,options]\n ]; \n Return[p]];\n\n\ SpaceBar2IntForce[ncoor_,Em_,A_,ue_,options_]:= Module[ \n \ {x1,x2,y1,y2,z1,z2,x21,y21,z21,EA,numer,LL,pe},", StyleBox[" ", FontColor->RGBColor[1, 0, 0]], "\n {{x1,y1,z1},{x2,y2,z2}}=ncoor; {x21,y21,z21}={x2-x1,y2-y1,z2-z1};\n \ EA=Em*A; {numer}=options; LL=x21^2+y21^2+z21^2;\n If \ [numer,{x21,y21,z21,EA,LL}=N[{x21,y21,z21,EA,LL}]];\n \ pe=(EA/LL)*(x21*(ue[[4]]-ue[[1]])+y21*(ue[[5]]-ue[[2]])+\n \ +z21*(ue[[6]]-ue[[3]]));\n Return[pe]]; \n \n\ SpaceTrussStresses[elefab_,elefor_,prcopt_]:= Module[\n \ {numele=Length[elefab],e,elesig}, elesig=Table[0,{numele}]; \n For [e=1, \ e<=numele, e++, elesig[[e]]=elefor[[e]]/elefab[[e]] ];\n Return[elesig]]; \n\ ", StyleBox["\nClearAll[nodxyz,elenod,elemat,elefab,noddis];\n\ nodxyz={{0,0,0},{10,0,0},{10,10,0}}; elenod={{1,2},{2,3},{1,3}};\nelemat= \ Table[100,{3}]; elefab= {1,1/2,2*Sqrt[2]};\nnoddis={{0,0,0}, {0,0,0}, \ {4/10,-2/10,0}}; prcopt={False};\n\ elefor=SpaceTrussIntForces[nodxyz,elenod,elemat,elefab,noddis,prcopt];\n\ Print[\"Int Forces of Example Truss:\",elefor];\n\ Print[\"Stresses:\",SpaceTrussStresses[elefab,elefor,prcopt]];", FontColor->RGBColor[0, 0, 1]] }], "Input", CellFrame->True, CellMargins->{{17, 19}, {Inherited, Inherited}}, InitializationCell->True, CellLabelMargins->{{10, Inherited}, {Inherited, Inherited}}, ImageRegion->{{-0, 1}, {0, 1}}, Background->RGBColor[0, 1, 0]], Cell["\<\ Cell 4 has groups plot modules that support preprocessing, that \ is, draw pictures of the FEM model. Modules to plot loads and BCs removed to keep it short. \ PlotSpaceTrussElements draws only the element (bars) without any labels. PlotSpaceTrussElementsAndNodes draws \ elements and nodes, and optionally labels them.\ \>", "Text", CellFrame->True, CellMargins->{{17, 19}, {Inherited, Inherited}}, CellLabelMargins->{{10, Inherited}, {Inherited, Inherited}}, ImageRegion->{{-0, 1}, {0, 1}}, Background->RGBColor[1, 1, 0]], Cell[TextData[{ "WorldToScreenMatrix[view_]:=Module[{VW={{0,1,0},{0,0,1}},\n \ Vx,Vy,Vz,Wx,Wy,Wz,xden,yden,Q}, \n If [Length[view]==2, VW=view];\n If \ [Length[view]==3, VW[[2]]=view];\n {{Vx,Vy,Vz},{Wx,Wy,Wz}}=VW;\n \ xden=Sqrt[Wz^2*(Vx^2+Vy^2)-2*Wx*Wz*Vx*Vz-\n \ 2*Wy*Vy*(Wx*Vx+Wz*Vz)+Wy^2*(Vx^2+Vz^2)+Wx^2*(Vy^2+Vz^2)];\n \ yden=Sqrt[(Wx^2+Wy^2+Wz^2)*(Wz^2*(Vx^2+Vy^2)-2*Wx*Wz*Vx*Vz-\n \ 2*Wy*Vy*(Wx*Vx+Wz*Vz)+Wy^2*(Vx^2+Vz^2)+Wx^2*(Vy^2+Vz^2))];\n Q=\ \[InvisibleSpace]\[InvisibleSpace]{{Wz*Vy-Wy*Vz,-Wz*Vx+Wx*Vz,Wy*Vx-Wx*Vy}/\ xden, \n {Wy^2*Vx-Wx*Wy*Vy+Wz*(Wz*Vx-Wx*Vz),-Wx*Wy*Vx+Wx^2*Vy+ \n \ Wz*(Wz*Vy-Wy*Vz),-Wz*(Wx*Vx+Wy*Vy)+(Wx^2+Wy^2)*Vz}/yden};\n Return[Q]];\n\n\ PlotSpaceTrussElements[nodxyz_,elenod_,title_,{view_,aspect_,labels_}]:= \n \ Module[{numnod=Length[nodxyz],numele=Length[elenod],\n \ e,n,ni,nj,Q,x,y,xmin,xmax,ymin,ymax,dx,dy,xyc,ar,pbars={}},\n \ x=y=Table[0,{numnod}]; Q=WorldToScreenMatrix[view];\n For \ [n=1,n<=numnod,n++, {x[[n]],y[[n]]}=Q.nodxyz[[n]] ];\n \ {xmin,xmax,ymin,ymax}=N[{Min[x],Max[x],Min[y],Max[y]}];\n \ {dx,dy}={xmax-xmin,ymax-ymin};\n For [e=1,e<=numele,e++, \ {ni,nj}=elenod[[e]]; \n xyc={{x[[ni]],y[[ni]]},{x[[nj]],y[[nj]]}}; \ \n AppendTo[pbars,Graphics[Line[xyc]]]\n ];\n \ arat=AspectRatio->Automatic; If [aspect>0, arat=AspectRatio->aspect];\n If \ [aspect==0&&dx>0, arat=AspectRatio->dy/dx];\n \ Show[Graphics[AbsoluteThickness[2]],\n Graphics[RGBColor[0,0,0]],\n \ pbars, arat, PlotLabel->title,\n DisplayFunction->DisplayChannel ];\n \ ClearAll[pbars];\n ];\n\n\ PlotSpaceTrussElementsAndNodes[nodxyz_,elenod_,title_,\n \ {view_,aspect_,labels_}]:= Module[{numnod=Length[nodxyz],\n \ numele=Length[elenod],k=Length[labels],e,n,ni,nj,Q,x,y,xyc,\n \ xy0,xyn,xmin,xmax,ymin,ymax,elabels,nlabels,fntinfo,\n \ labnod,frn,fex,fey,labele,fre,fntnam,fntsiz,fntwgt,fntslt,\n \ black,red,green,blue,yellow,fill,grey,nofill,arat,\n \ style,dx,dy,dmin,rn,re,ex,ey,elab,nlab,pbars={},\n \ pecirc={},pelab={},pedisk={},pncirc={},pndisk={},pnlab={} },\n \ x=y=Table[0,{numnod}]; Q=WorldToScreenMatrix[view];\n \ {labnod,frn,fex,fey,labele,fre,fntnam,fntsiz,fntwgt,fntslt}=\n \ {True,0.03,-1.5,0.8,True,0.03,\"Times\",12,\"Plain\",\"Plain\"}; \n If \ [k>=1, nlabels=labels[[1]] ]; \n If [k>=2, elabels=labels[[2]] ];\n If \ [k>=3, fntinfo=labels[[3]] ];\n If [Length[nlabels]>=1, labnod=nlabels[[1]] \ ];\n If [Length[nlabels]>=2, frn= nlabels[[2]] ];\n If \ [Length[nlabels]>=3, fex= nlabels[[3]] ];\n If [Length[nlabels]>=4, fey= \ nlabels[[4]] ];\n If [Length[elabels]>=1, labele=elabels[[1]] ];\n If \ [Length[elabels]>=2, fre= elabels[[2]] ];\n If [Length[fntinfo]>=1, \ fntnam=fntinfo[[1]] ];\n If [Length[fntinfo]>=2, fntsiz=fntinfo[[2]] ];\n \ If [Length[fntinfo]>=3, fntwgt=fntinfo[[3]] ];\n If [Length[fntinfo]>=4, \ fntslt=fntinfo[[4]] ];\n For [n=1,n<=numnod,n++, \ {x[[n]],y[[n]]}=Q.nodxyz[[n]] ];\n \ {xmin,xmax,ymin,ymax}=N[{Min[x],Max[x],Min[y],Max[y]}];\n \ {dx,dy}={xmax-xmin,ymax-ymin}; dmin=Min[dx,dy];\n rn=frn*dmin; re=fre*dmin;\n\ style=TextStyle->{FontFamily->fntnam,FontSize-> fntsiz,\n \ FontWeight->fntwgt,FontSlant->fntslt};\n For [e=1,e<=numele,e++, \ {ni,nj}=elenod[[e]]; \n xyc={{x[[ni]],y[[ni]]},{x[[nj]],y[[nj]]}};\n \ xy0=(xyc[[1]]+xyc[[2]])/2;\n AppendTo[pbars,Graphics[Line[xyc]]];\n \ If [labele, elab=ToString[e];\n AppendTo[pedisk, \ Graphics[Disk[xy0,re]]]; \n AppendTo[pecirc, \ Graphics[Circle[xy0,re]]];\n AppendTo[pelab, \ Graphics[Text[elab,xy0-{0,0.2*re},style]]]\n ];\n ];\n \ style=TextStyle->{FontFamily->fntnam,FontSize-> fntsiz,\n \ FontWeight->\"Bold\",FontSlant->\"Plain\"};\n For [n=1,n<=numnod,n++, \ xyn={x[[n]],y[[n]]}; \n AppendTo[pndisk, Graphics[Disk[xyn,rn]]];\n \ AppendTo[pncirc, Graphics[Circle[xyn,rn]]];\n If [labnod, \ nlab=ToString[n]; xy0=xyn+{fex,fey}*rn; \n AppendTo[pnlab, \ Graphics[Text[nlab,xy0,style]]]];\n ]; \n \ {black,red,green,blue,yellow}={RGBColor[0,0,0],RGBColor[1,0,0],\n \ RGBColor[0,1,0],RGBColor[0,0,1],RGBColor[1,1,0]};\n \ {nofill,grey,fill}={GrayLevel[0],GrayLevel[.8],GrayLevel[1]};\n \ arat=AspectRatio->Automatic; \n If [aspect>0, arat=AspectRatio->aspect];\n \ If [aspect==0&&dx>0, arat=AspectRatio->dy/dx];\n \ Show[Graphics[nofill],Graphics[AbsoluteThickness[3]],\n \ Graphics[red],pbars, Graphics[AbsoluteThickness[1]],\n \ Graphics[fill],pndisk, Graphics[nofill],pncirc, \n Graphics[yellow], \ pedisk, Graphics[nofill], \n Graphics[black], pecirc, pelab, pnlab,\n \ arat, PlotLabel->title,\n DisplayFunction->DisplayChannel ];\n \ ClearAll[pbars,pndisk,pncirc,pedisk,pecirc,pelab];\n ];\n \n", StyleBox["nodxyz={{0,0,0},{10,5,0},{10,0,0},{20,8,0},{20,0,0},{30,9,0},\n \ {30,0,0},{40,8,0},{40,0,0},{50,5,0},{50,0,0},{60,0,0}};\n\ nodxyz=N[nodxyz];\nelenod={{1,3},{3,5},{5,7},{7,9},{9,11},{11,12},\n \ {1,2},{2,4},{4,6},{6,8},{8,10},{10,12},\n \ {2,3},{4,5},{6,7},{8,9},{10,11},\n {2,5},{4,7},{7,8},{9,10}};\n\ view={{0,1,0},{0,0,1}}; \nPlotSpaceTrussElements[nodxyz,elenod,\"plain \ mesh\",{view,0,{}}];\nlabels={{True,0.05,-1.8,1.8},{True,0.10},{\"Times\",12,\ \"Plain\",\"Italic\"}};\nPlotSpaceTrussElementsAndNodes[nodxyz,elenod,\"mesh \ with labels\",{view,-1,labels}];", FontColor->RGBColor[0, 0, 1]] }], "Input", CellFrame->True, CellMargins->{{17, 19}, {Inherited, Inherited}}, InitializationCell->True, CellLabelMargins->{{10, Inherited}, {Inherited, Inherited}}, ImageRegion->{{-0, 1}, {0, 1}}, Background->RGBColor[0, 1, 0]], Cell["\<\ Cell 5. Plot modules that support postprocessing. These are \ subdivided into Cells 5A and 5C to keep them short.\ \>", "Text", CellFrame->True, CellMargins->{{17, 19}, {Inherited, Inherited}}, CellLabelMargins->{{10, Inherited}, {Inherited, Inherited}}, ImageRegion->{{-0, 1}, {0, 1}}, Background->RGBColor[0, 1, 1]], Cell["\<\ Cell 5A. PlotSpaceTrussDeformedShape does exactly what it says. \ Note: argument amplif can be a scalar amplification, or a list of amplifications. If the latter, a \ sequence of colors is used.\ \>", "Text", CellFrame->True, CellMargins->{{17, 19}, {Inherited, Inherited}}, CellLabelMargins->{{10, Inherited}, {Inherited, Inherited}}, ImageRegion->{{-0, 1}, {0, 1}}, Background->RGBColor[1, 1, 0]], Cell[TextData[{ "PlotSpaceTrussDeformedShape[nodxyz_,elenod_,noddis_,\n \ amplif_,box_,title_,{view_,aspect_,colors_}]:= \n \ Module[{numnod=Length[nodxyz],numele=Length[elenod],a={},c={},e,k,m,n,\n \ ni,nj,nf,Q,xbox,ybox,x,y,x0,y0,xmin,xmax,ymin,ymax,dx,dy,xyc,arat,\n \ black,red,green,blue,yellow,white,fill,grey,nofill,f,pbars={},p={}},\n \ Q=WorldToScreenMatrix[view]; x=y=Table[0,{numnod}]; nf=Length[box]; \n If \ [nf>0, xbox=ybox=Table[0,{nf}]; \n For [n=1,n<=nf,n++, \ {xbox[[n]],ybox[[n]]}=Q.box[[n]] ];\n \ {xmin,xmax,ymin,ymax}=N[{Min[xbox],Max[xbox],Min[ybox],Max[ybox]}] ]; \n \ If [nf==0,\n For [n=1,n<=numnod,n++, {x[[n]],y[[n]]}=Q.nodxyz[[n]] ];\n \ {xmin,xmax,ymin,ymax}=N[{Min[x],Max[x],Min[y],Max[y]}] ];\n \ {dx,dy}={xmax-xmin,ymax-ymin};\n \ {black,red,green,blue,yellow,white}={RGBColor[0,0,0],RGBColor[1,0,0],\n \ RGBColor[0,1,0],RGBColor[0,0,1],RGBColor[1,1,0],RGBColor[1,1,1]};\n \ {nofill,grey,fill}={GrayLevel[0],GrayLevel[.8],GrayLevel[1]};\n \ arat=AspectRatio->Automatic; \n If [aspect>0, arat=AspectRatio->aspect];\n \ If [aspect==0&&dx>0, arat=AspectRatio->dy/dx];\n \ AppendTo[p,Graphics[AbsoluteThickness[.5]]]; AppendTo[p,Graphics[nofill]];\n \ enclosingbox={{xmin,ymin},{xmax,ymin},{xmax,ymax},{xmin,ymax},{xmin,ymin}};\n \ AppendTo[p,Graphics[Line[enclosingbox]]]; \n \ AppendTo[p,Graphics[AbsoluteThickness[2.5]]];\n If \ [Length[amplif]==0,a={amplif},a=amplif];\n If \ [Length[colors]==0,c={colors},c=colors]; k=Length[c];\n \ AppendTo[p,Graphics[black]];\n For [m=1,m<=Length[a],m++, f=a[[m]]; \ color=c[[Min[m,k]]];\n If [color==\"black\", \ AppendTo[p,Graphics[black]]];\n If [color==\"red\", \ AppendTo[p,Graphics[red]]];\n If [color==\"blue\", \ AppendTo[p,Graphics[blue]]];\n If [color==\"green\", \ AppendTo[p,Graphics[green]]];\n If [color==\"yellow\", \ AppendTo[p,Graphics[yellow]]];\n If [color==\"white\", \ AppendTo[p,Graphics[white]]];\n For [n=1,n<=numnod,n++, \n \ {x[[n]],y[[n]]}=Q.(nodxyz[[n]]+f*noddis[[n]])];\n For \ [e=1,e<=numele,e++, {ni,nj}=elenod[[e]]; \n \ xyc={{x[[ni]],y[[ni]]},{x[[nj]],y[[nj]]}}; \n \ AppendTo[p,Graphics[Line[xyc] ]]];\n ];\n Show[p, arat, \ PlotLabel->title, DisplayFunction->DisplayChannel ]; \n \ ClearAll[x,y,xbox,ybox,p]; \n ];\n", StyleBox[" \n\n\ nodxyz={{0,0,0},{10,5,0},{10,0,0},{20,8,0},{20,0,0},{30,9,0},\n \ {30,0,0},{40,8,0},{40,0,0},{50,5,0},{50,0,0},{60,0,0}};\n\ noddis={{0,0,0},{0,-10,0},{0,-10,0},{0,-15,0},{0,-15,0},{0,-20,0},\n \ {0,-20,0},{0,-15,0},{0,-15,0},{0,-10,0},{0,-10,0},{0,0,0}}/20;\n\ nodxyz=N[nodxyz];\nelenod={{1,3},{3,5},{5,7},{7,9},{9,11},{11,12},\n \ {1,2},{2,4},{4,6},{6,8},{8,10},{10,12},\n \ {2,3},{4,5},{6,7},{8,9},{10,11},\n {2,5},{4,7},{7,8},{9,10}};\n\ view={{0,1,0},{0,0,1}}; box={{0,-8,0},{60,-8,0},{60,10,0},{0,10,0}};\n\ PlotSpaceTrussDeformedShape[nodxyz,elenod,noddis,{0,1,2},\n \ box,\"orig & 2 deformed shapes\",{view,-1,{\"red\",\"blue\",\"green\"}}]; \n\ PlotSpaceTrussDeformedShape[nodxyz,elenod,noddis,2.5,box,\n \ \"deformed shape @ mag 2.5\",{view,-1,\"black\"}]; \n\ PlotSpaceTrussDeformedShape[nodxyz,elenod,noddis,4.0,box,\n \ \"deformed shape @ mag 4\",{view,-1,\"black\"}]; ", FontColor->RGBColor[0, 0, 1]] }], "Input", CellFrame->True, CellMargins->{{17, 19}, {Inherited, Inherited}}, InitializationCell->True, CellLabelMargins->{{10, Inherited}, {Inherited, Inherited}}, ImageRegion->{{-0, 1}, {0, 1}}, AnimationDisplayTime->8.70245, AnimationCycleOffset->1, AnimationCycleRepetitions->Infinity, Background->RGBColor[0, 1, 0]], Cell["\<\ Cell 5B. Plot Axial Stress level displays stress level and sign \ using color: red for tension, blue for compression, white for zero stress. A black background is \ used.\ \>", "Text", CellFrame->True, CellMargins->{{17, 19}, {Inherited, Inherited}}, CellLabelMargins->{{10, Inherited}, {Inherited, Inherited}}, ImageRegion->{{-0, 1}, {0, 1}}, Background->RGBColor[1, 1, 0]], Cell[TextData[{ "PlotSpaceTrussStresses[nodxyz_,elenod_,elesig_,sigfac_,box_,\n \ title_,{view_,aspect_,labels_}]:= Module[\n \ {numele=Length[elenod],numnod=Length[nodxyz],\n \ e,n,ni,nj,nc,nf,xyc,x,y,xbox,ybox,xmin,xmax,ymin,ymax,dx,dy,\n \ smin,smax,fmax,sval,c1,c2,c3,arat,pbox={},pbars={}},\n \ x=y=Table[0,{numnod}]; Q=WorldToScreenMatrix[view]; nf=Length[box];\n For \ [n=1,n<=numnod,n++, {x[[n]],y[[n]]}=Q.nodxyz[[n]] ];\n If [nf>0, \ xbox=ybox=Table[0,{nf}]; \n For [n=1,n<=nf,n++, \ {xbox[[n]],ybox[[n]]}=Q.box[[n]] ];\n \ {xmin,xmax,ymin,ymax}=N[{Min[xbox],Max[xbox],Min[ybox],Max[ybox]}] ]; \n \ If [nf==0,\n {xmin,xmax,ymin,ymax}=N[{Min[x],Max[x],Min[y],Max[y]}] ];\n\ {dx,dy}={xmax-xmin,ymax-ymin};\n \ AppendTo[pbox,Graphics[AbsoluteThickness[.5]]]; \n \ AppendTo[pbox,Graphics[GrayLevel[0]]];\n \ enclosingbox={{xmin,ymin},{xmax,ymin},{xmax,ymax},{xmin,ymax},{xmin,ymin}};\n \ AppendTo[pbox,Graphics[Line[enclosingbox]]];\n \ AppendTo[pbox,Graphics[AbsoluteThickness[4]]]; \n smin=Min[elesig]; \ smax=Max[elesig]; fmax=Max[Abs[smax],Abs[smin]];\n For [e=1,e<=numele,e++, \n\ sval=N[elesig[[e]]*sigfac]; {c1,c2,c3}=LineColor[sval,fmax];", StyleBox[" ", FontColor->RGBColor[1, 0, 0]], "\n {ni,nj}=elenod[[e]]; xyc={{x[[ni]],y[[ni]]},{x[[nj]],y[[nj]]}}; \ \n AppendTo[pbars,Graphics[RGBColor[c1,c2,c3]]];\n \ AppendTo[pbars,Graphics[Line[xyc]]]\n ];\n arat=AspectRatio->Automatic; \ \n If [aspect>0, arat=AspectRatio->aspect];\n If [aspect==0&&dx>0, \ arat=AspectRatio->dy/dx];\n Show[pbox,Graphics[RGBColor[0,0,0]],pbars, \n \ Background->GrayLevel[0], arat, PlotLabel->title,\n \ DisplayFunction->DisplayChannel ];\n ClearAll[pbars,x,y];\n ];\n\n\ LineColor[f_,fmax_]:= Module[{r,RGBmax={1,0,0}, \n RGBmin={0,0,1}, \ RGBzero={1,1,1}, RGBout={0,0,0}},\n If [f==0 || fmax==0, \n \ Return[RGBzero]]; (* White if f=0 *)\n If [f>fmax || f<-fmax, \n \ Return[RGBout ]]; (* Black if outside range *)\n If [f>0, r= N[f/fmax]; \n \ Return[r*RGBmax+(1-r)*RGBzero]]; (* positive *)\n If [f<0, \ r=-N[f/fmax]; \n Return[r*RGBmin+(1-r)*RGBzero]]; (* negative *)\n];\n\ ", StyleBox["\n", FontColor->RGBColor[1, 0, 0]], StyleBox["nodxyz={{0,0,0},{10,5,0},{10,0,0},{20,8,0},{20,0,0},{30,9,0},\n \ {30,0,0},{40,8,0},{40,0,0},{50,5,0},{50,0,0},{60,0,0}};\nelenod= \ {{1,3},{3,5},{5,7},{7,9},{9,11},{11,12},\n \ {1,2},{2,4},{4,6},{6,8},{8,10},{10,12},\n \ {2,3},{4,5},{6,7},{8,9},{10,11},\n {2,5},{4,7},{7,8},{9,10}};\n\ elesig={20,20,20,20,20,20,-10,-10,-10,-10,-10,-10,\n \ 15,12,10,12,15,10,18,18,10};\nview={{2,1,0},{-3,-1,1}}; \ box={{0,-4,0},{60,-4,0},{60,10,0},{0,10,0}};\n\ PlotSpaceTrussStresses[nodxyz,elenod,elesig,1,box,\n \"axial stress in \ truss members\",{view,0,labels}]; ", FontColor->RGBColor[0, 0, 1]] }], "Input", CellFrame->True, CellMargins->{{17, 19}, {Inherited, Inherited}}, InitializationCell->True, CellLabelMargins->{{10, Inherited}, {Inherited, Inherited}}, ImageRegion->{{-0, 1}, {0, 1}}, Background->RGBColor[0, 1, 0]], Cell["\<\ Cell 6. Miscellaneous utilities supporting print output and some \ array transformations\ \>", "Text", CellFrame->True, CellMargins->{{17, 19}, {Inherited, Inherited}}, InitializationCell->True, CellLabelMargins->{{10, Inherited}, {Inherited, Inherited}}, ImageRegion->{{-0, 1}, {0, 1}}, Background->RGBColor[1, 1, 0]], Cell["\<\ PrintSpaceTrussNodeCoordinates[nodxyz_,title_,digits_]:= Module[ {numnod=Length[nodxyz],n,x,y,z,d=6,f=6,tab}, tab=Table[0,{numnod}]; If [Length[digits]==2,{d,f}=digits]; For [n=1,n<=numnod,n++,{x,y,z}=nodxyz[[n]]; tab[[n]]={ToString[n],PaddedForm[x,{d,f}],PaddedForm[y,{d,f}], PaddedForm[z,{d,f}]}]; If [StringLength[title]>0, Print[title]]; Print[TableForm[tab, TableAlignments->{Right}, TableDirections->{Column,Row},TableSpacing->{0,2}, TableHeadings ->{None,{\"node\", \"x-coor\", \"y-coor\", \ \"z-coor\"}}]]; ]; PrintSpaceTrussElementData[elenod_,elemat_,elefab_,title_,digits_]:= Module[ {e,numele=Length[elenod],Em,A,d=6,f=3,tab}, tab=Table[0,{numele}]; If [Length[digits]==2,{d,f}=digits]; For [e=1,e<=numele,e++, Em=elemat[[e]]; A=elefab[[e]]; tab[[e]]={ToString[e],ToString[elenod[[e]]], PaddedForm[Em,{d,f}],PaddedForm[A,{d,f}]}]; If [StringLength[title]>0, Print[title]]; Print[TableForm[tab, TableAlignments->{Right}, TableDirections->{Column,Row},TableSpacing->{0,2}, TableHeadings ->{None,{\"elem\", \"nodes\", \"modulus\", \ \"area\"}}]]; ]; PrintSpaceTrussFreedomActivity[nodtag_,nodval_,title_,digits_]:= Module[ {numnod=Length[nodtag],n,tag,val,tab}, tab=Table[0,{numnod}]; If [Length[digits]==2,{d,f}=digits]; For [n=1,n<=numnod,n++, t=nodtag[[n]]; v=nodval[[n]]; tab[[n]]={ToString[n], PaddedForm[t[[1]]],PaddedForm[t[[2]]],PaddedForm[t[[3]]], PaddedForm[v[[1]]],PaddedForm[v[[2]]],PaddedForm[v[[3]]] }]; If [StringLength[title]>0, Print[title]]; Print[TableForm[tab,TableAlignments->{Right}, TableDirections->{Column,Row},TableSpacing->{0,1}, TableHeadings ->{None,{\"node\", \"x-tag\", \"y-tag\", \"z-tag\", \"x-value\", \"y-value\", \"z-value\"}} ]]; ]; PrintSpaceTrussNodeDisplacements[noddis_,title_,digits_]:= Module[ {numnod=Length[noddis],n,ux,uy,uz,tab,d=6,f=6}, tab=Table[0,{numnod}]; If [Length[digits]==2,{d,f}=digits]; For [n=1,n<=numnod,n++, {ux,uy,uz}=noddis[[n]]; tab[[n]]={ToString[n],PaddedForm[ux,{d,f}], PaddedForm[uy,{d,f}],PaddedForm[uz,{d,f}]}]; If [StringLength[title]>0, Print[title]]; Print[TableForm[tab,TableAlignments->{Right}, TableDirections->{Column,Row},TableSpacing->{0,1}, TableHeadings ->{None,{\"node\", \"x-displ\", \"y-displ\", \"z-displ\ \"}}]]; ]; PrintSpaceTrussNodeForces[nodfor_,title_,digits_]:= Module[ {numnod=Length[nodfor],n,fx,fy,fz,tab,d=4,f=4}, tab=Table[0,{numnod}]; If [Length[digits]==2,{d,f}=digits]; For [n=1,n<=numnod,n++, {fx,fy,fz}=nodfor[[n]]; tab[[n]]={ToString[n],PaddedForm[fx,{d,f}], PaddedForm[fy,{d,f}],PaddedForm[fz,{d,f}]}]; If [StringLength[title]>0, Print[title]]; Print[TableForm[tab,TableAlignments->{Right}, TableDirections->{Column,Row},TableSpacing->{0,1}, TableHeadings ->{None,{\"node\", \"x-force\", \"y-force\", \"z-force\ \"}}]]; ]; PrintSpaceTrussElemForcesAndStresses[elefor_,elesig_,title_,digits_]:= Module[{numele=Length[elefor],e,p,s,d=4,f=4,tab}, tab=Table[0,{numele}]; If [Length[digits]==2,{d,f}=digits]; For [e=1,e<=numele,e++, p=elefor[[e]]; s=elesig[[e]]; tab[[e]]={ToString[e],PaddedForm[p,{d,f}],PaddedForm[s,{d,f}]} ]; If [StringLength[title]>0, Print[title]]; Print[TableForm[tab,TableAlignments->{Right}, TableDirections->{Column,Row},TableSpacing->{0,1}, TableHeadings ->{None,{\"elem\", \"axial force\", \"axial \ stress\"}}]]; ]; FlatNodePartVector[nv_]:=Flatten[nv]; NodePartFlatVector[nfc_,v_]:= Module [ {i,k,m,n,nv={},numnod}, If [Length[nfc]==0, nv=Partition[v,nfc]]; If [Length[nfc]>0, numnod=Length[nfc]; m=0; nv=Table[0,{numnod}]; For [n=1,n<=numnod,n++, k=nfc[[n]]; nv[[n]]=Table[v[[m+i]],{i,1,k}]; m+=k]]; Return[nv]]; \ \>", "Input", CellFrame->True, CellMargins->{{17, 19}, {Inherited, Inherited}}, InitializationCell->True, CellLabelMargins->{{10, Inherited}, {Inherited, Inherited}}, ImageRegion->{{-0, 1}, {0, 1}}, Background->RGBColor[0, 1, 0]], Cell["Cell 7. Solution driver module", "Text", CellFrame->True, CellMargins->{{17, 19}, {Inherited, Inherited}}, InitializationCell->True, CellLabelMargins->{{10, Inherited}, {Inherited, Inherited}}, ImageRegion->{{-0, 1}, {0, 1}}, Background->RGBColor[1, 1, 0]], Cell[TextData[{ "SpaceTrussSolution[nodxyz_,elenod_,elemat_,elefab_,nodtag_,nodval_,\n \ prcopt_]:= Module[{K,Kmod,f,fmod,u,noddis,nodfor,elefor,elesig},\n \ K=SpaceTrussMasterStiffness[nodxyz,elenod,elemat,elefab,prcopt];\n", StyleBox[" (* Print[\"eigs of K=\",Chop[Eigenvalues[N[K]]]]; *)", FontColor->RGBColor[1, 0, 0]], "\n Kmod=ModifiedMasterStiffness[nodtag,K];\n \ f=FlatNodePartVector[nodval];\n fmod=ModifiedNodeForces[nodtag,nodval,K,f];\ \n", StyleBox[" (* Print[\"eigs of Kmod=\",Chop[Eigenvalues[N[Kmod]]]]; *)", FontColor->RGBColor[1, 0, 0]], "\n u=LinearSolve[Kmod,fmod]; u=Chop[u]; f=Chop[K.u, 10.0^(-8)];\n \ nodfor=NodePartFlatVector[3,f]; noddis=NodePartFlatVector[3,u];\n \ elefor=Chop[SpaceTrussIntForces[nodxyz,elenod,elemat,elefab,\n \ noddis,prcopt]];\n elesig=SpaceTrussStresses[elefab,elefor,prcopt]; \n \ Return[{noddis,nodfor,elefor,elesig}];\n];" }], "Input", CellFrame->True, CellMargins->{{17, 19}, {Inherited, Inherited}}, InitializationCell->True, CellLabelMargins->{{10, Inherited}, {Inherited, Inherited}}, ImageRegion->{{-0, 1}, {0, 1}}, Background->RGBColor[0, 1, 0]], Cell["Cell 8. Driver program for bridge truss model ", "Text", CellFrame->True, CellMargins->{{17, 19}, {Inherited, Inherited}}, CellLabelMargins->{{10, Inherited}, {Inherited, Inherited}}, ImageRegion->{{-0, 1}, {0, 1}}, Background->RGBColor[1, 1, 0]], Cell[TextData[{ "NodeCoordinates={{0,0,0},{10,5,0},{10,0,0},{20,8,0},{20,0,0},{30,9,0},\n \ {30,0,0},{40,8,0},{40,0,0},{50,5,0},{50,0,0},{60,0,0}};\n\ ElemNodes={{1,3},{3,5},{5,7},{7,9},{9,11},{11,12},\n \ {1,2},{2,4},{4,6},{6,8},{8,10},{10,12},\n \ {2,3},{4,5},{6,7},{8,9},{10,11},\n {2,5},{4,7},{7,8},{9,10}};\n\ PrintSpaceTrussNodeCoordinates[NodeCoordinates,\"Node coordinates:\",{}]; \ \nnumnod=Length[NodeCoordinates]; numele=Length[ElemNodes];\nEm=1000; \ Abot=2; Atop=10; Abat=3; Adia=1;\nElemMaterials= Table[Em,{numele}]; \n\ ElemFabrications={Abot,Abot,Abot,Abot,Abot,Abot,Atop,Atop,Atop,Atop,\n \ Atop,Atop,Abat,Abat,Abat,Abat,Abat,Adia,Adia,Adia,Adia}; \n\ PrintSpaceTrussElementData[ElemNodes,ElemMaterials,ElemFabrications,\n \ \"Element data:\",{}]; \nProcessOptions= {True};\n\n", StyleBox["view={{0,1,0},{0,0,1}}; \n\ labels={{True,0.06,-1.5,1.5},{True,0.12},{\"Times\",11,\"Roman\"}};", FontColor->RGBColor[0, 0, 1]], "\n", StyleBox["PlotSpaceTrussElementsAndNodes[NodeCoordinates,ElemNodes,\n \ \"bridge mesh\",{view,-1,labels}];", FontColor->RGBColor[0, 0, 1]], StyleBox["\n", FontColor->RGBColor[1, 0, 0]], " \nNodeDOFTags= Table[{0,0,1},{numnod}];\n\ NodeDOFValues=Table[{0,0,0},{numnod}]; \nNodeDOFValues[[3]]={0,-10,0}; \ NodeDOFValues[[5]]= {0,-10,0}; \nNodeDOFValues[[7]]={0,-16,0}; \n\ NodeDOFValues[[9]]={0,-10,0}; NodeDOFValues[[11]]={0,-10,0}; \n\ NodeDOFTags[[1]]= {1,1,1}; (* fixed node 1 *)\n\ NodeDOFTags[[numnod]]={0,1,1}; (* hroller @ node 12 *)\n\ PrintSpaceTrussFreedomActivity[NodeDOFTags,NodeDOFValues,\n \"DOF \ Activity:\",{}];\n\n{NodeDisplacements,NodeForces,ElemForces,ElemStresses}=\n \ SpaceTrussSolution[ NodeCoordinates,ElemNodes,ElemMaterials,\n \ ElemFabrications,NodeDOFTags,NodeDOFValues,ProcessOptions ];\n \n\ PrintSpaceTrussNodeDisplacements[NodeDisplacements,\n \"Computed node \ displacements:\",{}];\nPrintSpaceTrussNodeForces[NodeForces,\n \"Node \ forces including reactions:\",{}];\n\ PrintSpaceTrussElemForcesAndStresses[ElemForces,ElemStresses,\n \"Int \ Forces and Stresses:\",{}];\n \n", StyleBox["view={{0,1,0},{0,0,1}}; \ box={{0,-4,0},{60,-4,0},{60,10,0},{0,10,0}};", FontColor->RGBColor[0, 0, 1]], "\n", StyleBox["PlotSpaceTrussDeformedShape[NodeCoordinates,ElemNodes,\ NodeDisplacements,\n {0,1},box,\"deformed shape (unit \ magnif)\",{view,-1,{\"black\",\"blue\"}}];", FontColor->RGBColor[0, 0, 1]], " \n", StyleBox["PlotSpaceTrussStresses[NodeCoordinates,ElemNodes,ElemStresses,1,\ box,\n \"axial stresses in truss members\",{view,0,labels}]; ", FontColor->RGBColor[0, 0, 1]], StyleBox[" ", FontColor->RGBColor[1, 0, 0]] }], "Input", CellFrame->True, CellMargins->{{17, 19}, {Inherited, Inherited}}, CellLabelMargins->{{10, Inherited}, {Inherited, Inherited}}, ImageRegion->{{-0, 1}, {0, 1}}, Background->RGBColor[0, 1, 0]], Cell["\<\ Cell 8A. Animation of deflections. Uses the displacements u \ computed by driver program to plot a sequence of deformed shapes with amplitude varying as sine of \ pseudotime t.\ \>", "Text", CellFrame->True, CellMargins->{{17, 19}, {Inherited, Inherited}}, CellLabelMargins->{{10, Inherited}, {Inherited, Inherited}}, ImageRegion->{{-0, 1}, {0, 1}}, Background->RGBColor[1, 1, 0]], Cell["\<\ view={{0,1,0},{0,0,1}}; \ box={{0,-4,0},{65,-4,0},{65,10,0},{0,10,0}}; For [t=0.,t<=N[Pi],t=t+N[Pi/6], amp=Sin[t]; PlotSpaceTrussDeformedShape[NodeCoordinates,ElemNodes, NodeDisplacements,amp,box,\"deformed bridge animation\", {view,-1,\"red\"}]]; \ \>", "Input", CellFrame->True, CellMargins->{{17, 19}, {Inherited, Inherited}}, CellLabelMargins->{{10, Inherited}, {Inherited, Inherited}}, ImageRegion->{{-0, 1}, {0, 1}}, Background->RGBColor[0, 1, 0]], Cell[" Cell 9. 25-member transmission tower driver script", "Text", CellFrame->True, CellMargins->{{17, 19}, {Inherited, Inherited}}, CellLabelMargins->{{10, Inherited}, {Inherited, Inherited}}, ImageRegion->{{-0, 1}, {0, 1}}, Background->RGBColor[1, 1, 0]], Cell[" ", "Input", CellFrame->True, CellMargins->{{17, 19}, {Inherited, Inherited}}, CellLabelMargins->{{10, Inherited}, {Inherited, Inherited}}, ImageRegion->{{-0, 1}, {0, 1}}, Background->RGBColor[0, 1, 0]], Cell[CellGroupData[{ Cell["Cell 10. Module to compute space truss weight as model check", "Text", CellFrame->True, CellMargins->{{17, 19}, {Inherited, Inherited}}, CellLabelMargins->{{10, Inherited}, {Inherited, Inherited}}, ImageRegion->{{-0, 1}, {0, 1}}, Background->RGBColor[1, 1, 0]], Cell[TextData[{ "SpaceTrussWeight[nodxyz_,elenod_,elefab_,specw_]:=Module[\n\ {e,ni,nj,w=0,x1,x2,y1,y2,z1,z2,x21,y21,z21,\n numele=Length[elenod],LL},\n \ For [e=1,e<=numele,e++, {ni,nj}=elenod[[e]]; \n \ ncoor={nodxyz[[ni]],nodxyz[[nj]]}; \n {{x1,y1,z1},{x2,y2,z2}}=ncoor; \n\ {x21,y21,z21}={x2-x1,y2-y1,z2-z1};LL=x21^2+y21^2+z21^2;\n \ w=w+Sqrt[LL]*elefab[[e]]*specw];\n Return[w]]; \n ", StyleBox["\n", FontColor->RGBColor[0, 0, 1]], StyleBox["w=SpaceTrussWeight[NodeCoordinates,ElemNodes,ElemFabrications,0.1]\ ; \nPrint[\"weight=\",w];", FontColor->RGBColor[0, 0, 1]] }], "Input", CellFrame->True, CellMargins->{{17, 19}, {Inherited, Inherited}}, CellLabelMargins->{{10, Inherited}, {Inherited, Inherited}}, ImageRegion->{{-0, 1}, {0, 1}}, Background->RGBColor[0, 1, 0]] }, Open ]] }, FrontEndVersion->"4.2 for Macintosh", ScreenRectangle->{{0, 1920}, {0, 1180}}, AutoGeneratedPackage->None, WindowToolbars->{}, CellGrouping->Manual, WindowSize->{1200, 1133}, WindowMargins->{{49, Automatic}, {Automatic, 7}}, PrivateNotebookOptions->{"ColorPalette"->{RGBColor, -1}}, ShowCellLabel->True, ShowCellTags->False, RenderingOptions->{"ObjectDithering"->True, "RasterDithering"->False}, Magnification->1.25, MacintoshSystemPageSetup->"\<\ 00<0001804P000000]P2:?oQon82n@960dL5:0?l0080001804P000000]P2:001 0000I00000400`<300000BL?00400@00000000000000060801T1T00000000000 00000000000000000000000000000000\>" ] (******************************************************************* Cached data follows. If you edit this Notebook file directly, not using Mathematica, you must remove the line containing CacheID at the top of the file. The cache data will then be recreated when you save this file from within Mathematica. *******************************************************************) (*CellTagsOutline CellTagsIndex->{} *) (*CellTagsIndex CellTagsIndex->{} *) (*NotebookFileOutline Notebook[{ Cell[1754, 51, 1757, 30, 438, "Text"], Cell[3514, 83, 362, 10, 58, "Text"], Cell[CellGroupData[{ Cell[3901, 97, 372, 10, 86, "Input", InitializationCell->True], Cell[4276, 109, 369, 9, 76, "Text"], Cell[4648, 120, 2384, 44, 715, "Input", InitializationCell->True] }, Open ]], Cell[7047, 167, 439, 11, 95, "Text"], Cell[7489, 180, 2299, 38, 851, "Input", InitializationCell->True], Cell[9791, 220, 354, 9, 76, "Text"], Cell[10148, 231, 1976, 38, 596, "Input", InitializationCell->True], Cell[12127, 271, 548, 13, 114, "Text"], Cell[12678, 286, 5707, 89, 1888, "Input", InitializationCell->True], Cell[18388, 377, 340, 8, 57, "Text"], Cell[18731, 387, 420, 10, 76, "Text"], Cell[19154, 399, 3705, 63, 1055, "Input", InitializationCell->True], Cell[22862, 464, 395, 10, 76, "Text"], Cell[23260, 476, 3143, 55, 1004, "Input", InitializationCell->True], Cell[26406, 533, 341, 9, 57, "Text", InitializationCell->True], Cell[26750, 544, 4250, 96, 1463, "Input", InitializationCell->True], Cell[31003, 642, 274, 6, 57, "Text", InitializationCell->True], Cell[31280, 650, 1172, 22, 290, "Input", InitializationCell->True], Cell[32455, 674, 263, 5, 57, "Text"], Cell[32721, 681, 2989, 56, 834, "Input"], Cell[35713, 739, 402, 10, 76, "Text"], Cell[36118, 751, 488, 13, 137, "Input"], Cell[36609, 766, 268, 5, 57, "Text"], Cell[36880, 773, 220, 5, 52, "Input"], Cell[CellGroupData[{ Cell[37125, 782, 276, 5, 57, "Text"], Cell[37404, 789, 835, 17, 239, "Input"] }, Open ]] } ] *) (******************************************************************* End of Mathematica Notebook file. *******************************************************************)