Try   HackMD

Lecture 5 萬有引力定律與克卜勒行星運動定律 完整作業參考解法

建國高中特色選修課程 - 物理現象的程式設計與模擬
作者:賴奕帆
日期:2018/8/01

  • 同學們,在看參考解之前,請先想清楚自己是否真的有花時間想過如何寫課堂作業和進階作業了呢?

  • 學習無他,但求自己覺得好玩而已。

  • 若真的想把一件事情學好,務必花時間才能掌握。

  • 希望這邊的作業參考解法,真的都只是讓同學們拿來參考,而不是為了繳交作業的複製貼上。

  • 想過了嗎? 那請認真參考吧。

Lecture 5 作業

檢核作業 5-1

利用前述的圖表,討論衛星在橢圓運動中,是否有遵守力學能守恆。
註:在衛星空間尺度中,由於萬有引力不是定值,因此衛星與地球間的位能公式應為

U(r)=GMmr 位能的零位面設定為無窮遠處,此公式會在高二物理第七章「功、動能與位能」中介紹。

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

檢核作業 5-1 參考解法步驟 :

  1. 在畫面設定處,更改圖表設定,準備畫出動能、位能與總力學能三條曲線。
"""更改圖表 (2. 畫面設定)""" gd = graph(align='left',width=400,height=400, title='K+U=E', xtitle='t', ytitle='E(red) , K(black) , U(green)', foreground=color.black,background=color.white, xmax=1*10**5, xmin=0, ymax=4*10**10, ymin=-4*10**10) f1 = gcurve(color=color.red) f2 = gcurve(color=color.black) f3 = gcurve(color=color.green)
  1. 在執行迴圈處,計算衛星任意瞬間的動能、位能與總力學能
"""計算衛星運動中的動能、位能與總力學能 (3. 執行迴圈)""" materK = 0.5*m*(____________________________________) #動能 materU = -G*M*m/dist #位能 materE = materK+materU #總力學能
  1. 在執行迴圈處,將算出的能量匯入圖表之中
"""將動能、位能與總力學能匯入圖表 (3. 執行迴圈)""" f1.plot(pos=(t,________)) f2.plot(pos=(t,________)) f3.plot(pos=(t,________))

檢核作業 5-2

再加入兩個衛星,讓三個衛星有不同的初速,觀察整體的運動狀況。

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

檢核作業 5-2 參考解法步驟 :

  1. 在畫面設定處,再加入兩個不同的衛星mater2與mater3,且讓每個衛星的初速度均不相同
"""再加入兩個衛星 (2. 畫面設定)""" mater2 = sphere(pos=vec(H,0,0), radius=0.1*Re,color=color.blue, make_trail=True) mater2v = ______________ mater3 = sphere(pos=vec(H,0,0), radius=0.1*Re,color=color.yellow, make_trail=True) mater3v = ______________
  1. 在執行迴圈處,分別計算兩個不同的衛星mater2與mater3受太陽的引力,並使開始其運動
"""計算mater2與mater3的引力 (3. 執行迴圈)""" dist2 = ((mater2.pos.x-earth.pos.x)**2+____________________________ radiavector2 = (mater2.pos-earth.pos)/dist2 Fg_vector2 = Fg(dist2)*radiavector2 mater2v += ____________/m*dt mater2.pos = mater2.pos + _________*dt

檢核作業 5-3

利用三點紀錄法找出衛星運動的週期。

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

檢核作業 5-3 參考解法步驟 :

  1. 在參數設定處,除了原有的t=0外,再加上一個T=0,以計算運動週期
"""計算衛星運動週期(1. 參數設定)""" T = 0
  1. 在執行迴圈處,加入T=T+dt,使T一樣會隨著迴圈累加時間。
"""在迴圈中計算衛星運動週期(3. 執行迴圈)""" T = T+dt
  1. 在前述利用pre找四端點位置處,將其中三個位置用ALT+3暫時刪除後,並修改print,使可印出運轉週期T,並在印出後使T歸零(T=0)
"""在迴圈中計算衛星運動週期(3. 執行迴圈)""" if pre_mater_pos.x > pre_pre_mater_pos.x and pre_mater_pos.x > mater.pos.x : print (mater.pos , T , t) #修改 T = 0 ##if pre_mater_pos.x < pre_pre_mater_pos.x and pre_mater_pos.x < mater.pos.x : ## print (mater.pos) ##if pre_mater_pos.y > pre_pre_mater_pos.y and pre_mater_pos.y > mater.pos.y : ## print (mater.pos) ##if pre_mater_pos.y < pre_pre_mater_pos.y and pre_mater_pos.y < mater.pos.y : ## print (mater.pos)

指定作業 5-1

請在衛星運動中,加入速度與加速度(分解為

aT
aN
)向量的箭頭,我們可以利用功能定理,討論為何近地點(近日點)速率較快,而遠地點(遠日點)速率較慢。

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

指定作業 5-1 參考解法步驟 :

  1. 在畫面設定處,加入兩個向量箭頭,標示衛星速度向量(紅色)與加速度向量(黃色),並在執行迴圈處,讓兩個向量箭頭與衛星一起運動,讓其長度代表衛星的速度與加速度。(注意為了讓動畫向量顯著,可自行調整量值的大小)
"""繪製速度向量(紅色)與加速度向量(黃色)(2. 畫面設定)""" v_arrow = arrow(pos=mater.pos,axis=vec(0,0,0),shaftwidth=0.4*mater.radius ,color = color.red) a_arrow = arrow(pos=mater.pos,_____________________________)
"""讓速度箭頭與加速度箭頭,隨著衛星一起運動(3. 執行迴圈)""" v_arrow.pos = mater.pos v_arrow.axis = materv*2*10**3 #乘2*10**3 #為了讓動畫的速度向量顯著 a_arrow.pos = mater.pos a_arrow.axis = Fg/m*5*10**6 #乘 5*10**6 #可自行調整大小
  1. 再繪製兩個箭頭,並利用內積與外積的數學概念將加速度分解為
    aT
    aN
"""繪製切線加速度與法線加速度(2. 畫面設定)""" aT_arrow = arrow(pos=mater.pos,axis=vec(0,0,0),shaftwidth=0.6*mater.radius ,color = color.black) aN_arrow = arrow(pos=mater.pos,axis=vec(0,0,0),shaftwidth=0.6*mater.radius ,color = color.blue)
"""讓切線加速度箭頭與法線加速度箭頭,隨著衛星一起運動(3. 執行迴圈)""" aT_arrow.pos = mater.pos aT_arrow.axis = dot(Fg/m,materv)*(norm(materv)/mag(materv))*5*10**6 aN_arrow.pos = mater.pos aN_arrow.axis = (mag(cross(Fg/m,materv))/mag(materv))*cross(norm(materv),vector(0,0,-1))*5*10**6

指定作業 5-2

請嘗試驗證克卜勒行星第三定律。

克卜勒行星第三定律又稱週期定律
定律內容:『各行星若繞同一恆星時,其公轉週期的平方與行星到太陽平均距離的三次方成正比。
物理公式:

a3T2=const. (半長軸
 a=
行星到太陽平均距離
 =r+r2
)
此為克卜勒以大量觀察數據歸納出的,後來牛頓以行星受到萬有引力當作向心力來驗證其結果。

指定作業 5-2 參考解法步驟 :

  1. 繪製太陽、金星與地球,金星與地球以圓形軌道繞行太陽運行。
  2. 利用課堂作業5-3計時器概念,分別找出金星與地球繞行太陽軌道的週期。
  3. 將金星與地球的軌道半徑與週期代入克卜勒行星第三定律的公式中,驗證在正圓形軌道下,克卜勒行星第三定律是否正確。
"""找地球右端點位置,算k1 = r1^3/T1^2(3. 執行迴圈)""" if pre_earth_pos.x > pre_pre_earth_pos.x and pre_earth_pos.x > earth.pos.x : earth_T = t1 #設定earth_T為地球週期 print (' k1 = r1^3/T1^2 = ', R_sun_earth**3/earth_T**2) #列印結果 t1=0 #時間重置
  1. 略為改變金星與地球的初速度,使其改為橢圓形軌道。
  2. 利用本節內容,找出橢圓形軌道的半長軸
    a
    與運行軌道週期
    T
"""找地球左端點位置(3. 執行迴圈)""" if pre_earth_pos.x < pre_pre_earth_pos.x and pre_earth_pos.x < earth.pos.x : earth_left_point = earth.pos.x #紀錄地球最左端點 """找地球右端點位置,算k1 = r1^3/T1^2""" if pre_earth_pos.x > pre_pre_earth_pos.x and pre_earth_pos.x > earth.pos.x : earth_right_point = earth.pos.x #紀錄地球最右端點 earth_a = (abs(earth_right_point)+abs(earth_left_point))/2 #計算橢圓下半長軸 earth_T = t1 #設定earth_T為地球週期 #設定earth_T為地球週期 print (' k1 = r1^3/T1^3 = ', earth_a**3/earth_T**2) #列印結果 t1=0 #時間重置