用DMIS程序简单模拟日食
看到我们可爱的客服在文章DMIS中元素定义及实例做的程序,以及受到回帖的朋友想到了日食的启发,觉得用DMIS做有点意思。
于是下来做了个日食模拟的程序
对客服的程序做了点修改:1,修改运行轨迹为椭圆,2增加月亮绕地球运动轨迹
程序如下:
RECALL/D(MCS)
decl/INTGR,jj
decl/DOUBLE,x1,y1,z1,x2,y2,z2,s1,s2,s3,s4
X1=ASSIGN/150
x2=assign/60.9689
y2=assign/-73
F(SPH1) = FEAT/SPHERE,OUTER,CART, 0.000000, 0.000000, 0.000000, 40.000000
Fa(SPH1) = FEAT/SPHERE,OUTER,CART, 0.000000, 0.000000, 0.000000, 40.000000
F(ELL1) = FEAT/ELLIPS,INNER,CART, 120.000000, 0.000000, 0.000000,$
-120.000000, 0.000000, 0.000000,MAJOR, 0.000000, 0.000000, 1.000000,$
300.00000
Fa(ELL1) = FEAT/ELLIPS,INNER,CART, 120.000000, 0.000000, 0.000000,$
-120.000000, 0.000000, 0.000000,MAJOR, 0.000000, 0.000000, 1.000000,$
300.00000
F(ccc) = FEAT/POINT,CART, 150.000000, 0.000000, 0.000000, 1.000000,0,0
F(ddd) = FEAT/POINT,CART, 60.9689, -73.7520, 0.000000, 1.000000,0,0
F(PROJPT2) = FEAT/POINT,CART, 150.000000, 0.000000, 0.000000, 1.000000,0,0
F(ELL2) = FEAT/ELLIPS,OUTER,CART, 20.000000+x1, 0.000000+y1, 0.000000+z1, -20.000000+x1,$
0.000000+y1, 0.000000+z1,MAJOR, 0.000000, 0.087199, 0.996191, 50.000000
do/jj,1,500,1
D(CRD1) = ROTATE/ZAXIS,1
Fa(ccc) = FEAT/POINT,CART, x1, y1, z1, 1.000000,0,0
CONST/POINT,F(PROJPT2),PROJPT,Fa(ccc),Fa(ELL1)
x1=obtain/FA(PROJPT2),3
y1=obtain/FA(PROJPT2),4
z1=obtain/FA(PROJPT2),5
F(SPH2) = FEAT/SPHERE,OUTER,CART, X1, Y1, Z1, 7.000000
Fa(SPH2) = FEAT/SPHERE,OUTER,CART, X1, Y1, Z1, 7.000000
F(ELL2) = FEAT/ELLIPS,OUTER,CART, 20.000000+x1, 0.000000+y1, 0.000000+z1, -20.000000+x1,$
0.000000+y1, 0.000000+z1,MAJOR, 0.000000, 0.087199, 0.996191, 50.000000
Fa(ELL2) = FEAT/ELLIPS,OUTER,CART, 20.000000+x1, 0.000000+y1, 0.000000+z1, -20.000000+x1,$
0.000000+y1, 0.000000+z1,MAJOR, 0.000000, 0.087199, 0.996191, 50.000000
RECALL/D(MCS)
D(CRD2) = TRANS/XORIG, F(SPH2), YORIG, F(SPH2), ZORIG, F(SPH2)
D(CRD3) = ROTATE/ZAXIS,10*jj
Fa(ddd) = FEAT/POINT,CART, x2, y2, z2, 1.000000,0,0
CONST/POINT,F(PROJPT2),PROJPT,Fa(ddd),Fa(ELL2)
x2=obtain/FA(PROJPT2),3
y2=obtain/FA(PROJPT2),4
z2=obtain/FA(PROJPT2),5
F(SPH3) = FEAT/SPHERE,OUTER,CART, X2, Y2, Z2, 4.000000
Fa(SPH3) = FEAT/SPHERE,OUTER,CART, X2, Y2, Z2, 4.000000
RECALL/D(crd1)
T(TDISTB1) = TOL/DISTB,NOMINL, 139.113268, 0.000000, 0.000000,PT2PT,AVG
OUTPUT/FA(SPH1),FA(SPH2), TA(TDISTB1)
T(TDISTB2) = TOL/DISTB,NOMINL, 133.038151, 0.000000, 0.000000,PT2PT,AVG
OUTPUT/FA(SPH1),FA(SPH3), TA(TDISTB2)
T(TDISTB3) = TOL/DISTB,NOMINL, 13.916699, 0.000000, 0.000000,PT2PT,AVG
OUTPUT/FA(SPH2),FA(SPH3), TA(TDISTB3)
s1=OBTAIN/TA(TDISTB1),4
s2=OBTAIN/TA(TDISTB2),4
s3=OBTAIN/TA(TDISTB3),4
s4=assign/s2+s3-s1
if/s4.lt.0.1
TEXT/OPER,'日食发生'
endif
enddo
注:为了不影响观赏效果,请在运行做如下设置:1,程序设置项目-理论元素-坐标系移动时选择为“不更新”。2,请在图形视图里那个眼睛符号下面“关闭CRD图形显示”。
「该帖子被 爱科腾瑞客服 在 2009-12-10 8:52:15 编辑过」