finish
/clear,nostart  

! Parametry
d2=33.7 ![mm]
d1=28.7 ![mm]
E=210000 ![MPa]
mi=0.3
l=1000 ![mm]
SUBSTEP=30

!/NOPR   
!KEYW,PR_SET,1   
!KEYW,PR_STRUC,1 
!KEYW,PR_THERM,0 
!KEYW,PR_FLUID,0 
!KEYW,PR_MULTI,0 

/PREP7 
! Element type  
ET,1,BEAM189

! Prurez
SECTYPE, 1, BEAM, CTUBE, , 0  
SECOFFSET, CENT 
SECDATA,d1/2,d2/2,0,0,0,0,0,0,0,0,0,0  

! Material 
MPTEMP,,,,,,,,  
MPTEMP,1,0  
MPDATA,EX,1,,E 
MPDATA,PRXY,1,,mi  

! Model
K,1,,,, 
K,2,1000,,, 
L,1,2

! Sit
MAT,1
LESIZE,ALL,20
LMESH,ALL

! Okrajove podminky
KSEL,S,KP,,1
DK,ALL,ALL,0
KSEL,S,KP,,2
DK,ALL,UY,0
DK,ALL,UZ,0
ALLSEL,ALL

KSEL,S,,,1,2
NSLK,S
F_kraj=-SUBSTEP*100/100/2
F_in=-SUBSTEP*100/100
F,ALL,FY,F_kraj
NSEL,INVE
F,ALL,FY,F_in
ALLSEL,ALL

/SOL
ANTYPE,0
NSUBST,SUBSTEP,SUBSTEP,SUBSTEP
OUTRES,ERASE
OUTRES,ALL,1
TIME,substep

SOLVE

/POST1
SET,FIRST
SET,LAST
/ESHAPE,1
PLDISP,1

PRNSOL,U,Y  
AVPRIN,0, , 
ETABLE, ,LS, 1   
PLETAB,LS1,NOAV

*DIM,red_nap,ARRAY,SUBSTEP,2
*DIM,POSUV,ARRAY,SUBSTEP,1
SET,FIRST
*DO,i,1,SUBSTEP,1
	*GET,red_nap(i,1),SECR,,S,EQV,MAX
	*GET,red_NAP(i,2),SECR,,S,X,MAX
	*GET,POSUV(i),NODE,NODE(1000-421.535,0,0),U,Y
	SET,NEXT
*ENDDO
SET,1,SUBSTEP
PLDISP,1
PLNSOL,UY

!******************VYPSÁNÍ VÝSLEDKŮ*************************************
!NUTNO SPOUŠTĚT POMOCÍ READ INPUT FROM
filename = 'red_nap_fixed_smaz'
*MWRITE,red_nap(1,1,1),%filename%,txt,,JIK,,SUBSTEP,1    
(300F10.5)
filename = 'posuv_fixed_smaz'
*MWRITE,POSUV(1,1,1),%filename%,txt,,JIK,,SUBSTEP,1    
(300F10.5)
