Matlab球内的计算

记号:n-球内;r-距离或半径;v-速度红移;e-斥力红移;*乘号

函数文件 1 zvr1.m

function zv1=zvr1(r,H)
global H
zv1=0.003335641*H*r
______________________________________________________________________

函数文件 2 zvr2.m

function zv2=zvr2(r,H)
global H
zv2=0.5*(0.003335641*H*r)^2

______________________________________________________________________

函数文件 3 zvr12.m

function zv12=zvr12(r,H)
global H
zv12=zvr1(r)+zvr2(r)
______________________________________________________________________

函数文件 4 :zer.m

function ze=zer(r,M,a,V)
global M a V
ze=0.005296998*V*M*r*r/(1-0.005296998*V*M*r*r-0.360873745*M/a)
______________________________________________________________________

函数文件 5 zver.m

function z=zver(r,H,M,a,V)
global H M a V
z=zvr12(r)+zer(r)
______________________________________________________________________

M文件 :qn.m

global H M a V
H=68;
M=1.0;
a=3.59;
V=7.039093903;
r=input('r=');
zver(r)
______________________________________________________________________