Matlab球外的计算  

记号:w-球外;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 :zerw.m

function ze=zerw(r,M,a,V0)
global H M a V0
k1=0.005296998;
k2=0.240582497;
k3=0.360873745;
ze=(k1*V0*M*r*r+k2*M/r-k3*M/a)/(1-k1*V0*M*r*r-k2/r)______________________________________________________________________

函数文件 5 zvew.m

function z=zvew(r,H,M,a,V,V0)
global H M a V V0
z=zvr12(r)+zerw(r)
______________________________________________________________________

M文件 :qw.m

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