{"id":64,"date":"2025-01-24T13:31:26","date_gmt":"2025-01-24T13:31:26","guid":{"rendered":"https:\/\/philbeavis-wp1.purelywebsite.com\/?p=64"},"modified":"2025-01-24T16:17:33","modified_gmt":"2025-01-24T16:17:33","slug":"satellite-orbit-simulation-in-scratch","status":"publish","type":"post","link":"https:\/\/philbeavis-wp1.purelywebsite.com\/index.php\/2025\/01\/24\/satellite-orbit-simulation-in-scratch\/","title":{"rendered":"Satellite Orbit Fun"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">Play Now<\/h2>\n\n\n\n<p>I made this &#8216;game&#8217; in 2014, literally from <a href=\"https:\/\/scratch.mit.edu\/\" target=\"_blank\" rel=\"noreferrer noopener\">Scratch<\/a>, based on the physics of gravity. <\/p>\n\n\n\n<p><strong>Click the green flag to start.<\/strong><\/p>\n\n\n\n<div class=\"wp-block-group has-global-padding is-layout-constrained wp-block-group-is-layout-constrained\">\n<iframe loading=\"lazy\" src=\"https:\/\/scratch.mit.edu\/projects\/824757\/embed\" allowtransparency=\"true\" width=\"485\" height=\"402\" frameborder=\"0\" scrolling=\"no\" allowfullscreen=\"\"><\/iframe>\n<\/div>\n\n\n\n<p>A satellite is orbiting the planet. It has four thrusters for manoeuvring. <\/p>\n\n\n\n<p><strong>You need a keyboard for this.<\/strong> <\/p>\n\n\n\n<div class=\"wp-block-group has-global-padding is-layout-constrained wp-block-group-is-layout-constrained\">\n<ul class=\"wp-block-list\">\n<li>Fire the thrusters using the four Up\/Down\/Left\/Right arrow keys. (See below: action and reaction.)<\/li>\n\n\n\n<li>Try to maintain a safe orbit, without crashing into the planet, or getting lost in outer space!<\/li>\n\n\n\n<li>Optional controls: Trace orbit with pen [u]p [d]own [c]lear. [g]row or [s]hrink the size (not mass) of the planet.<\/li>\n\n\n\n<li>Experiment with the sliders to vary the effect of gravity strength &#8216;G&#8217; and planet mass &#8216;M&#8217;. Gravity is so weak that we only notice it with massive objects like planets. Actual value of G = 0.0000000000667384 (SI units).<\/li>\n<\/ul>\n<\/div>\n\n\n\n<h2 class=\"wp-block-heading\">How it works<\/h2>\n\n\n\n<p>The original is at <a href=\"https:\/\/scratch.mit.edu\/projects\/824757\/\">https:\/\/scratch.mit.edu\/projects\/824757\/<\/a> <\/p>\n\n\n\n<p>See inside how it works <a href=\"https:\/\/scratch.mit.edu\/projects\/824757\/editor\/\" data-type=\"link\" data-id=\"https:\/\/scratch.mit.edu\/projects\/824757\/editor\/\" target=\"_blank\" rel=\"noreferrer noopener\">here<\/a>. <\/p>\n\n\n\n<p>The Satellite object runs an endless loop to update its position. The Planet object has a method that responds to &#8216;crash&#8217; events!<\/p>\n\n\n\n<p>It is a simulation of Isaac Newton&#8217;s laws: <\/p>\n\n\n\n<p class=\"has-text-align-center\">F = m a  = G M m \/ d<sup>2<\/sup><\/p>\n\n\n\n<p>The satellite motion comes from the acceleration &#8216;a&#8217;, caused by the gravity force &#8216;F&#8217;, which depends on its distance &#8216;d&#8217; from the centre of the planet. The direction of acceleration is always towards the centre. That&#8217;s called an &#8216;inverse square law&#8217;.<\/p>\n\n\n\n<p>The mass &#8216;m&#8217; of the satellite does not affect the orbit because it appears on both sides of the equation. (But why inertial mass = gravitational mass?)<\/p>\n\n\n\n<p>The simulation computes the change in position of the satellite in small time steps. (It&#8217;s a &#8216;finite difference&#8217; method to approximate the underlying vector calculus.)<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>velocity is rate of change of displacement (position)<\/li>\n\n\n\n<li>acceleration is rate of change of velocity<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Isaac Newton<\/h2>\n\n\n\n<p>The three laws of motion were first compiled by Isaac Newton in his <a href=\"https:\/\/en.wikipedia.org\/wiki\/Philosophi%C3%A6_Naturalis_Principia_Mathematica\" target=\"_blank\" rel=\"noreferrer noopener\">Philosophi\u00e6 Naturalis Principia Mathematica<\/a> (Mathematical Principles of Natural Philosophy), first published in 1687. <\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"850\" height=\"1024\" src=\"https:\/\/philbeavis-wp1.purelywebsite.com\/wp-content\/uploads\/2025\/01\/Portrait_of_Sir_Isaac_Newton_1689-850x1024.jpg\" alt=\"\" class=\"wp-image-90\" srcset=\"https:\/\/philbeavis-wp1.purelywebsite.com\/wp-content\/uploads\/2025\/01\/Portrait_of_Sir_Isaac_Newton_1689-850x1024.jpg 850w, https:\/\/philbeavis-wp1.purelywebsite.com\/wp-content\/uploads\/2025\/01\/Portrait_of_Sir_Isaac_Newton_1689-249x300.jpg 249w, https:\/\/philbeavis-wp1.purelywebsite.com\/wp-content\/uploads\/2025\/01\/Portrait_of_Sir_Isaac_Newton_1689-768x925.jpg 768w, https:\/\/philbeavis-wp1.purelywebsite.com\/wp-content\/uploads\/2025\/01\/Portrait_of_Sir_Isaac_Newton_1689-1275x1536.jpg 1275w, https:\/\/philbeavis-wp1.purelywebsite.com\/wp-content\/uploads\/2025\/01\/Portrait_of_Sir_Isaac_Newton_1689-1701x2048.jpg 1701w\" sizes=\"auto, (max-width: 850px) 100vw, 850px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>An object will not change its motion unless a force acts on it (First Law).<\/li>\n\n\n\n<li>The force on an object is equal to its mass times its acceleration (Second Law).<\/li>\n\n\n\n<li>For every action, there is an equal and opposite reaction (Third Law).<\/li>\n<\/ol>\n\n\n\n<p>Newton showed that these laws of motion, combined with his law of universal gravitation, explained Kepler&#8217;s laws of planetary motion.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Motivation<\/h2>\n\n\n\n<p>In 2014 I was working as a software engineer, supporting an Educational project at the <a href=\"https:\/\/www.esa.int\/\" target=\"_blank\" rel=\"noreferrer noopener\">European Space Agency<\/a>, using some tools like <a href=\"https:\/\/www.orekit.org\/\" target=\"_blank\" rel=\"noreferrer noopener\">Orekit<\/a>. <\/p>\n\n\n\n<p>At the same time I was also thinking about how to bring physics and computing to younger students in the context of <a href=\"https:\/\/www.stem.org.uk\/\" target=\"_blank\" rel=\"noreferrer noopener\">STEM<\/a>. <\/p>\n\n\n\n<p>Then I discovered <a href=\"https:\/\/scratch.mit.edu\/\" target=\"_blank\" rel=\"noreferrer noopener\">Scratch<\/a>, a fun visual programming environment from MIT, and was inspired to see what could be done with the application of some school Physics.<\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Play Now I made this &#8216;game&#8217; in 2014, literally from Scratch, based on the physics of gravity. Click the green flag to start. A satellite is orbiting the planet. It has four thrusters for manoeuvring. You need a keyboard for this. How it works The original is at https:\/\/scratch.mit.edu\/projects\/824757\/ See inside how it works here. [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[13,16,12,14,15],"class_list":["post-64","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-orbit","tag-physics","tag-satellite","tag-scratch","tag-stem"],"_links":{"self":[{"href":"https:\/\/philbeavis-wp1.purelywebsite.com\/index.php\/wp-json\/wp\/v2\/posts\/64","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/philbeavis-wp1.purelywebsite.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/philbeavis-wp1.purelywebsite.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/philbeavis-wp1.purelywebsite.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/philbeavis-wp1.purelywebsite.com\/index.php\/wp-json\/wp\/v2\/comments?post=64"}],"version-history":[{"count":62,"href":"https:\/\/philbeavis-wp1.purelywebsite.com\/index.php\/wp-json\/wp\/v2\/posts\/64\/revisions"}],"predecessor-version":[{"id":140,"href":"https:\/\/philbeavis-wp1.purelywebsite.com\/index.php\/wp-json\/wp\/v2\/posts\/64\/revisions\/140"}],"wp:attachment":[{"href":"https:\/\/philbeavis-wp1.purelywebsite.com\/index.php\/wp-json\/wp\/v2\/media?parent=64"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/philbeavis-wp1.purelywebsite.com\/index.php\/wp-json\/wp\/v2\/categories?post=64"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/philbeavis-wp1.purelywebsite.com\/index.php\/wp-json\/wp\/v2\/tags?post=64"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}