The TL Plane Bar Element: · PDF fileOnce we squeeze all juice from the equilibrium analysis,...

Post on 12-Mar-2018

218 views 3 download

Transcript of The TL Plane Bar Element: · PDF fileOnce we squeeze all juice from the equilibrium analysis,...

Nonlinear FEM

10The TL Plane Bar

Element: Truss Analysis

NFEM Ch 10 – Slide 1

Nonlinear FEM

The Example Structure: Mises Truss(after Richard Edler von Mises, 1883-1953)

����

����

α α

X, x

Y, y (2)(1)

1

2

3

uX

uY

fY = λ

0

Here λ > 0 means crownload is applied upward

E, A 0E, A

S

H

NFEM Ch 10 – Slide 2

Nonlinear FEM

Implementation LevelsIn Nonlinear Analysis

In Linear FEM, there is only one level (equilibrium andincremental coalesce). But in nonlinear FEM there are two

Equilibrium: internal and external forces

Incremental (a.k.a. rate): stiffness and incremental load

Which one do we do first?

NFEM Ch 10 – Slide 3

Nonlinear FEM

Which Level Should Be Done First?

Answer: equilibrium

For example structure, external forces are trivial

So, focus is on internal forces

NFEM Ch 10 – Slide 4

Nonlinear FEM

For Equilibrium Analysis, Three Modules Are Required to Start

Form internal forces of Mises Truss: AssembleIntForceOfMisesTruss

Form internal forces of TL plane bar element: TLPlaneBarIntForce Merge element into master force vector: MergeElemIntoMasterIntForce

NFEM Ch 10 – Slide 5

Nonlinear FEM

Element Internal Force Module

TLPlaneBarIntForce[XYcoor_,Em_,A0_,s0_,uXY_,numer_]:= Module[{X1,Y1,X2,Y2,X21,Y21,uX1,uY1,uX2,uY2,uX21,uY21, x21,y21,LL0,LL,L0,L,e,s,cx,cy,pe}, {{X1,Y1},{X2,Y2}}=XYcoor; X21=X2-X1; Y21=Y2-Y1; LL0=X21^2+Y21^2; L0=Sqrt[LL0]; {{uX1,uY1},{uX2,uY2}}=uXY; uX21=uX2-uX1; uY21=uY2-uY1; x21=X21+uX21; y21=Y21+uY21; LL=x21^2+y21^2; L=Sqrt[LL]; e=(LL-LL0)/(2*LL0); s=s0+Em*e; cx=x21/L0; cy=y21/L0; pe=A0*s*Transpose[{{-cx,-cy,cx,cy}}]; If [!numer,pe=Simplify[pe]]; If [numer,pe=N[pe]]; Return[pe]];

ClearAll[X1,Y1,X2,Y2,uX,uY,Em,A0,s0]; pe=TLPlaneBarIntForce[{{X1,Y1},{X2,Y2}},Em,A0,0, {{uX,uY},{uX,uY}},False];Print["pe=",Transpose[pe]//MatrixForm];pe=TLPlaneBarIntForce[{{1,2},{5,2}},160,6,25, {{2,-1},{1,-5}},False];Print["pe=",Transpose[pe]//MatrixForm];

pe = (0 0 0 0)pe = ( −315 420 315 −420)

NFEM Ch 10 – Slide 6

Nonlinear FEM

Internal Force Assembler For Mises Truss

AssembleIntForceOfMisesTruss[S_,H_,Em_,A0_,s0_,uXY_,numer_]:= Module[{XY1,XY2,XY3,uXY1,uXY2,uXY3,pe1,pe2,p}, XY1={-S/2,0}; XY2={0,H}; XY3={S/2,0}; uXY1={0,0}; uXY2=uXY; uXY3={0,0}; p=Table[0,{2},{1}]; pe1=TLPlaneBarIntForce[{XY1,XY2},Em,A0,s0,{uXY1,uXY2},numer]; p=MergeElemIntoMasterIntForce[pe1,{0,0,1,2},p]; pe2=TLPlaneBarIntForce[{XY2,XY3},Em,A0,s0,{uXY2,uXY3},numer]; p=MergeElemIntoMasterIntForce[pe2,{1,2,0,0},p]; If [!numer,p=Simplify[p]]; If[numer,p=N[p]]; Return[p]]; MergeElemIntoMasterIntForce[pe_,eftab_,p_]:= Module[{i,ii,neldof,pinp}, pinp=p; neldof=Length[eftab]; For [i=1, i<=neldof, i++, ii=eftab[[i]]; If [ii>0,pinp[[ii,1]]+=pe[[i,1]]] ]; Return[pinp]]; ClearAll[Em,A0,S,H,s0,uX,uY,p,numer];p=AssembleIntForceOfMisesTruss[2,2.5,10,0.75,0,{-0.4,0.25},True];Print["p=",p//MatrixForm];p=AssembleIntForceOfMisesTruss[S,H,Em,A0,0,{uX,uY},False];Print["p=",p//MatrixForm];

NFEM Ch 10 – Slide 7

Nonlinear FEM

Test Results For Int Force Assembler

NFEM Ch 10 – Slide 8

Nonlinear FEM

Getting the Load-Deflection Response

ClearAll[Em,A0,S,H,uX,uY,pX,pY,lambda];pX = (4*A0*Em*uX*(S^2+2*uX^2+4*H*uY+2*uY^2))/(4*H^2+ S^2)^(3/2);pY = (8*A0*Em*(H+uY)*(uX^2+2*H*uY+uY^2))/(4*H^2+S^2)^(3/2); roots=Solve[pX==0, uX];Print["roots of pX=0 are ",roots//InputForm];Print["lambda=",Simplify[pY/.roots]//InputForm];

Solve for uX by saying pX = 0. Then replace into pY to get the load

λ versus vertical deflection. Cubic equation gives 3 solutions:

NFEM Ch 10 – Slide 9

Nonlinear FEM

Which Solution is Fundamental?

ClearAll[Em,A0,S,H,uX,uY,pX,pY,lambda];lambdaP=( 8*A0*Em*uY* (H+uY)*(2*H+uY))/(4*H^2+S^2)^(3/2); lambdaS=(-4*A0*Em*S^2*(H+uY))/(4*H^2+S^2)^(3/2); case1={H->Sqrt[3]/3,S->2,A0->1,Em->1};case2={H->Sqrt[2], S->2,A0->1,Em->1};case3={H->Sqrt[3], S->2,A0->1,Em->1};case4={H->3, S->2,A0->1,Em->1};pstyle={{AbsoluteThickness[2],RGBColor[0,0,0]}, {AbsoluteThickness[2],Dashing[{0.02,0.02}],RGBColor[1,0,0]}};Plot[{lambdaP/.case1,lambdaS/.case1},{uY,0,-2*H/.case1}, PlotStyle->pstyle, Frame->True, ImageSize->300, AxesLabel->{"uY","lambda"},PlotLabel->"Case 1: H=Sqrt[3]/3"];Plot[{lambdaP/.case2,lambdaS/.case2},{uY,0,-2*H/.case2}, PlotStyle->pstyle, Frame->True, ImageSize->300, AxesLabel->{"uY","lambda"},PlotLabel->"Case 2: H=Sqrt[2]"];Plot[{lambdaP/.case3,lambdaS/.case3},{uY,0,-2*H/.case3}, PlotStyle->pstyle, Frame->True, ImageSize->300, AxesLabel->{"uY","lambda"},PlotLabel->"Case 3: H=Sqrt[3]"];Plot[{lambdaP/.case4,lambdaS/.case4},{uY,0,-2*H/.case4}, PlotStyle->pstyle, Frame->True, ImageSize->300, AxesLabel->{"uY","lambda"},PlotLabel->"Case 4: H=3"];

One solution is the primary or fundamental path; the other two compose the secondary path. Now plot them:

NFEM Ch 10 – Slide 10

Nonlinear FEM

Plots Cover Four Cases, FromShallow Arches Through Deep Ones

−1 −0.8 −0.6 −0.4 −0.2 0−0.2

−0.1

0

0.1

0.2

−2.5 −2 −1.5 −1 −0.5 0

−0.4

−0.2

0

0.2

0.4

−3.5 −3 −2.5 −2 −1.5 −1 −0.5 0−0.4

−0.2

0

0.2

0.4

−6 −5 −4 −3 −2 −1 0−0.3−0.2−0.1

00.10.20.3

Case 1: H = Sqrt[3]/3 Case 2: H = Sqrt[2]

Case 3: H = Sqrt[3] Case 4: H = 3

uY uY

uY uY

Black is primary path, red is secondary one

NFEM Ch 10 – Slide 11

Nonlinear FEMFancier 3D Plotting: 2 StateVariables + One Control Variable

ClearAll[S,H,Em,A0,uX,uY]; H=Sqrt[3.];λmax[S_,H_,Em_,A0_]:=3.0792*A0*Em*H^3/(4*H^2+S^2)^(3/2);style1={AbsoluteThickness[2],RGBColor[0,0,0]};style2={AbsoluteThickness[2],RGBColor[1,0,0]};style3={AbsoluteThickness[2],RGBColor[1,0,0]};pripath[S_,H_,Em_,A0_,uY_]:=Module[{}, Return[{0,uY,8*A0*Em*uY*(H+uY)*(2*H+uY)/(4*H^2+S^2)^(3/2),style1}]];secpath1[S_,H_,Em_,A0_,uY_]:=Module[{c,uYB1,uYB2}, uYB1=Re[N[-H+Sqrt[H^2-S^2/2]]]; uYB2=Re[N[-H-Sqrt[H^2-S^2/2]]]; c=4*A0*Em*S^2/(4*H^2+S^2)^(3/2); If [N[uY]>=uYB1, Return[{0,uYB1,-c*(H+uYB1)}]]; If [N[uY]<=uYB2, Return[{0,uYB2,-c*(H+uYB2)}]]; Return[{Sqrt[-S^2/2-2*H*uY-uY^2],uY,-c*(H+uY),style2}]];secpath2[S_,H_,Em_,A0_,uY_]:=Module[{c,uYB1,uYB2}, uYB1=Re[N[-H+Sqrt[H^2-S^2/2]]]; uYB2=Re[N[-H-Sqrt[H^2-S^2/2]]]; c=4*A0*Em*S^2/(4*H^2+S^2)^(3/2); If [N[uY]>=uYB1, Return[{0,uYB1,-c*(H+uYB1)}]]; If [N[uY]<=uYB2, Return[{0,uYB2,-c*(H+uYB2)}]]; Return[{-Sqrt[-S^2/2-2*H*uY-uY^2],uY,-c*(H+uY),style3}]];λrange=1.1*{-λmax[2,H,1,1],λmax[2,H,1,1]};pp=ParametricPlot3D[pripath[2,H,1,1,uY], {uY,0,-2*H}, PlotPoints->201, PlotRange->{{-H,H},{0,-2*H},λrange}, BoxRatios->{1,2,1},AxesLabel->{"uX","uY","λ"}, Compiled->False,DisplayFunction->Identity];ps1=ParametricPlot3D[secpath1[2,H,1,1,uY], {uY,0,-2*H}, PlotPoints->201, PlotRange->{{-H,H},{0,-2*H},λrange}, BoxRatios->{1,2,1},AxesLabel->{"uX","uY","λ"}, Compiled->False,DisplayFunction->Identity];ps2=ParametricPlot3D[secpath2[2,H,1,1,uY], {uY,0,-2*H}, PlotPoints->201, PlotRange->{{-H,H},{0,-2*H},λrange}, BoxRatios->{1,2,1},AxesLabel->{"uX","uY","λ"}, Compiled->False,DisplayFunction->Identity];Show[pp,ps1,ps2, ViewPoint->{3,1,2},DisplayFunction->$DisplayFunction];

NFEM Ch 10 – Slide 12

Nonlinear FEM

Interesting Case: Rise Angle of 60 Degrees

−10

1uX−3

−2−1

0uY

−0.2

0

0.2

λ

01

−0.2

Limit point snap-through and bifurcation bucklingoccur simultaneously. This is a common occurrence whenoptimizing perfect structures under stability constraints

NFEM Ch 10 – Slide 13

Nonlinear FEM

Animation Script

ClearAll[S,H,Em,A0,uX,uY,a,c,d]; S=2.; H=3.; A0=1; Em=1;nmax =20; c=N[4*A0*Em/(4*H^2+S^2)^(3/2)];pelem1=Table[0,{nmax+1}];pelem2=Table[0,{nmax+1}];pload =Table[0,{nmax+1}];parrow=Table[0,{nmax+1}];Do [uY=-2.5*n*H/nmax; d= N[-S^2/2-2*H*uY-uY^2]; If[d <=0., uX=0; λ= N[2*c*uY*(H+uY)*(2*H+uY)], uX=Sqrt[d]; λ= N[-c*S^2*(H+uY)]]; pelem1[[n+1]]=Graphics[Line[{{-S/2,0},{uX,H+uY}}]]; pelem2[[n+1]]=Graphics[Line[{{ uX,H+uY},{S/2,0}}]]; pload[[n+1]] =Graphics[Line[{{ uX,H+uY},{uX,H+uY-λ}}]]; a = Min[.5*Abs[λ],0.2*H]; If [λ>0, parrow[[n+1]]=Graphics[{ Line[{{ uX,H+uY},{uX-a/2,H+uY-a}}], Line[{{ uX,H+uY},{uX+a/2,H+uY-a}}]} ], parrow[[n+1]]=Graphics[{ Line[{{ uX,H+uY},{uX-a/2,H+uY+a}}], Line[{{ uX,H+uY},{uX+a/2,H+uY+a}}]} ] ], {n,0,nmax}];Show[Graphics[Thickness[.004]],pelem1,pelem2, Graphics[Thickness[.005]],Graphics[RGBColor[1,0,1]], pload,parrow,ImageSize->300, PlotRange->{{-2*H,2*H},{-2*H,2*H}},AspectRatio->1];

NFEM Ch 10 – Slide 14

Nonlinear FEM

Animation in One Frame: Deep Arch

NFEM Ch 10 – Slide 15

Nonlinear FEM

Animation With Multiple Frames

ClearAll[S,H,Em,A0,uX,uY,a,c,d]; S=2; H=.8; A0=1; Em=1;nmax =20; c= N[4*A0*Em/(4*H^2+S^2)^(3/2)];Do [uY=-2.5*n*H/nmax; d= N[-S^2/2-2*H*uY-uY^2]; If[d <=0., uX=0; λ= N[2*c*uY*(H+uY)*(2*H+uY)], uX=Sqrt[d]; λ= N[-c*S^2*(H+uY)]]; pelem1=Graphics[Line[{{-S/2,0},{uX,H+uY}}]]; pelem2=Graphics[Line[{{ uX,H+uY},{S/2,0}}]]; pload =Graphics[Line[{{ uX,H+uY},{uX,H+uY-λ}}]]; a = Min[.5*Abs[λ],0.2*H]; If [λ>0, parrow=Graphics[{ Line[{{ uX,H+uY},{uX-a/2,H+uY-a}}], Line[{{ uX,H+uY},{uX+a/2,H+uY-a}}]} ], parrow=Graphics[{ Line[{{ uX,H+uY},{uX-a/2,H+uY+a}}], Line[{{ uX,H+uY},{uX+a/2,H+uY+a}}]} ] ]; Show[Graphics[Thickness[.012]],pelem1,pelem2, Graphics[Thickness[.005]],Graphics[RGBColor[1,0,1]], pload,parrow,ImageSize->250, PlotRange->{{-2*H,2*H},{-2*H,2*H}},AspectRatio->1], {n,0,nmax}];

Will have to demo this one from computer

NFEM Ch 10 – Slide 16

Nonlinear FEM

Stiffness Level

Once we squeeze all juice from the equilibrium analysis,

its time to go to the stiffness level. To start, we need to

code three modules again.

NFEM Ch 10 – Slide 17

Nonlinear FEM

Tangent Stiffness Matrix of TL Plane Bar Element

TLPlaneBarTanStiff[XYcoor_,Em_,A0_,s0_,uXY_,numer_]:= Module[{X1,Y1,X2,Y2,X21,Y21,uX1,uY1,uX2,uY2,uX21,uY21, x21,y21,LL0,LL,L0,L,e,s,cx,cy,KeM,KeG}, {{X1,Y1},{X2,Y2}}=XYcoor; X21=X2-X1; Y21=Y2-Y1; LL0=X21^2+Y21^2; L0=Sqrt[LL0]; {{uX1,uY1},{uX2,uY2}}=uXY; uX21=uX2-uX1; uY21=uY2-uY1; x21=X21+uX21; y21=Y21+uY21; LL=x21^2+y21^2; L=Sqrt[LL]; e=(LL-LL0)/(2*LL0); s=s0+Em*e; cx=x21/L0; cy=y21/L0; KeM=(Em*A0/L0)*{{ cx*cx, cx*cy,-cx*cx,-cx*cy}, { cx*cy, cy*cy,-cy*cx,-cy*cy}, {-cx*cx,-cy*cx, cx*cx, cy*cx}, {-cx*cy,-cy*cy, cy*cx, cy*cy}}; KeG=(A0*s/L0)*{{1,0,-1,0},{0,1,0,-1},{-1,0,1,0},{0,-1,0,1}}; If [!numer,{KeM,KeG}=Simplify[{KeM,KeG}]]; If [ numer,{KeM,KeG}=N[{KeM,KeG}]]; Return[{KeM,KeG}]]; {KeM,KeG}=TLPlaneBarTanStiff[{{1,2},{5,2}},160,6,25, {{2,-1},{1,-5}},True]; Ke=KeM+KeG;Print["KeM=",KeM//MatrixForm," KeG=",KeG//MatrixForm];Print["Ke=",Ke//MatrixForm]; Print["eigenvalues=",Chop[{Eigenvalues[N[KeM]],Eigenvalues[N[KeG]], Eigenvalues[N[Ke]]}]];

NFEM Ch 10 – Slide 18

Nonlinear FEM

Assembler Modules To Form Tangent Stiffness Matrix of Mises Truss

AssembleTanStiffOfMisesTruss[S_,H_,Em_,A0_,s0_,uXY_,numer_]:= Module[{XY1,XY2,XY3,uXY1,uXY2,uXY3,KeM1,KeG1,KeM2,KeG2,p}, XY1={-S/2,0}; XY2={0,H}; XY3={S/2,0}; uXY1={0,0}; uXY2=uXY; uXY3={0,0}; K=Table[0,{2},{2}]; {KeM1,KeG1}=TLPlaneBarTanStiff[{XY1,XY2},Em,A0,s0,{uXY1,uXY2},numer]; K=MergeElemIntoMasterStiff[KeM1+KeG1,{0,0,1,2},K]; {KeM2,KeG2}=TLPlaneBarTanStiff[{XY2,XY3},Em,A0,s0,{uXY2,uXY3},numer]; K=MergeElemIntoMasterStiff[KeM2+KeG2,{1,2,0,0},K]; If [!numer,K=Simplify[K]]; If[numer,K=N[K]]; Return[K]];

MergeElemIntoMasterStiff[Ke_,eftab_,Km_]:=Module[ {i,j,ii,jj,neldof=Length[Ke],K}, K=Km; For[i=1, i<=neldof, i++, ii=eftab[[i]]; For[j=i, j<=neldof, j++, jj=eftab[[j]]; If [ii>0 && jj>0, K[[jj,ii]]=K[[ii,jj]]+=Ke[[i,j]]]]; ]; Return[K] ]; ClearAll[S,H,Em,A0,s0,uX,uY]; s0=0; uXY={0,uY};K=AssembleTanStiffOfMisesTruss[S,H,Em,A0,s0,uXY,False];Print["K= ",K//MatrixForm];ClearAll[S,H,Em,A0,s0,uX,uY]; uXY={uX,uY};K=AssembleTanStiffOfMisesTruss[S,H,Em,A0,s0,uXY,False];Print["K= ",K//MatrixForm];

NFEM Ch 10 – Slide 19

Nonlinear FEM

Here Are The Three Modules We Need

Form tangent stiffness of Mises Truss: AssembletanStiffOfMisesTruss

Form tangent stiffness of TL plane bar element: TLPlaneBarTanStiff Merge element into master force vector: MergeElemIntoMasterTanStiff

NFEM Ch 10 – Slide 20

Nonlinear FEM

Output From Test Statements

NFEM Ch 10 – Slide 21

Nonlinear FEM

Finding Zeros of the Stiffness Determinant

ClearAll[µ,c,s,α];detK=-((2+6*µ+3*µ^2)*c^2*(-2-2*µ-µ^2+(-2+2*µ+µ^2)*(c^2-s^2))*s^2)/2;detK=Simplify[detK/.c^2->1-s^2]; Print["detK=",detK];sol=Simplify[Solve[detK==0,µ],α>0]; {µ1,µ2,µ3,µ4}=µ/.sol;{µ1,µ2,µ3,µ4}=Simplify[{µ1,µ2,µ3,µ4}/.s->Sin[α]]; Print["roots µ1,µ2,µ3,µ4=",TrigExpand[{µ1,µ2,µ3,µ4}]];Print["roots µ1,µ2 (numeric)=",N[{µ1,µ2}]];{µ1,µ2,µ3,µ4}=Simplify[{µ1,µ2,µ3,µ4}/.α->angdeg*(Pi/180)];pstyleL={AbsoluteThickness[2],RGBColor[0,0,0]};pstyleB={AbsoluteThickness[2],RGBColor[1,0,0]};pstyle= {pstyleL,pstyleL,pstyleB,pstyleB}; Off[Plot::plnr]; Plot[{µ1,µ2,µ3,µ4},{angdeg,0,90},PlotStyle->pstyle, Frame->True,ImageSize->300];

NFEM Ch 10 – Slide 22

Nonlinear FEM

There Are Four CP On The Primary Path

NFEM Ch 10 – Slide 23

Nonlinear FEM

And Here is Their Locus on the Rise Angle Versus Dimensionless State Parameter Plane

0 20 40 60 80−2

−1.5

−1

−0.5

0

Rise angle α in degrees

Dim

ensi

onle

ss v

erti

cal

defl

ecti

on µ

= u

/H

Y

Limit point 1

Limit point 2

Bifurcation point 1

Bifurcation point 2

NFEM Ch 10 – Slide 24

Nonlinear FEM

And Here is the Final & Most Important Plot: Load Capacity Versus Rise Angle

1 2 3 4 5

0.05

0.1

0.15

0.2

0.25

0.3

0.35

Bifurcation ptfirst

Limit ptfirst

λL1

λL1

λB1

λB1

√2

√3

H

H =λ at critical

point

Height H

Result for S = 2, A = 1, E = 10

NFEM Ch 10 – Slide 25

Nonlinear FEM

Space Bar Benchmark Problem:Pyramidal Trusses

X,x

Z,z

Y,y

R

H

1

5

3

4

SupportCircle

Groundφ = 90

9090

90

Apex

2

L0

(1)(2)(3) (4)

NFEM Ch 10 – Slide 26

Nonlinear FEM

A Pyramidal Truss (m=4) Application:Explosive Energy Absorber

����������������������������������������

NFEM Ch 10 – Slide 27

Nonlinear FEM

ClearAll[m,φ,α,R,H,Em,A0,L0,µX,µY,µZ,c,s]; m=3; numnod=m+1; numele=m; R=Cos[α]*L0; H=Sin[α]*L0;uX=µX*H; uY=µY*H; uZ=µZ*H; nodxyz=Table[0,{numnod}]; elenod=Table[0,{numele}];φ=2*Pi/m; ang=0; nodxyz[[1]]={0,0,H};For [i=1,i<=m,i++, nodxyz[[i+1]]=R*{Cos[ang],Sin[ang],0}; elenod[[i]]={1,i+1}; ang+=φ]; elemat=Table[Em,{numele}]; elefab=Table[A0,{numele}]; elestr=Table[0,{numele}]; rep1={Cos[α]->c,Sin[α]->s,Cos[2*α]->c^2-s^2,Sin[2*α]->2*s*c};rep2={c^2->1-s^2,Em->1,A0->1,L0->1};noddis=Table[{0,0,0},{numnod}]; noddis[[1]]={uX,uY,uZ};nodtag=Table[{1,1,1},{numnod}]; nodtag[[1]]={0,0,0};p=TLSpaceTrussMasterIntForce[nodxyz,elenod,elemat,elefab, elestr,noddis,False];pred=ReducedForceVector[nodtag,p]; pred=TrigExpand[pred];pred=Simplify[pred/.rep1]; pred=Simplify[pred/.rep2]; Print["pred=",pred//MatrixForm]; {KM,KG}=TLSpaceTrussMasterTanStiff[nodxyz,elenod,elemat,elefab, elestr,noddis,False]; K=Simplify[KM+KG]; Kred=ReducedStiffMatrix[nodtag,K]; Kred=TrigExpand[Kred];Kred=Simplify[Kred/.rep1]; Kred=Simplify[Kred/.rep2]; Print["Kred=",Kred//MatrixForm];

Pyramidal Truss Solution Script for Three Members (m=3)

NFEM Ch 10 – Slide 28

Nonlinear FEM

Pyramidal Truss Solution Script for One Member (m=1)

ClearAll[m,φ,θ,α,R,H,Em,A0,L0,uX,uY,uZ,µX,µY,µZ,c,s,cθ,sθ]; m=1; numnod=m+1; numele=m; R=Cos[α]*L0; H=Sin[α]*L0;uX=µX*H; uY=µY*H; uZ=µZ*H; nodxyz=Table[0,{numnod}]; elenod=Table[0,{numele}];φ=2*Pi/m; ang=θ; nodxyz[[1]]={0,0,H};For [i=1,i<=m,i++, nodxyz[[i+1]]=R*{Cos[ang],Sin[ang],0}; elenod[[i]]={1,i+1}; ang+=φ]; elemat=Table[Em,{numele}]; elefab=Table[A0,{numele}]; elestr=Table[0,{numele}]; rep1={Cos[α]->c,Sin[α]->s,Cos[2*α]->c^2-s^2,Sin[2*α]->2*s*c};rep2={c^2->1-s^2,Em->1,A0->1,L0->1};rep3={Cos[θ]->cθ,Sin[θ]->sθ,Cos[2*θ]->cθ^2-sθ^2,Sin[2*θ]->2*cθ*sθ};noddis=Table[{0,0,0},{numnod}]; noddis[[1]]={uX,uY,uZ};nodtag=Table[{1,1,1},{numnod}]; nodtag[[1]]={0,0,0};p=TLSpaceTrussMasterIntForce[nodxyz,elenod,elemat,elefab, elestr,noddis,False];pred=ReducedForceVector[nodtag,p]; pred=TrigExpand[pred];pred=Simplify[pred/.rep1]; pred=Simplify[(pred/.rep2)/.rep3]; Print["pred=",pred//MatrixForm]; {KM,KG}=TLSpaceTrussMasterTanStiff[nodxyz,elenod,elemat,elefab, elestr,noddis,False]; K=Simplify[KM+KG]; Kred=ReducedStiffMatrix[nodtag,K]; Kred=TrigExpand[Kred];Kred=Simplify[Kred/.rep1]; Kred=Simplify[(Kred/.rep2)/.rep3]; Print["Kred=",Kred//MatrixForm];

NFEM Ch 10 – Slide 29

Nonlinear FEM

Pyramidal Truss Final Script

ClearAll[m,Em,A0,L0,µX,µY,µZ,c,s,cθ,sθ];pθ=(Em*A0/2)*{ s*(-c*cθ+s*µX)*(-2*c*(cθ*µX+sθ*µY)+s*(µX^2+µY^2+µZ*(2+µZ))), s*(-c*sθ+s*µY)*(-2*c*(cθ*µX+sθ*µY)+s*(µX^2+µY^2+µZ*(2+µZ))), s^2*(1+µZ)*(-2*c*(cθ*µX+sθ*µY)+s*(µX^2+µY^2+µZ*(2+µZ)))};Kθ=(Em*A0/(2*L0))*{{1-cθ^2*(s^2-1)-sθ^2-6*c*cθ*s*µX-2*c*s*sθ*µY+s^2*(-1+sθ^2+3*µX^2+ µY^2+2*µZ+µZ^2),2*(c*cθ-s*µX)*(c*sθ-s*µY),2*s*(-c*cθ+s*µX)*(1+µZ)},{2*(c*cθ-s*µX)*(c*sθ-s*µY),1+cθ^2*(s^2-1)+sθ^2-2*c*cθ*s*µX-6*c*s*sθ*µY+ s^2*(-1-sθ^2+µX^2+3*µY^2+2*µZ+µZ^2),2*s*(-c*sθ+s*µY)*(1+µZ)},{2*s*(-c*cθ+s*µX)*(1+µZ),2*s*(-c*sθ+s*µY)*(1+µZ), s*(-2*c*(cθ*µX+sθ*µY)+s*(2+µX^2+µY^2+6*µZ+3*µZ^2))}};Cp00=pθ/.{cθ->0,sθ->0}; Cp20=Coefficient[pθ,cθ^2];Cp02=Coefficient[pθ,sθ^2]; CK00=Kθ/.{cθ->0,sθ->0};CK20=Coefficient[Kθ,cθ^2]; CK02=Coefficient[Kθ,sθ^2];p=m*Simplify[Cp00+(Cp20+Cp02)/2]; Print["p=",p//MatrixForm];K=m*Simplify[CK00+(CK20+CK02)/2]; Print["K=",K//MatrixForm];

NFEM Ch 10 – Slide 30