Ahmed,
Below is a skeleton for a apdl-input file that you can use as a base, it covers the steps you need to do, and to some extent how you do it. The rest you can find in the manual.
[pre]! USE the function editor to define a function like this:
! 0.0025*sin(2*{Y}) or whatever you want to do
! save as "sinfun" in your working directory
! Read function into a table
! /INPUT,sinfun.func,,,1
/prep7
! Apply functional BC:SET
nsel,all !or the nodal set you wish to apply the displacements to
D,all, , %SINS% , , , ,ALL, , , , ,
/solu
solve
! enter the post processing environment
/POST1 ! Check the displacements...
/EFACET,1
PLNSOL, U,SUM, 0,1.0
! return to prep7 and update geometry, set up the new analysis type
/prep7
UPGEOM,1,LAST,LAST,'file','rst',' '
!* New analysis (Eigenbuckling)
ANTYPE,1
!*
BUCOPT,LANB,1,0,0,CENTER
ddele,all,all,all ! remove all constraints from previous loadstep
! apply boundary conditions and loads for your buckling analysis
/Solu
solve[/pre]
hope this helps
petb