58 lines
1.6 KiB
Fortran
58 lines
1.6 KiB
Fortran
|
Program Strut
|
||
|
real::random@,stress_val(300),strain_val(300)
|
||
|
open(unit=10,file='rnd.dat',status='unknown')
|
||
|
num_thick=10
|
||
|
num_long=3
|
||
|
yield=350.0
|
||
|
stress_low=650.0
|
||
|
stress_range=100.0
|
||
|
strain_low=0.15
|
||
|
strain_range=0.4
|
||
|
call set_seed@(1.0)
|
||
|
do irun=1,5
|
||
|
do i=1,300
|
||
|
stress_val(i)=stress_low+stress_range*(random@())
|
||
|
read(10,*)r1
|
||
|
strain_val(i)=r1
|
||
|
enddo
|
||
|
do i=1,22
|
||
|
icheck=0
|
||
|
stress=350.+float(i)*2
|
||
|
do j=1,num_long
|
||
|
stran=0.
|
||
|
do k=1,60000
|
||
|
tstran=float(k)/100000.-0.00001
|
||
|
tstress=0
|
||
|
icheck1=0
|
||
|
do m=1,num_thick
|
||
|
smag=stress_val(j*num_thick-m+1)
|
||
|
emag=strain_val(j*num_thick-m+1)
|
||
|
if(tstran<emag)then
|
||
|
tstress=tstress+(tstran/emag)*(smag-yield)+yield
|
||
|
else
|
||
|
tstress=tstress+0.
|
||
|
endif
|
||
|
enddo
|
||
|
tstress=tstress/float(num_thick)
|
||
|
if(tstress-0.02<stress.and.tstress+0.02>stress)then
|
||
|
stran=stran+tstran
|
||
|
icheck1=1
|
||
|
exit
|
||
|
endif
|
||
|
enddo
|
||
|
if(icheck1==0)then
|
||
|
icheck=1
|
||
|
exit
|
||
|
endif
|
||
|
enddo
|
||
|
if(icheck==1)then
|
||
|
print *,so,eo
|
||
|
exit
|
||
|
endif
|
||
|
stran=stran/(float(num_long))
|
||
|
so=stress
|
||
|
eo=stran
|
||
|
enddo
|
||
|
enddo
|
||
|
end program
|
||
|
|