{"id":33,"date":"2008-10-16T22:00:59","date_gmt":"2008-10-17T03:00:59","guid":{"rendered":"https:\/\/blogs.mathworks.com\/seth\/2008\/10\/16\/metronome-challenge-winners\/"},"modified":"2019-08-15T08:56:38","modified_gmt":"2019-08-15T13:56:38","slug":"metronome-challenge-winners","status":"publish","type":"post","link":"https:\/\/blogs.mathworks.com\/simulink\/2008\/10\/16\/metronome-challenge-winners\/","title":{"rendered":"Metronome Challenge Winners"},"content":{"rendered":"<p>Two weeks ago, I posted the <a title=\"Permanent link to Challenge: Metronome Synchronization\" href=\"https:\/\/blogs.mathworks.com\/seth\/2008\/09\/30\/challenge-metronome-synchronization\/\">Challenge: Metronome Synchronization<\/a>.\u00a0 The challenge was to model the synchronization of metronomes as observed in this video.<\/p>\n<p>The results of the challenge tell an interesting story about the community effort to solve this modeling problem.\u00a0 Congratulations go out to our two winners, Thomas Steffen and Xianfa Zeng.\u00a0 I am awarding them both the highly coveted MATLAB Central Laptop bag. Let\u2019s look over the major innovations they both contributed to this challenge.<\/p>\n<p>Thinking about the original video, we can imagine the important elements of the system.\u00a0 The two major components of the models are the cart on which the metronomes ride, and the metronomes.\u00a0 I also posted a derivation of the system of equations that simplify the metronome down to a frictionless pendulum.\u00a0 However, a metronome is more than just a pendulum. It also contains springs, gears, and an <a href=\"http:\/\/en.wikipedia.org\/wiki\/Escapement\">escapement<\/a> to put energy into the system and regulate the motion of the pendulum.\u00a0 In the real world, frictionless pendulums are uncommon.\u00a0 As we will soon find out, modeling a metronome as a frictionless pendulum is an over simplification.<\/p>\n<p><strong>Xianfa Zeng\u2019s entry with improved animation<\/strong><\/p>\n<p>Xianfa Zeng submitted the entry: <a title=\"https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/loadFile.do?objectId=21722&amp;objectType=file (link no longer works)\">Metronome Synchronization<\/a>.<\/p>\n<p><a href=\"https:\/\/blogs.mathworks.com\/images\/seth\/2008Q4\/metronomeChallenge\/xianfa_metronomeBig.png\"><br \/>\n<img decoding=\"async\" src=\"https:\/\/blogs.mathworks.com\/images\/seth\/2008Q4\/metronomeChallenge\/xianfa_metronomeSmall.png\" alt=\"Metronome synchronization Simulink model\" border=\"0\" \/><br \/>\n<\/a><\/p>\n<p>Click <a href=\"https:\/\/blogs.mathworks.com\/images\/seth\/2008Q4\/metronomeChallenge\/Xianfa_Zeng\/metronome_zxf_slwebview.html\">here <\/a>to see a web view of Xianfa\u2019s model.<\/p>\n<p>This model is a great example of clean block diagram layout.\u00a0 On the left are subsystems that implement each of the pendulums in a five-pendulum experiment, just like the video.\u00a0 The input to the pendulum system is the acceleration of the cart.\u00a0 The output from the system is the angle of the pendulum, and the force on the cart due to that pendulum.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/blogs.mathworks.com\/images\/seth\/2008Q4\/metronomeChallenge\/pens.png\" alt=\"Simulink pendulum subsystems\" \/><\/p>\n<p>On the right are the dynamics of the cart.\u00a0 This sums the accelerations on the cart and integrates to find the position.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/blogs.mathworks.com\/images\/seth\/2008Q4\/metronomeChallenge\/cart.png\" alt=\"Simulink cart dynamics model\" \/><\/p>\n<p>Xianfa also developed an excellent M-file S-function to animate the motion of the system.\u00a0 This went beyond the simple animation I initially provided.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/blogs.mathworks.com\/images\/seth\/2008Q4\/metronomeChallenge\/xianfa_metronomeViewer.png\" alt=\"Simulink Metronome animation viewer\" \/><\/p>\n<p><strong>Thomas Steffens\u2019s insight into the nature of synchronization<\/strong><\/p>\n<p>Xianfa\u2019s simulation laid the groundwork for Thomas Steffen\u2019s submission: <a title=\"https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/loadFile.do?objectId=21742&amp;objectType=file (link no longer works)\">Metronome<br \/>\nwith Driving Force<\/a>.\u00a0 Thomas described his submission in this way:<\/p>\n<blockquote><p>Ok, my approach is very different from the ones I have seen.<br \/>\nI followed four premises:<\/p>\n<p>a) The pendulum is essential linear, and the nonlinearity of the angle is not<br \/>\nrelevant. (This is an assumption, and I make no attempt to verify it.)<br \/>\nb) Any coupling between n resonators creates n resonance frequencies that are<br \/>\ndiverging with increasing coupling, so no synchronisation here.<br \/>\nc) A metronome is driven by a spring to compensate for the friction, and the<br \/>\ndirection of the force switches a bit after the metronome has passed angle 0.<br \/>\nd) Synchronisation happens because the shared based shifts this switching point<br \/>\nto earlier or later (the angle remains the same).<\/p>\n<p>Just run the file, and you will see it happening pretty soon. This model is based<br \/>\non the Simulink model of Xianfa Zeng, which is a really nice framework. The<br \/>\npendulum model is very different, though. Both are inspired by \"Challenge:<br \/>\nMetronome and Cart Equations of Motion\" on Seth's blog.<\/p><\/blockquote>\n<p><a href=\"https:\/\/blogs.mathworks.com\/images\/seth\/2008Q4\/metronomeChallenge\/thomas_metronomeBig.png\"><br \/>\n<img decoding=\"async\" src=\"https:\/\/blogs.mathworks.com\/images\/seth\/2008Q4\/metronomeChallenge\/thomas_metronomeSmall.png\" alt=\"Simulink metronome model with driving force\" border=\"0\" \/><br \/>\n<\/a><\/p>\n<p>Click <a href=\"https:\/\/blogs.mathworks.com\/images\/seth\/2008Q4\/metronomeChallenge\/Thomas_Steffen\/metronome_ts_slwebview_files\/index.html\">here <\/a>to see a web view of Thomas\u2019 model.<\/p>\n<p>Thomas added an important element to the system that was missing from the others.\u00a0 He introduced a non-linearity to the system in the way of a driving force.\u00a0 I imagine it like this.\u00a0 As the pendulum moves further from center, the force of gravity pushing it back to the center is proportional to sin(\u03b8).\u00a0 A common approximation is sin(\u03b8)=\u03b8 for small values of \u03b8.\u00a0 The angles of the pendulum are generally small, so the system is essentially linear.\u00a0 Thomas also commented that:<\/p>\n<blockquote><p>Synchronisation cannot happen in a linear framework, that is<br \/>\na long known fact from electrical oscillators. Coupling them leads to several<br \/>\nmodes with slightly different resonance frequencies (\u201doff tune\u201d), and<br \/>\nincreasing the coupling separates the frequencies further.<\/p>\n<p>So the key is nonlinearity. My guess is that it is the<br \/>\ndriving force, but I did not study other options.<\/p><\/blockquote>\n<p>Thomas\u2019 pendulum model includes this driving force:<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/blogs.mathworks.com\/images\/seth\/2008Q4\/metronomeChallenge\/steffenPendulum.png\" alt=\"Pendulum model with driving force\" \/><\/p>\n<p>The plot tells the full story.\u00a0 Here are three different periods of Thomas Steffen\u2019s simulation.\u00a0 First, here is a graph near the beginning at 5 seconds. The yellow line is the position of the cart.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/blogs.mathworks.com\/images\/seth\/2008Q4\/metronomeChallenge\/notSyncronized.png\" alt=\"Plot of metronome angles, not synchronized\" \/><\/p>\n<p>You see that there is no synchronization.\u00a0 The next period is at 28 seconds.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/blogs.mathworks.com\/images\/seth\/2008Q4\/metronomeChallenge\/almostSyncronized.png\" alt=\"Plot of metronome angles, almost synchronized\" \/><\/p>\n<p>The pendulums are very, very close to synchronization. Finally, after only 50 seconds, the lines are on top of each other.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/blogs.mathworks.com\/images\/seth\/2008Q4\/metronomeChallenge\/Synchronized.png\" alt=\"Plot of metronome angles, synchronized\" \/><\/p>\n<p><strong>Congratulations to Thomas and Xianfa<\/strong><\/p>\n<p>Don\u2019t let the conclusion of the challenge stop you.\u00a0 We have only investigated a small portion of metronome synchronization problem.\u00a0 The benefit of a model is the ease with which you can ask questions and find<br \/>\nanswers.\u00a0 There are many open questions as well as new challenges awaiting us. Would you like to propose another modeling challenge?\u00a0 Do you want to see a review of how some MathWorkers attempted this modeling problem?\u00a0 Leave a <a href=\"https:\/\/blogs.mathworks.com\/seth\/?p=33&amp;#comment\">comment<\/a> and share your thoughts.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Two weeks ago, I posted the Challenge: Metronome Synchronization.\u00a0 The challenge was to model the synchronization of metronomes as observed in this video.<br \/>\nThe results of the challenge tell an... <a class=\"read-more\" href=\"https:\/\/blogs.mathworks.com\/simulink\/2008\/10\/16\/metronome-challenge-winners\/\">read more >><\/a><\/p>\n","protected":false},"author":40,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[50,34,30],"tags":[453,51,441],"_links":{"self":[{"href":"https:\/\/blogs.mathworks.com\/simulink\/wp-json\/wp\/v2\/posts\/33"}],"collection":[{"href":"https:\/\/blogs.mathworks.com\/simulink\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.mathworks.com\/simulink\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/simulink\/wp-json\/wp\/v2\/users\/40"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/simulink\/wp-json\/wp\/v2\/comments?post=33"}],"version-history":[{"count":4,"href":"https:\/\/blogs.mathworks.com\/simulink\/wp-json\/wp\/v2\/posts\/33\/revisions"}],"predecessor-version":[{"id":9126,"href":"https:\/\/blogs.mathworks.com\/simulink\/wp-json\/wp\/v2\/posts\/33\/revisions\/9126"}],"wp:attachment":[{"href":"https:\/\/blogs.mathworks.com\/simulink\/wp-json\/wp\/v2\/media?parent=33"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/simulink\/wp-json\/wp\/v2\/categories?post=33"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/simulink\/wp-json\/wp\/v2\/tags?post=33"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}