LECCION 7 - EJERCICIO 1 (18.1) v.2005

INICIO

Off[General::"spell1"]
Off[General::"spell"]

SetDirectory[NotebookDirectory[]]

DEFINICION  ELEMENTO TRIANGULAR REGULAR DE 10 NODOS - ###

DEFINICION GRAFICA

Tri10=;

Tri10r=Show[Tri10, ImageSize->300]

COORDENADAS TRIANGULARES NODOS

Cnt={{1,0,0},{0,1,0},{0,0,1},{(2/3),(1/3),0},{(1/3),(2/3),0},{0,(2/3),(1/3)},{0,(1/3),(2/3)},{(1/3),0,(2/3)},{(2/3),0,(1/3)},{X,X,X}};

NNodos=Dimensions[Cnt][[1]]

FUNCIONES DE FORMA - METODO PRODUCTO DE CURVAS

CURVA A CONSIDERAR - ###

Cu=Table[0,{i,9}];

LADOS

Cu[[1]]=ζ3;Cu[[2]]=X;Cu[[3]]=ζ2;

MEDIANAS

Cu[[4]]=(ζ1-2/3);Cu[[5]]=(ζ1-1/3);

Cu[[6]]=(ζ2-2/3);Cu[[7]]=X;

Cu[[8]]=(ζ3-2/3);Cu[[9]]=(ζ3-1/3);

DEFINICION PRODUCTOS DE CURVAS EN CADA NODO - ###

Nc=Table[0,{i,NNodos}];

Tipo 1 - ESQUINA

Nc[[1]]=Cu[[2]]*Cu[[4]]*Cu[[5]];

Nc[[2]]=Cu[[3]]*X*Cu[[7]];

Nc[[3]]=Cu[[1]]*Cu[[8]]*Cu[[9]];

Tipo 2 - LADOS

Nc[[4]]=Cu[[2]]*Cu[[3]]*Cu[[5]];

Nc[[5]]=Cu[[2]]*Cu[[3]]*Cu[[7]];

Nc[[6]]=Cu[[1]]*Cu[[3]]*Cu[[7]];

Nc[[7]]=Cu[[1]]*Cu[[3]]*X;

Nc[[8]]=Cu[[1]]*Cu[[2]]*Cu[[9]];

Nc[[9]]=Cu[[1]]*Cu[[2]]*Cu[[5]];

Tipo 3- INTERIORES

Nc[[10]]=X*Cu[[2]]*Cu[[3]];

OBTENCION FUNCIONES DE FORMA

Clear[Nf]

Nfp=Table[0,{i,NNodos}];

Nf=Table[0,{i,NNodos}];

Do[
Nfp[[i]]=a*Nc[[i]];
eq=1==Nfp[[i]]/.{ζ1 ->Cnt[[i,1]],ζ2->Cnt[[i,2]],ζ3->Cnt[[i,3]]};
as=a/.Solve[eq,a][[1]];Print["Nodo ",i];
Nf[[i]]=Simplify[Nfp[[i]]/.{a->as}],
{i,NNodos}
];

MatrixForm[Nf]

COMPROBACION SUMA UNIDAD

Suma=(∑_(i=1)^NNodos)Nf[[i]]

Simplify[Suma/.{ζ1->1-ζ2-ζ3}]

OK.

REPRESENTACION GRAFICA

Función Representación Gráfica Funciones de Forma

PlotTriangleShapeFunction[xytrig_,f_,Nsub_,aspect_]:=Module[{Ni,line3D={},poly3D={},zc1,zc2,zc3,xyf1,xyf2,xyf3,xc,yc,x1,x2,x3,y1,y2,y3,z1,z2,z3,iz1,iz2,iz3,d},{{x1,y1,z1},{x2,y2,z2},{x3,y3,z3}}=Take[xytrig,3];xc={x1,x2,x3};yc={y1,y2,y3};Ni=Nsub*3;Do[Do[iz3=Ni-iz1-iz2;If[iz3≤0,Continue[]];d=0;If[Mod[iz1+2,3]==0&&Mod[iz2-1,3]==0,d=1];If[Mod[iz1-2,3]==0&&Mod[iz2+1,3]==0,d=-1];If[d==0,Continue[]];zc1=N[{iz1+d+d,iz2-d,iz3-d}/Ni];zc2=N[{iz1-d,iz2+d+d,iz3-d}/Ni];zc3=N[{iz1-d,iz2-d,iz3+d+d}/Ni];xyf1={xc.zc1,yc.zc1,f[zc1[[1]],zc1[[2]],zc1[[3]]]};xyf2={xc.zc2,yc.zc2,f[zc2[[1]],zc2[[2]],zc2[[3]]]};xyf3={xc.zc3,yc.zc3,f[zc3[[1]],zc3[[2]],zc3[[3]]]};AppendTo[poly3D,Polygon[{xyf1,xyf2,xyf3}]];AppendTo[line3D,Line[{xyf1,xyf2,xyf3,xyf1}]],{iz2,1,Ni-iz1}],{iz1,1,Ni}];Show[Graphics3D[RGBColor[1,0,0]],Graphics3D[poly3D],Graphics3D[Thickness[.002]],Graphics3D[line3D],Graphics3D[RGBColor[0,0,0]],Graphics3D[Thickness[.005]],Graphics3D[Line[xytrig]],PlotRange->All,BoxRatios->{1,1,aspect},Boxed->False]];

Representación Gráfica Funciones Forma Elemento.

Ng=Table[0,{i,NNodos}];

xyc1={0,0,0};xyc2={3,0,0};xyc3={Sqrt[3],3/2,0};xytrig=N[{xyc1,xyc2,xyc3,xyc1}];

Control de Cuadricula

Nsub=15;

Do[
fi[ζ1_,ζ2_,ζ3_]=Nf[[i]];
Ng[[i]]=PlotTriangleShapeFunction[xytrig,fi,Nsub,1/2],
{i,NNodos}
];

RESULTADOS INTERACTIVOS

Manipulate[{Tri10r,Ng[[n]],Nf[[n]]},{n,1,Dimensions[Nf][[1]],1},{n,Range[Dimensions[Nf][[1]]]},FrameLabel->{"FUNCION DE FORMA EN NODO n - TRIANGULO REGULAR 10 NODOS"}, SaveDefinitions->True]