Ȼ/14

Top / Ȼ / 14

βˤĤ

ơž夲ñʿҤαư򥷥ߥ졼󤷤Ƥߤ褦ȤΤä

ޤľγ٤ θ rad Ȥ Newton αư

pendulum-eq.png
Ҥαư

˵夹ΤϹ⹻ʪμȤǤäƤϤ(ͤˤäƤdzؤǤ)򤬤狼äƤޤ*1ץǶȤʤΤǤΤ褦ˤ褦
ޤΤޤޤǤϰˤΤǡμƱͽ°ѿ䤷ư쳬ʬѷ褦

pendulum-eq-mod.png
Ҥαư(ѷ)

ȤˤʤơФ Euler ˡŬѤȡ

pendulum-euler.png
Ҥαư(ѷǤ Euler ˡˤ)

Ȥ롥ˤ򰷤䤹ľơ

pendulum-euler-mod.png
Ҥαư(ѷǤ Euler ˡˤ狼䤹)

ȤǤΤǡȤ˥ץȤ⤦͡ʶŪߤǡΥץȤۤȤѤʤǡȤмΤ褦ˤʤ

  1. include Math
  2.  
  3. # Euler ˡ˴Ťơλ֥ƥåפ u,v ׻
  4. def euler(u,v,dt,l)
  5.   g = 9.8
  6.  
  7.   u_new = u + v*dt
  8.   v_new = v - (g/l)*sin(u)*dt
  9.  
  10.   return u_new, v_new
  11. end
  12.  
  13. # x, yϤ
  14. def outputXY(u,l)
  15.   x = l*sin(u)
  16.   y = - l*cos(u)
  17.   print(x,", ",y,"\n")
  18. end
  19.  
  20. # ʲץ
  21.  
  22. #
  23. l = 1.0
  24.  
  25. #
  26. u = PI/3.0
  27. v = 0.0
  28. time = 0.0
  29.  
  30. # λ
  31. t_limit = 5.0
  32.  
  33. # ֹ
  34. dt = 0.01
  35.  
  36. # λ֤ޤǤϷ׻򷫤֤
  37. while (time < t_limit) do
  38.  
  39.   # x, y
  40.   outputXY(u,l)
  41.  
  42.   # Euler ˡǼλ֥ƥåפ u,v ׻
  43.   u,v = euler(u,v,dt,l)
  44.  
  45.   # ֤򹹿
  46.   time += dt
  47. end

㤨ФΥץưС 501 ԤȤʤǡե뤬夬롥ǡΥǡե̾㤨 pendulum.dat ȤơưŪɽ뤿 gnuplot եѰդ롥
ޤեΤ pendulum.plt Ȥ

  1. set xrange[-1.0:1.0]
  2. set yrange[-1.0:0.0]
  3. set xlabel "x"
  4. set ylabel "y"
  5. unset key
  6.  
  7. line=0
  8. load "pendulum.loop"

Ѱդ1ԤĥդʬΤΥե pendulum.loop ʲΤ褦Ѱդ褦

  1. plot "pendulum.dat" every ::line::line w p pt 6 ps 3
  2. line=line+1
  3. pause 0.01
  4. if(line<501) reread

gnuplot

 load "pendulum.plt"

Ȥ(® PC ʤ) ¤ȤۤƱư̤Ǹ뤳ȤǤϤ

warning.png 1ԤĤΥդեˤƤȤưϡ㤨 pendulum.plt

  1. set xrange[-1.0:1.0]
  2. set yrange[-1.0:0.0]
  3. set xlabel "x"
  4. set ylabel "y"
  5. unset key
  6.  
  7. set terminal png font arial 18 size 800,600
  8.  
  9. line=0
  10. load "pendulum.loop"
  11.  
  12. set terminal win
  13. set output

Ȥ롼ʬե pendulum.loop

  1. op = sprintf("p-%03d.png",line)
  2. set output op
  3. plot "pendulum.dat" every ::line::line w p pt 6 ps 3
  4. line=line+1
  5. if(line<501) reread

ʤɤȤСgnuplot

 load "pendulum.plt"

Ȥȡ501 png ե뤬äȺ뤳Ȥˤʤ롥
ȤϤҲ𤷤ˡưѤСư褬롥
㤨С 501 β FFmpeg Ǻ flv ե JNorth_arrow-right-sm.pngұưưե Τ褦ˤʤ(٤ PC ǤǤ褦˲ְ 50fps ȤƤ)


̥ݡ

ޤǤΥݡȤ˲ä̤˲̥ݡȡפѰդ(ˤĤƤϼ˸ƬƤ)
,,ФˤĤƤϰʲ̤ꡥ

ءʪءʪͽۤΤ褦ʥץꡤ̤Ϥ补

  1. Ȼ˼ȥ󥱡ȤƤʤΤϥ󥱡ȤȰФ뤳(JNorth_arrow-right-sm.png󥱡ѻ)
  2. Ф뤳
  3. оݤȼפˤ뤳ȡ ʣͤоݤƱ硤ϰʬ롥
  4. ݡȤΡֹפ򤭤Ȥ뤳ȡ褯狼ʤȤͤϡưʲιˤ뤳ȡ
    1. : оβ
    2. : ץӥץꥹȤ
    3. : ¸
    4. ;: ¸̤β
  5. ĤΤ褦ˡƼξ򤭤ȵܤ뤳ȡ
    1. ̾
    2. ̥ݡȡפȤɽ
    3. °(ز)
    4. ֹ
    5. ǯ
    6. ̾
    7. ݡ

ФˤĤ

  1. : ˭極Сǥ󥿡 6F 615 漼 ͤ(ʿ 4:30 PM ޤ)
  2. д: 2010ǯ 817(󥱡Ȥд¤ 86)
  3. ʪ: ݡȡӥ󥱡(ȻΥ󥱡Ȥ˵뵡ʤäԤΤߡ󥱡д¤ˤαդ)

줾줫顤ݥĥݥĤȥݡȤϤƤꡤˤϤʤʤϫ⤢괶Ƥޤ
դˡǰʤȤ¾ͤ web ε⤿ݡȤʣޤ

ݡȤѤϡ

  • ɮˤ԰١פǤ
    (ɮפˤϥݡФޤޤƤޤ)
  • ˡȿȤʤְˡ԰١פǤ

ȤȿҲŪ԰٤ǤꡤؤޤืʬؤˤäƤǽޤ

ߤʤޤϼϤƲȥݡȤäФ٤ĥäƤ

about Icons, ClipArts

Some icons in this page are downloadable at ICONFINDER.

The "note" icon notes.png designed by Marco Martin is distributed with the LGPL licence,
the "warning" icon warning.png designed by Alexandre Moore with the GPL licence
and the "triangle" icon JNorth_arrow-right-sm.png designed by Joseph North is distributed with the Creative Commons (Attribution-Noncommercial-Share Alike 3.0 Unported) licence.

Some clip arts used in this page are downloadable at Open Clip Art Library.
We deeply appreciate their superb works. With licence, they describe that "the actual clipart content on open clipart library is Public domain" in the web.


*1 ñʤΤ֤ñˡǤʤʱߴؿȤä