logo
Программы освоения Луны

5. Пример одной программы

При выполнении расчётов было использовано программное приложение, разработанное на кафедре небесной механики, астрометрии и гравиметрии астрономического отделения физического факультета МГУ. Алгоритм вычисления теоретического значения результатов измерений движения Луны по орбите вокруг Земли на алгоритмическом языке Паскаль выглядит следующим образом (данные см Приложение 1): [17,18]

{ to make deal with the Lunar laser observations }

UNIT UnLunObs ;

INTERFACE

Uses

UnConTyp ; { for TVect3 for example }

Procedure TryMoonLaserObs ;

Procedure TryMoonReflCoor ( nscomp : Integer ) ;

IMPLEMENTATION

Uses

UnQLBinF , { for BinName and BinFile LaserObs of TLaserObs }

UnForPrt , { for protocol file PrtFile }

UnStCoor , { for station position in different system }

UnRefLun , { for Lunar reflector position BarCReflPos }

UnForTim , { for type TMoment }

UnParMod , { for type TParMod and ModelCor procedure }

UnVarDoi , { to try to improve some parameters }

UnPseudo , { for TypeDimM }

UnRefCor ; { for ToGetRefraCor }

{ a try to compare observations with calculations

observable value two-way time delay is in LaserObs.dobs in second }

Function ToGetLunaR ( obs : TLaserObs ; par : TParMod ) : Extended ;

Var

Eph1 : Extended ; { barycentric moment of fire }

Pos1 : TVect3 ; { station pos refer to Solar barycentre }

Eph2 : Extended ; { barycentric moment of reflection }

Pos2 : TVect3 ; { reflector position refer to Solar barycentre }

Eph3 : Extended ; { barycentric moment of receive in scale T_eph }

Pos3 : TVect3 ; { station position in receive moment }

utc3 : TMoment ; { receive moment scale UTC }

ref1 : Extended ; { the first correction for refraction in meter }

ref2 : Extended ; { the second correction for refraction in meter }

CelT : TMatr33 ; { celestial terrestrial matrix }

Begin

BarCStatPos(obs,par,obs.obst,Eph1,Pos1,CelT); { UnStCoor fire moment }

BarCReflPos(obs,par,Eph1,Pos1,Eph2,Pos2); { UnRefLun reflector }

ref1:=ToGetRefraCor(obs,Pos1,Pos2,CelT); { unit UnRefCor }

StatReceive(obs,par,Eph2,Pos2,Eph3,Pos3,CelT,utc3); { UnStCoor }

ref2:=ToGetRefraCor(obs,Pos3,Pos2,CelT); { unit UnRefCor }

ToGetLunaR:=86400*VelOfLight*(utc3.part-obs.obst.part) { two-way delay }

+1.0e-3*(ref1+ref2); { plus refraction two-way correction }

End;

Procedure ToWriteCurDif ( num : Integer ;

obs : TLaserObs ;

dif : Extended ) ;

Begin

WriteLn(num:6,obs.nsar:5,obs.nsto:6,

VelOfLight*obs.dobs:16:6,

dif:16:6,1.0e3*(dif-VelOfLight*obs.dobs):16:3);

WriteLn(PrtFile,num:6,obs.nsar:5,obs.nsto:6,

VelOfLight*obs.dobs:16:6,

dif:16:6,1.0e3*(dif-VelOfLight*obs.dobs):16:3);

End;

{ to read record by record from binary file with observations }

Procedure TryMoonLaserObs ;

Var

obs : TLaserObs ; { type from UnQLBinF }

par : TParMod ; { model differences to parameters from UnParMod }

dif : Extended ; { two way delay as calculated }

Begin

ModelCor(0,0,par); { nullo corrections from unit UnParMod }

Assign(BinFile,BinName); { all variables from UnQLBinF }

{$I-}

ReSet(BinFile);

{$I+}

If IOResult <> 0 Then Exit ; { no binary file }

NumObsCur:=0; { var in UnQLBunF count for observations in binary file }

WriteLn(PrtFile);

While NOT EOF(BinFile) Do

Begin

Read(BinFile,obs); { record LaserObs of TLaserObs from UnQLBinF }

NumObsCur:=NumObsCur+1; { the next record }

dif:=ToGetLunaR(obs,par); { simple actions }

ToWriteCurDif(NumObsCur,obs,dif);

End;

Close(BinFile);

End;

Procedure TryMoonReflCoor ( nscomp : Integer ) ;

Var

itr : Byte ; { count for variation }

nuc : Integer ;

obs : TLaserObs ;

par : TParMod ; { from unit UnParMod }

dif : Extended ;

dip : TypeDimM ;

sip : TypeDimM ; { type from UnPseudo }

Begin

ModelCor(0,0,par); { from UnParMod }

Assign(BinFile,BinName); { all variables from UnQLBinF }

{$I-}

ReSet(BinFile);

{$I+}

If IOResult <> 0 Then Exit ; { no binary file }

itr:=0; { for result without variation }

WriteLn(a try to adjust position Luna reflector ,nscomp);

WriteLn(PrtFile);

WriteLn(PrtFile,a try to adjust position Luna reflector ,nscomp);

nuc:=0; { simple count }

Repeat

If itr > 0

Then

WriteLn(variation number,itr:3,,,nuc:6, observations);

ReSet(BinFile);

nuc:=0; { count for selected observations in binary file }

While NOT EOF(BinFile) Do

Begin

Read(BinFile,obs); { record LaserObs of TLaserObs from UnQLBinF }

If obs.nsar = nscomp

Then

Begin

nuc:=nuc+1;

dif:=ToGetLunaR(obs,par); { simple actions in km }

DimVar[itr]^[nuc]:=dif; { for variation }

If itr = 0

Then { residual }

DimObs^[nuc]:=VelOfLight*obs.dobs-dif;

End;

End;

itr:=itr+1;

ModelCor(2,itr,par); { variation of itr coor of Lunar reflector }

Until itr > 3 ;

Close(BinFile);

ClcCorrections(nuc,dip,sip); { from unit UnVarDoi }

AfterCorPos(nscomp,dip,sip); { from unir UnRefLun correction to CorMop }

End;

END.