m=1*10**-3#mass of 1 grm in kgs
c=3*10**8
e=m*c**2
E=e/(1000*3600)
print "energy equivalent of 1 gram is %dkWh"%E
amu=1.66*10**-27#mass equvalent in kgs
c=3*10**8
j=6.242*10**12
e=amu*c**2
E=e*j
print " energy evalent in joules is %ejoules \n energy equvalent in Mev is %dMeV \n hense shown"%(e,E)
hm=2.0141
hp=1.007825
hn=1.008665
nm=58.9342
np=28
nn=59
um=235.0439
up=92
un=235
hmd=hp+hn-hm ;nmd=np*hp+(nn-np)*hn-nm ;umd=up*hp+(un-up)*hn-um
hbe=931*hmd ;nbe=931*nmd; ube=931*umd
ahbe=hbe/2 ;anbe=nbe/nn ;aube=ube/un
print "\t(a)\n mass defect is for hydrogen %famu \n total binding energy for hydrogens %fMev \n average binding energy for hydrogen is %fMeV"%(hmd,hbe,ahbe)
print "\n\t(b)\n mass defect is for nickel %famu \n total binding energy for nickel is %fMev \n average binding energy for nickelis %fMeV"%(nmd,nbe,anbe)
print "\n\t(c)\n mass defect of uranium is %famu \n total binding energy uranium is %fMev \n average binding energy uranium is %fMeV"%(umd,ube,aube)
from math import exp
no=1.7*10**24
hl=7.1*10**8
t=10*10**8
lm=0.693/(hl)
lmda=lm/(8760*3600)
ia=lmda*no
n=no*(exp(-lm*t))
print "(lamda) disintegrations per sec is %ebq \n initial activity is lamda*na is %ebq \n final number of atoms is %eatoms"%(lmda,ia,n)
um=5
owp=2.6784*10**15
an=6.023*10**23
na1g=an/235
na5g=an*5/235
p=na5g/owp
print " 1 watt power requvires %efussions per day \n number of atoms in 5 gram is %eatoms \n power is %eMW "%(owp,na5g,p)
pp=235
pe=0.33
lf=1
teo=pp*8760*3600*10**6
ei=teo/pe
nfr=3.1*10**10#fessions required
tnfr=nfr*ei
t1gu=2.563*10**21 #total uranium atoms in 1 grm
fure=tnfr/t1gu
print "total energy input %eWatt sec \n energy input is %eWatt-sec\n total number of fissions required is %efissions \n fuel required is %e grams %dkg"%(teo,ei,tnfr,fure,fure/1000)
from __future__ import division
from math import log,exp
en=3*10**6
a=12
fen=0.1
Es=2/(12+2/3)
re=exp(Es)
print "(a)\nratio of energies per collision is %f"%(re)
rietf=en/fen
ldie=log(rietf)
nc=ldie/Es
print "(b)\npatio of iniial to final energies is %e \nlogarithemic decrement in energy is %f \nnumber of collisions is %d"%(rietf,ldie,nc)