Type conversion error: Unable to convert given STRING to Long. [message #89830] |
Mon, 08 December 2014 10:46 |
johndraper1993
Messages: 3 Registered: December 2014
|
Junior Member |
|
|
Hi, i'm currently having trouble with a particle error which i don't know how to solve.
Here is my code.
h=0.7
omega_m=0.3
zmax=6.
zmin=0.01 ;range of z
nz=100 ;# of plots for z
z=Grid(zmax,zmin,nz)
rho=dblarr(nz) ;floating point array of nz zeros everything
Lmax=48.
Lmin=42. ;range of L
n=100 ; # of points
Lbol=Grid(Lmax,Lmin,n) ;y axis and # of plots
epsilon=0.1 ; sets epsilon
c=3.e10 ;speed of light in cm/s
for k=0,nz-1 do begin
LF=FLbol(TAG, Lbol, z(k)) ;luminosity function
;first integral in Luminosity
yy=(1.-epsilon)/(epsilon*c^2.)*LF*10.^Lbol*3.16e7/(2.e33) ;rho(z)/dt accretion rate multiply this bit by dtdz divide by volume
;multiplied by seconds in a year divided by grammes in solar mass
Int=int_tabulated(Lbol,yy) ;integrate over all Lbol for yy
rho(k)=Int; ;finds accretion
endfor
res=9.777505969*(2./3/h/sqrt(1.-omega_m))*asin(sqrt((1.-omeg a_m)/omega_m)/(1.+z)^(3./2)) ;turns z into Giga years
psi=(.77e-5)*((21.86/res)^8.57)*exp(-21.86/res) ;spheroid SFR multiplied by scale factor 2.5*10^-3 for shank 10^-4 ueda
phi=(1.8e-3)*((29.39/res)^5.5)*exp(-29.39/res) ;disc SFR multiplied by scale factor 2.5*10^-3
window,0
plot,res,rho*10000,/Ylog,XTITLE='Time (Gyr)',YTITLE='Log(dp/dt) or SFR (Solar Mass Mpc^-3 yr^-1)', XRange=[12,0],Yrange=[1e-4,10] ;plot z against phi
oplot,res,psi,linestyle=2 ;spheroid SFR
oband,res,0.75*(psi),1.25*phi,color=150
The error occurs on the last line, i have obtain the module oband from this website
http://www.astro.washington.edu/docs/idl/cgi-bin/getpro/libr ary28.html?OBAND
I'm trying to use it to create an error region of +/- 25% on either side of my line.
Any help would be appreciated, Thanks John
|
|
|