Undefined function or variable 'PrintSpac​eTrussNode​Coordinate​' error

조회 수: 5 (최근 30일)
Ruben Mora
Ruben Mora 2019년 10월 22일
댓글: Walter Roberson 2019년 10월 22일
Trying to build parker truss algorithm but i am getting this error on line 12-
clear, clc, clf
NodeCoordinates={{0,0,0},{10,5,0},{10,0,0},{20,8,0},{20,0,0},{30,9,0},...
{30,0,0},{40,8,0},{40,0,0},{50,5,0},{50,0,0},{60,0,0}};
ElemNodes={{1,3},{3,5},{5,7},{7,9},{9,11},{11,12},...
{1,2},{2,4},{4,6},{6,8},{8,10},{10,12},...
{2,3},{4,5},{6,7},{8,9},{10,11},...
{2,5},{4,7},{7,8},{9,10}};
PrintSpaceTrussNodeCoordinates(NodeCoordinates,'Node coordinates:',[1 0.000000 0.000000 0.000000; 2 10.000000 5.000000 0.000000; 3 10.000000 0.000000 0.000000; 4 20.000000 8.000000 0.000000; 5 20.000000 0.000000 0.000000; 6 30.000000 9.000000 0.000000; 7 30.000000 0.000000 0.000000; 8 40.000000 8.000000 0.000000; 9 40.000000 0.000000 0.000000; 10 50.000000 5.000000 0.000000; 11 50.000000 0.000000 0.000000; 12 60.000000 0.000000 0.000000]);
numnod=Length(NodeCoordinates); numele=Length(ElemNodes);
Em=1000; Abot=2; Atop=10; Abat=3; Adia=1;
ElemMaterials= Table(Em,{numele});
ElemFabrications={Abot,Abot,Abot,Abot,Abot,Abot,Atop,Atop,Atop,Atop,...
Atop,Atop,Abat,Abat,Abat,Abat,Abat,Adia,Adia,Adia,Adia};
PrintSpaceTrussElementData(ElemNodes,ElemMaterials,ElemFabrications,'Element data:',[1 {1, 3} 1000.00 2.00 2 {3, 5} 1000.00 2.00 3 {5, 7} 1000.00 2.00 4 {7, 9} 1000.00 2.00 5 {9, 11} 1000.00 2.00 6 {11, 12} 1000.00 2.00 7 {1, 2} 1000.00 10.00 8 {2, 4} 1000.00 10.00 9 {4, 6} 1000.00 10.00 10 {6, 8} 1000.00 10.00 11 {8, 10} 1000.00 10.00 12 {10, 12} 1000.00 10.00 13 {2, 3} 1000.00 3.00 14 {4, 5} 1000.00 3.00 15 {6, 7} 1000.00 3.00 16 {8, 9} 1000.00 3.00 17 {10, 11} 1000.00 3.00 18 {2, 5} 1000.00 1.00 19 {4, 7} 1000.00 1.00 20 {7, 8} 1000.00 1.00 21 {9, 10} 1000.00 1.00]);
ProcessOptions= {True};
view ={ {0,1,0},{0,0,1} };
labels={{True,0.06,-1.5,1.5},{True,0.12},{"Times",11,"Roman"}};
PlotSpaceTrussElementsAndNodes(NodeCoordinates,ElemNodes,'bridge mesh',{view,-1,labels}) ;
NodeDOFTags= Table({0,0,1},{numnod});
NodeDOFValues=Table({0,0,0},{numnod});
NodeDOFValues(3)=({0,-10,0});
NodeDOFValues(5)= {0,-10,0};
NodeDOFValues(7)={0,-16,0};
NodeDOFValues(9)={0,-10,0};
NodeDOFValues(11)={0,-10,0};
NodeDOFTags(1)= {1,1,1}; % ( fixed node 1 )
NodeDOFTags(numnod)={0,1,1}; % ( hroller @ node 12 )
PrintSpaceTrussFreedomActivity(NodeDOFTags,NodeDOFValues,...
'DOF Activity:',[1 1 1 1 0 0 0 2 0 0 1 0 0 0 3 0 0 1 0 -10 0 4 0 0 1 0 0 0 5 0 0 1 0 -10 0 6 0 0 1 0 0 0 7 0 0 1 0 -16 0 8 0 0 1 0 0 0 9 0 0 1 0 -10 0 10 0 0 1 0 0 0 11 0 0 1 0 -10 0 12 0 1 1 0 0 0]);
%-----------------------------------------------------------------%
NodeDisplacements,NodeForces,ElemForces,ElemStresses = SpaceTrussSolution( NodeCoordinates,ElemNodes,ElemMaterials,ElemFabrications,NodeDOFTags,NodeDOFValues,ProcessOptions );
PrintSpaceTrussNodeDisplacements(NodeDisplacements,'Computed node displacements:',[1 0.000000 0.000000 0.000000 2 0.809536 -1.775600 0.000000 3 0.280000 -1.792260 0.000000 4 0.899001 -2.291930 0.000000 5 0.560000 -2.316600 0.000000 6 0.847500 -2.385940 0.000000 7 0.847500 -2.421940 0.000000 8 0.795999 -2.291930 0.000000 9 1.135000 -2.316600 0.000000 10 0.885464 -1.775600 0.000000 11 1.415000 -1.792260 0.000000 12 1.695000 0.000000 0.000000]);
PrintSpaceTrussNodeForces(NodeForces,'Node forces including reactions:',[1 0.0000 28.0000 0.0000 2 0.0000 0.0000 0.0000 3 0.0000 -10.0000 0.0000 4 0.0000 0.0000 0.0000 5 0.0000 -10.0000 0.0000 6 0.0000 0.0000 0.0000 7 0.0000 -16.0000 0.0000 8 0.0000 0.0000 0.0000 9 0.0000 -10.0000 0.0000 10 0.0000 0.0000 0.0000 11 0.0000 -10.0000 0.0000 12 0.0000 28.0000 0.0000]);
PrintSpaceTrussElemForcesAndStresses(ElemForces,ElemStresses,'Int Forces and Stresses:',[1 56.0000 28.0000 2 56.0000 28.0000 3 57.5000 28.7500 4 57.5000 28.7500 5 56.0000 28.0000 6 56.0000 28.0000 7 -62.6100 -6.2610 8 -60.0300 -6.0030 9 -60.3000 -6.0300 10 -60.3000 -6.0300 11 -60.0300 -6.0030 12 -62.6100 -6.2610 13 10.0000 3.3330 14 9.2500 3.0830 15 12.0000 4.0000 16 9.2500 3.0830 17 10.0000 3.3330 18 1.6770 1.6770 19 3.2020 3.2020 20 3.2020 3.2020 21 1.6770 1.6770]);
view={{0,1,0},{0,0,1}};
box={{0,-4,0},{60,-4,0},{60,10,0},{0,10,0}};
PlotSpaceTrussDeformedShape(NodeCoordinates,ElemNodes,NodeDisplacements,...
{0,1},box,'deformed shape (unit magnif)',{view,-1,{'black','blue'}});
PlotSpaceTrussStresses(NodeCoordinates,ElemNodes,ElemStresses,1,box,...
"axial stresses in truss members",{view,0,labels});
  댓글 수: 2
Walter Roberson
Walter Roberson 2019년 10월 22일
I suspect that you might be trying to use something not available until a release after your own.

댓글을 달려면 로그인하십시오.

답변 (1개)

Daniel M
Daniel M 2019년 10월 22일
편집: Daniel M 2019년 10월 22일
Wherever you found this code, you need to download the associated functions with it. (Which I also said on the other question you asked about this.)
  댓글 수: 1
Walter Roberson
Walter Roberson 2019년 10월 22일
This appears to refer to an old course ASEN 5007, 'Introduction to Finite Element Methods". The original code appears to have been written in Mathematica. I did not locate MATLAB equivalent code. Perhaps it was just expored from Mathematica by calling a Mathematica routine that translates to MATLAB.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Structural Analysis에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by