Pendulum

Pendulum preview image

1 collaborator

Tags

(This model has yet to be categorized with any tags)
Visible to everyone | Changeable by everyone
Model was written in NetLogo 6.4.0 • Viewed 26 times • Downloaded 1 time • Run 0 times
Download the 'Pendulum' modelDownload this modelEmbed this model

Do you have questions or comments about this model? Ask them here! (You'll first need to log in.)


Info tab cannot be displayed because of an encoding error

Comments and Questions

Please start the discussion about this model! (You'll first need to log in.)

Click to Run Model

breed [kroge krog]
breed [lodder lod]

lodder-own
[ vinkel     ; vinkel på udsvinget i forhold til lodret (positive vinkler venstre for lodret og negative højre for lodret)
  vinkelv    ; vinkelhastigheden
  vinkela    ; vinkelacceleration
  hastighed  ; tangentiel hastighed
  E_pot      ; potentiel energi
  E_kin      ; kinetisk energi
  E_mek      ; mekanisk energi
  delta_t    ; tidsskridt
]

to setup
  clear-all
  create-kroge 1 [
    setxy 0 200
    set size 2
    set color grey
    set shape "square"
  ]
  create-lodder 1
  [
    setxy -80 (200 - sqrt( ( snorlængde ^ 2) - (80 ^ 2) ))
    set size 8
    set shape "circle"
    set vinkel  (atan (xcor) (-200 + ycor)) - 180
    set vinkelv 0
    set vinkela ( - 9.82 / snorlængde ) * sin ( vinkel )
    set hastighed (snorlængde * vinkelv *  sqrt( pi / 180 ))
    set E_kin 0.5 * masse * (hastighed ^ 2)
    set delta_t 0.05                                   ; denne kan evt. være en af parametrene som der kan ændres på vha. skyder
    create-link-with one-of kroge
  ]
  reset-ticks
end 

to go
  move-lodder
   wait 0.001
  tick
end 

to move-lodder
  ask lodder [
    set vinkela ( - 9.82 / snorlængde ) * sin ( vinkel )
    set vinkelv vinkelv + vinkela * delta_t
    set vinkel vinkel + vinkelv * delta_t
    set hastighed (snorlængde * vinkelv * sqrt (pi / 180) )
    set xcor 0 - sin ( vinkel ) * snorlængde
    set ycor 200 - cos ( vinkel ) * snorlængde
    set E_kin 0.5 * masse * (hastighed ^ 2)
  ]
end 

There is only one version of this model, created about 1 month ago by Solveig Skadhauge.

Attached files

File Type Description Last updated
Pendulum.png preview Preview for 'Pendulum' about 1 month ago, by Solveig Skadhauge Download

This model does not have any ancestors.

This model does not have any descendants.