¸¨Å骺¹B°Ê
¤@¡B¹q¸£¼ÒÀÀ¹êÅç¡G¦Û¥Ñ¸¨Åé°ÝÃD
°ÝÃD¡G·Qª¾¹D¬¶¼u¥´¨ì¨ºùØ
ª«²z¶q¡Gy¸ñ¡A§Y¦ì¸mÀH®É¶¡Åܤƪº¨ç¼Æ x(t), y(t)
ª«²z©w«ß¡]¼Æ¾Ç¼Ò«¬¡^¡Gf = m a ¡A¦b¦¹ f ¯Âºé¨Ó¦Û©ó«¤O ¡]²ÊÅé¦r¥Nªí¬O¦V¶q¡^
²É¤l¦b¦aªíªþªñ©Ò¨üªº«¤O¬O g ¡]g = GmM/R¡^¡Ag = 9.8 ¤û¹y/¤½¤ç or ¦Ì/(¬í^2)
f = ma = m ( ax ex + ay ey ) ¡A¨ä¤¤ ax = dvx/dt ¡B ay = dvy/dt
¥u¦³«¤O®É¡Af = fy ey = g m ey ¡A¤]´N¬O»¡ fy = g m
ºtºâªk¡G
§Q¥Î Euler ºtºâªk¡G
¦ì¸m xn+1 = xn + vx,n Δt ¡F yn+1 = yn + vy,nΔt
³t«× vx,n+1 = vx,n + ax,n Δt ¡F vy,n+1 = vy,n + ay,nΔt
¶i¶¥¸É¥R¡G¹ïpºâéw©Ê¤Îºë½T«×¡A¦³§ó¦nªº¿ï¾Ü
Euler-Richarson ºtºâªk¡A ¥ý¨D¥X
ax,n = fx(rn,vn,t)/m
vx,mid = vx,n + (1/2) ax,nΔt
xmid = xn + (1/2) vx,nΔt
ax,mid = fx( xmid, vx,mid, t+(1/2)Δt ) / m
µM«á¤~°µ
vx,n+1 = vx,n + ax,midΔt
xn+1 = xn + vx,midΔt
µù¡G¬°¤°»ò Euler-Richarson ºtºâªk ¤ñ Euler ªº¦n¡A¥i°Ñ¦Ò Gould ½Ò¥»¤Wªº±À¾É¡G p1¡Bp2
µ{¦¡¬yµ{¡G
(0) ¶}©l¡A«Å§iÅܼÆ
(1) °Ý½è¶q¡Bªì³t«×¡]§tªì³t²v»P¨¤«×¡^
(2) «Ø¥ß¦ì¸m x »P y¡B³t«× vx »P vy ªºªì©lÈ
(3) ¥Îºtºâªk¨D¤U¤@Ó¤p®É¬q Δt «áªº¦ì¸m»P³t«×
(4) µe¥X²É¤l¦ì¸m¨ÃÀˬd°ª«×¬O§_¤v¹F¦a±¡A¥¼¹F¦a±«h¦^¨ì (3)
(5) °Ýn¤£n¦A®g¤@¦¸¡AYn«h¦^¨ì (1)
(6) µ²§ô
§Aµ¥¤£¤Î¤F¶Ü¡H¥ý°½ª±¤@¤U¦Ñ®v¤v¸g°µ¦nªº¥i°õ¦æÀÉ cannon.x
§A°µ¤£¥X¨Ó¶Ü¡H¥ý°½¬Ý¤@¤U¦Ñ®v¤v¸g¼g¦nªº½d³òµ{¦¡ cannon.f cannon.f.txt ¡]A simpler version for starter cannon_simple.f¡^
¡]«D¤£±o¤w½Ð¤Å¥ý¬Ý¡^
°Ê°Ê¸£¡B°Ê°Ê¤â¡A¦Û¤v¦A§ï³y¡]©Î¦^®a°µ¡^¡G
1. µeÓ¤j¯¥§â¬¶ºÞªº¨¤«×ªí²{¥X¨Ó
2. ¥H¤õÃÄ¥]¸Ë¶ñ¼Æªí²{¬¶¼u°Ê¯à¡AÂà´«¦¨ªì³t²v
3. ª«Åé³Q¬µ¯}¤ùªº¼u¥X¡]°t¦X¶Ã¼Æ²£¥Í¾¹ ran3.f¡A¨Ï¥Î¤èªk¡^
4. ¸Õ¼g¤@ӷϤõµ{¦¡¡A·|¦h¬q¶}ªáÅܦ⪺
¤ÀªR»P°Q½×¡G
·Q¹w´ú¬¶¼u¥´¨ì¨ºùØ¡A¥Dn¬O°ò©ó¨º¤@±øª«²z©w«ß¡H
¤°»ò¼Ëªº¥ý¨M¡]ªì©l¡^±ø¥ó¨M©w¤F¬¶¼uªºy¸ñ¡]©M¸¨ÂI¡^¡H
¦P¼Ëªº¤õÃÄ¥]¥R¶ñ¼Æ¡A«ç»ò¥´¬¶¼u¤~¸±o³Ì»·¡H
¤G¡B¹q¸£¼ÒÀÀ¹êÅç¡G¨üªÅ®ðªý¤Oªº¸¨Åé
°ÝÃD¡G¦b¦³ªÅ®ðªý¤Oªº±¡ªp¤U¡A¬¶¼uy¸ñÅܱo¦p¦ó¡H
ª«²z¶q¡G¤@¼Ë¬Oy¸ñ¡A§Y¦ì¸mÀHÀH®É¶¡ªºÅÜ¤Æ x(t), y(t)
ª«²z©w«ß¡]¼Æ¾Ç¼Ò«¬¡^¡Gf = m a¡A¨ü¤O f ¦P®É¥]§t¤F«¤O¤ÎªÅ®ðªý¤O
ªÅ®ðªý¤O«D±`½ÆÂø¡]¦]¦¹¸¾÷©Î°ª³t¤õ¨®ªºªý¤O³]p»Ýn¾a·¬}¹êÅç©Î¹q¸£¼ÒÀÀ¨Ó¶i¦æ¡^¡A°ò¥»¤W¥¦¬O»P³t²v¦³Ãö¡A³t²v¶V°ªªý¤O¶V¤j¡AÀR¤îªºª«Åé«h¨S¦³ªÅ®ðªý¤O¡C¥i¨£¥¦¬O¤@Ó»P³t²v¦³Ãöªº¶q¡A±`¨£ªºÂ²¤Æ¤½¦¡¡A¦³ÀH³t²v¤@¦¸¤è§e¥¿¤ñªº¡A¤]¦³ÀH¨â¦¸¤è§e¥¿¤ñªº¡A¤è¦V¬O³t«×¤Ï¦V¡]t¸¹¡^ªº
Fd = - k1 v
Fd' = - k2 v2
¥Ñ©ó¦³ x »P y ¨âÓ¤À¶q¡A°²³]³t«×»P¤ô¥½uªº§¨¨¤¬° θ¡A§Y θ = tan-1(vy/vx) [ Fortran µ{¦¡¼g¦¨ theta = atan(vy/vx) ] ¡A
Fd,x = Fd cosθ
Fd,y = Fd sinθ
¡]©ÎªÌ¬O¡Aª½±µ¥Î vx/√(vx2+vy2) ¤Î vy/√(vx2+vy2) ·|¤ñ¥ý¨D θ = atan(vx/vy) ¨ú¨¤«×¤~¥h¨D cos(θ) ¤Î sin(θ) §ó¦n¡^
¦]¦¹¡A¦b¦³Ãö¤O¤§³¡¤Àªº¤½¦¡¡A
fx = Fd cosθ
fy = - m g + Fd sinθ
¨ä¥Lªº³¡¤À¡A»P¤W¤@ÓijÃD¬Û¦P
·sijÃD¡G¦p¦ó¨D±o«Ç®ðªý¤O«Y¼Æ k¡H
§Q¥Î²×ºÝ³t«×¡A§Y««ª½¸¨¤U¹Lµ{¤¤«¤O»Pªý¤O¹F¥¿Å¡A¨Ï¦X¤O¬°¹s¤£¦A¥[³t¡A¦Ó§eµ¥³t¹B°Ê®Éªº³t«×¡C
¦X¤O = 0 = - m g + Fd = - m g + k1 vy2
§Y k1 = (m g) / vy2¡A¦¹²×ºÝ³t«×¥iÂǥѹêÅç¶q±o
¤@Ó¯»µ§ÀY¤j¤pªº¥Û¤l¨ä²×ºÝ³t«×¤j¬ù¬O¨C¬í¤T¤Q¤½¤Ø¡C¥t¥~¡A¤@Ó« 0.254 §J ¡B¥b®| 2.54 ¤½¤Àªº«O§QÀs²y¦³¥H¤Uªº¹ê´ú¼Æ¾Ú¡]¤Þ¥Î Physics Teacher 24, 153 (1986) )
®É¨è¡]¬í¡^ ¦ì¸m¡]¤½¤Ø¡^ -0.132 0.0 0.0 0.075 0.1 0.260 0.2 0.525 0.3 0.870 0.4 1.27 0.5 1.73 0.6 2.23 0.7 2.77 0.8 3.35 ·Q·Q¬Ý¡A§ÚÌn«ç»ò±q¤W¦Cªº¼Æ¾Ú¨D±oªÅ®ðªý¤O«Y¼Æ k¡H
¦Ñ®v¼gªº½d¨Òµ{¦¡¡Gstyrofoam_k.f.txt styrofoam_k.f styrofoam_k.x
¤W±ªí®æ¼Æ¾Úªº¸ê®ÆÀÉ¡Gstyrofoam.txt
¡]¾¨¶q¦Û¤v·Q¡A¤£·|¦A°Ñ¦Ò¡^
ºtºâªk¡G
¦P¼Ë±Ä¥Î Euler ©Î Euler-Richardson ºtºâªk
µ{¦¡³]p¡G
»P¤W¤@ÓijÃD¬Û¦P
°Ñ¦Ò½d¨Òµ{¦¡
cannon_drift.f cannon_drift.f.txt cannon_drift.x
²¤Æ¤@¨Ç¤£¥²n¥\¯à¡AÃä·QÃä°µ¤T³¡¦±¡G
¥u¦³¦Û¥Ñ¸¨Åé¡A©è¹F¦a±°±¤î¨Ã¦C¦L°ª«×¨ÑÀˬd¡A¨S¦³Ã¸¹Ï¥\¯à¡C
¥[¤W ø¹Ï¥\¯à
³Ì«á¡A¦A¥[¤WªÅ®ðªý¤O
½è¶q»PªÅ®ðªý¤O«Y¼Æ¹ï©ß®gÅéy¸ñªº¼vÅT
mass = 1.0, k = 2.0
mass = 0.5, k = 1.0
mass = 2.0, k = 2.0
¤ÀªR»P°Q½×¡G
¥H¦P¼Ëªº¤O¹D¦V¤W©ß¤@Ó¤p¥Û¤l¡A¦b¦³ªÅ®ðªý¤O»PµL«ÇªÅ®ðªý¤Oªº¨âºØ±¡ªp¤ñ¸û¤U¡A¨º¤@ºØ·|¦bªÅ¤¤°±¯d¸û¤[¡H
¨º¤@ºØy¸ñ¹³¦Ð¤ò²y¡H¨º¤@ºØ¹³¹]²y¡H
¦b¦³ªÅ®ðªý¤Oªº±¡ªp¤U¡A©ß®gª«ªº¨¤«×n¦p¦ó³]©w¨ä¶ZÂ÷¤~·|³Ì»·¡H
¬D¾Ô¡G
¸ÕµÛ°µ¥X§A¦Û¤vªº¼««ã³¾¹CÀ¸ (§Þ³N¤Wªº²Ó¸`Åwªï»P±Ð±Â°Q½× ) ¡C
¬D¾Ô¡G
¸Õ§@¨S¦³¤â¾Þ±±ªº¡u¥´¿j¶ô¡v¹CÀ¸¡C
§@·~¡G¼u¯]¥xµ{¦¡
¼u¯]»P¥ú·Æ°v¤lªº¥æ¤¬§@¥Î¼Ò¦¡
N = Nx ex + Ny ey
| N | = 1
V dot N = Vx * Nx + Vy * Ny
¸I¼²«á V ¥¦æ©ó N ¤Wªº¤À¶q¦]¤Ï¼u¦Ó¤è¦V¬Û¤Ï¡A»P N ««ª½ªº¤À¶q«hÄ~Äòºû«ù¡A¦]¦¹¸I¼²«á
V¢r = (-1)* (V dot N) N
V// = V - (V dot N) N = V + V¢r
·sªº³t«×«h¬° V// + V¢r
¦Ñ®v´£¨Ñªºªº½d¨Òµ{¦¡ pinball.f pinball.f.txt pinball.x ¡A¿é¤J ½d¨Ò
°Ê¤â§ï³y»P°Q½×¡G
±N§Aªºµ{¦¡§ï¬°¤@¦¸ÄÀ©ñ¨âÁû¡B¤TÁû¼u¯]¡C
¦pªG¬O¹ï¼u¯]¦³¼¯À¿¤Oªº°v¤l¡A«h¼u¯]»P¤§¥æ¤¬§@¥Î¼Ò¦¡¦p¦ó¡H
PGPLOT¡G PGPT (n,x,y,SYMBOL)
¥H ran3.f ¤º§tªº ran3(iseed) ¨ç¦¡¬°¨Ò¡G
iseed = 7
x = ran3(iseed)
y = ran3(iseed)·Ç³Æ¥ô·N¤@Ó¾ã¼ÆÈ©ñ¦b¬YÓ¾ã¼ÆÅÜ¼Æ iseed ªºÈ¤º¡A¨Ì¤Wzªº¤èªk¨C¦¸¨Ï¥Î ran3( ) ¡A«h x »P y ³£·|Àò±o¤@Ó 0.0 ¨ì 1.0 ¤§¶¡ªº¼ÆÈ¡A¨C¦¸ªº¼ÆÈÁöµM¤£¤@¼Ë¡A¦ý³o¨Ç¼ÆȦb 0 ¨ì 1 ¤§¶¡¥X²{ªº¾÷²v¬O§¡µ¥ªº¡C¥t¥~¡Aª½±µ§â¾ã¼Æ¶ñ¤J ran3( ) «o¨Ã¤£¤ä´©¡A¦p xx = ran3(7)¡A·|¾ÉP "°Ï¬q¿ù»~ (Sgementation Fault)" ¡C
¸Õ¸Õ¬Ý¡A¼g¤@Ó¥á»ë¤lµ{¦¡¡C¨Ò½d¡Gdice.f ¡A°O±o»P ran3.f ¤@°_½sĶ¡A¦p gfortran diec.f ran3.f <Enter>¡C
¥t¥~ gfortran ¤ä´©¤º«Ø°Æµ{¦¡ random_number(¹ê¼ÆÅܼÆ)¡A´N¤£¥²¥t¥~¥Î¥~³¡ªº¶Ã¼Æ¨ç¦¡¤F¡A¥i°Ñ¦Ò¥t¤@»ë¤lµ{¦¡½d¨Ò dice_gfortran.f¡C«³]¶Ã¼ÆºØ¤lªº°Æµ{¦¡¬O random_seed ²Ó¸`½Ð¨£¡G http://www.nsc.liu.se/~boein/f77to90/a5.html#section21c
¶i¶¥¾\Ū¡G
Gould and Tobochnik, An Introduction to Computer Simulation Methods -- Applications to Physical Systems, Addison Wesley (1996) Chapter 2, Chapter 3