1Matlab计算Z-m(球内星系)

记号:m 代表星等
____________________________________________________________________________

函数文件1 rmxx.m    %球内的r-m关系,给出m求对应的r
function r=rmxx(m)
r=10^(0.2*m-4)
____________________________________________________________________________
函数文件2    zmrn.m
function zmn=zmrn(r,H,M,a,V)
    %文件名为zmrn.m ,是球内的Z-r关系
global H M a V
zmn=0.003335641*H*r+0.5*(0.003335641*H*r)^2+0.005296998*V*M*r*r/
(1-0.005296998*V*M*r*r-0.360873745*M/a)
____________________________________________________________________________
函数文件3 : logcz
function logcz=logcz(z)          %星系和类星体都用此式
logcz=log10(2.99792458*10^5*z)  %log cz , 用于哈勃图中的曲线拟合
____________________________________________________________________________
M-文件1 mzxx   (球内星系m-z关系)
global H M a V V0
H=68;
M=1.0;
a=3.59;
V=7.039093903;
V0=7.528217346;
m=input('m=');
rmxx(m)
r=input('r=');
zmrn(r)
z=input('z=');
logcz(z)
____________________________________________________________________________

 2Matlab计算Z-m(球内类星体)
____________________________________________________________________________
函数文件4 rmlx.m
function r=rmlx(m)         %球内类星体r-m关系,给出m求对应的r
r=10^(0.2*m-3.2)
____________________________________________________________________________
M-文件2     zmlxn     (球内类星体的Z-m命令文件)
global H M a V V0
H=68;
M=1.0;
a=3.59;
V=7.039093903;
V0=7.528217346;
m=input('m=');         % 13 < m < 19
rmlx(m)
r=input('r=');
zmrn(r)
z=input('z=');
logcz(z)
____________________________________________________________________________

3Matlab计算Z-m(球外类星体)
____________________________________________________________________________
函数文件5
function zmw=zmrw(r,H,M,a,V0)
global H M a V0
zmw=0.003335641*H*r+0.5*(0.003335641*H*r)^2+
(0.005296998*V0*M*r*r+0.240582497*M/r-0.360873745*M/a)/
(1-0.005296998*V0*M*r*r-0.240582497/r)
____________________________________________________________________________
M-文件3   zmlxw   (球外类星体的Z-m命令文件)
global H M a V V0
H=68;
M=1.0;
a=3.59;
V=7.039093903;
V0=7.528217346;
m=input('m=');         % 18 < m < 20
rmlx(m)
r=input('r=');
zmrw(r)
z=input('z=');
logcz(z)