Simulation of beam vibrationBeijing Institute of Technology | Ming-Jian Li
The following APDL code is a companion code for the course on Artificial Intelligence and Simulation Science. Its function is to solve the vibration process of a beam with one end fixed and the other end subjected to force using the finite element method. The following code needs to be executed in ANSYS, APDL is the parameteric language of ANSYS.
x1fini2/clear3/FILNAME,noodle,1 4/PREP7 5/units,SI6ET,1,solid1857mp,EX,1,40e38mp,PRXY,1,0.3 9mp,DENS,1,120010a=0.0111b=0.0112c=0.713block,0,c,-a/2,a/2,-b/2,b/214LSEL,all15LESIZE,ALL,a16alls17TYPE,1 18MAT,119vmesh,all20alls21/sol22nsel,s,loc,x,023d,all,ux,024d,all,uy,025d,all,uz,026alls27deltat=0.128n=10029force=1e-430freq=131/SOL32antype,trans33TRNOPT,FULL34*do,i,1,n,135 TIME,i*deltat36 nsel,s,loc,x,c37 f,all,fy,force*cos(2*3.14*freq*i*deltat)38 alls39 solve 40*enddo41saveThe result is as follows.
