mirror of
https://gitlab.com/Anson-Projects/projects.git
synced 2025-07-22 06:01:33 +00:00
Mostly finished with Eclipse Determination.
This commit is contained in:
@@ -88,36 +88,38 @@ code span.wa { color: #5e5e5e; font-style: italic; } /* Warning */
|
||||
<!--radix_placeholder_meta_tags-->
|
||||
<title>ISS Eclipse Determination</title>
|
||||
|
||||
<meta property="description" itemprop="description" content="Determining how much sunlight a body is receiving."/>
|
||||
<meta property="description" itemprop="description" content="Determining how much sunlight a body orbiting a planet is receiving."/>
|
||||
|
||||
<link rel="license" href="https://creativecommons.org/licenses/by/4.0/"/>
|
||||
|
||||
<!-- https://schema.org/Article -->
|
||||
<meta property="article:published" itemprop="datePublished" content="2021-04-01"/>
|
||||
<meta property="article:created" itemprop="dateCreated" content="2021-04-01"/>
|
||||
<meta property="article:published" itemprop="datePublished" content="2021-05-01"/>
|
||||
<meta property="article:created" itemprop="dateCreated" content="2021-05-01"/>
|
||||
<meta name="article:author" content="Anson Biggs"/>
|
||||
|
||||
<!-- https://developers.facebook.com/docs/sharing/webmasters#markup -->
|
||||
<meta property="og:title" content="ISS Eclipse Determination"/>
|
||||
<meta property="og:type" content="article"/>
|
||||
<meta property="og:description" content="Determining how much sunlight a body is receiving."/>
|
||||
<meta property="og:description" content="Determining how much sunlight a body orbiting a planet is receiving."/>
|
||||
<meta property="og:locale" content="en_US"/>
|
||||
|
||||
<!-- https://dev.twitter.com/cards/types/summary -->
|
||||
<meta property="twitter:card" content="summary"/>
|
||||
<meta property="twitter:title" content="ISS Eclipse Determination"/>
|
||||
<meta property="twitter:description" content="Determining how much sunlight a body is receiving."/>
|
||||
<meta property="twitter:description" content="Determining how much sunlight a body orbiting a planet is receiving."/>
|
||||
|
||||
<!--/radix_placeholder_meta_tags-->
|
||||
|
||||
<meta name="citation_reference" content="citation_title=ARISS TLE"/>
|
||||
<!--radix_placeholder_rmarkdown_metadata-->
|
||||
|
||||
<script type="text/json" id="radix-rmarkdown-metadata">
|
||||
{"type":"list","attributes":{"names":{"type":"character","attributes":{},"value":["title","description","draft","author","repository_url","date","fig_width","fig_align","output","categories","creative_commons"]}},"value":[{"type":"character","attributes":{},"value":["ISS Eclipse Determination"]},{"type":"character","attributes":{},"value":["Determining how much sunlight a body is receiving.\n"]},{"type":"logical","attributes":{},"value":[false]},{"type":"list","attributes":{},"value":[{"type":"list","attributes":{"names":{"type":"character","attributes":{},"value":["name","url"]}},"value":[{"type":"character","attributes":{},"value":["Anson Biggs"]},{"type":"character","attributes":{},"value":["https://ansonbiggs.com"]}]}]},{"type":"character","attributes":{},"value":["https://gitlab.com/lander-team/air-prop-simulation"]},{"type":"character","attributes":{},"value":["04-01-2021"]},{"type":"integer","attributes":{},"value":[6]},{"type":"character","attributes":{},"value":["center"]},{"type":"list","attributes":{"names":{"type":"character","attributes":{},"value":["distill::distill_article"]}},"value":[{"type":"list","attributes":{"names":{"type":"character","attributes":{},"value":["self_contained"]}},"value":[{"type":"logical","attributes":{},"value":[false]}]}]},{"type":"character","attributes":{},"value":["Julia","Astrodynamics"]},{"type":"character","attributes":{},"value":["CC BY"]}]}
|
||||
{"type":"list","attributes":{"names":{"type":"character","attributes":{},"value":["title","description","draft","author","repository_url","date","fig_width","fig_align","output","categories","bibliography","creative_commons","preview"]}},"value":[{"type":"character","attributes":{},"value":["ISS Eclipse Determination"]},{"type":"character","attributes":{},"value":["Determining how much sunlight a body orbiting a planet is receiving.\n"]},{"type":"logical","attributes":{},"value":[false]},{"type":"list","attributes":{},"value":[{"type":"list","attributes":{"names":{"type":"character","attributes":{},"value":["name","url"]}},"value":[{"type":"character","attributes":{},"value":["Anson Biggs"]},{"type":"character","attributes":{},"value":["https://ansonbiggs.com"]}]}]},{"type":"character","attributes":{},"value":["https://gitlab.com/lander-team/air-prop-simulation"]},{"type":"character","attributes":{},"value":["05-01-2021"]},{"type":"integer","attributes":{},"value":[6]},{"type":"character","attributes":{},"value":["center"]},{"type":"list","attributes":{"names":{"type":"character","attributes":{},"value":["distill::distill_article"]}},"value":[{"type":"list","attributes":{"names":{"type":"character","attributes":{},"value":["self_contained"]}},"value":[{"type":"logical","attributes":{},"value":[false]}]}]},{"type":"character","attributes":{},"value":["Julia","Astrodynamics"]},{"type":"character","attributes":{},"value":["citations.bib"]},{"type":"character","attributes":{},"value":["CC BY"]},{"type":"character","attributes":{},"value":["preview.png"]}]}
|
||||
</script>
|
||||
<!--/radix_placeholder_rmarkdown_metadata-->
|
||||
|
||||
<script type="text/json" id="radix-resource-manifest">
|
||||
{"type":"character","attributes":{},"value":["geometry.svg","iss-eclipse-determination_files/anchor-4.2.2/anchor.min.js","iss-eclipse-determination_files/bowser-1.9.3/bowser.min.js","iss-eclipse-determination_files/distill-2.2.21/template.v2.js","iss-eclipse-determination_files/figure-html5/unnamed-chunk-2-J1.png","iss-eclipse-determination_files/figure-html5/unnamed-chunk-2-J2.png","iss-eclipse-determination_files/figure-html5/unnamed-chunk-2-J3.png","iss-eclipse-determination_files/figure-html5/unnamed-chunk-2-J4.png","iss-eclipse-determination_files/figure-html5/unnamed-chunk-4-J1.png","iss-eclipse-determination_files/figure-html5/unnamed-chunk-4-J2.png","iss-eclipse-determination_files/figure-html5/unnamed-chunk-4-J3.png","iss-eclipse-determination_files/figure-html5/unnamed-chunk-4-J4.png","iss-eclipse-determination_files/figure-html5/unnamed-chunk-6-J1.png","iss-eclipse-determination_files/header-attrs-2.7/header-attrs.js","iss-eclipse-determination_files/jquery-1.11.3/jquery.min.js","iss-eclipse-determination_files/popper-2.6.0/popper.min.js","iss-eclipse-determination_files/tippy-6.2.7/tippy-bundle.umd.min.js","iss-eclipse-determination_files/tippy-6.2.7/tippy-light-border.css","iss-eclipse-determination_files/tippy-6.2.7/tippy.css","iss-eclipse-determination_files/tippy-6.2.7/tippy.umd.min.js","iss-eclipse-determination_files/webcomponents-2.0.0/webcomponents.js","vectors_radiuss.svg"]}
|
||||
{"type":"character","attributes":{},"value":["citations.bib","geometry.svg","iss-eclipse-determination_files/anchor-4.2.2/anchor.min.js","iss-eclipse-determination_files/bowser-1.9.3/bowser.min.js","iss-eclipse-determination_files/distill-2.2.21/template.v2.js","iss-eclipse-determination_files/figure-html5/unnamed-chunk-2-J1.png","iss-eclipse-determination_files/figure-html5/unnamed-chunk-2-J2.png","iss-eclipse-determination_files/figure-html5/unnamed-chunk-2-J3.png","iss-eclipse-determination_files/figure-html5/unnamed-chunk-2-J4.png","iss-eclipse-determination_files/figure-html5/unnamed-chunk-4-J1.png","iss-eclipse-determination_files/figure-html5/unnamed-chunk-4-J2.png","iss-eclipse-determination_files/figure-html5/unnamed-chunk-4-J3.png","iss-eclipse-determination_files/figure-html5/unnamed-chunk-4-J4.png","iss-eclipse-determination_files/figure-html5/unnamed-chunk-6-J1.png","iss-eclipse-determination_files/figure-html5/unnamed-chunk-7-J1.png","iss-eclipse-determination_files/header-attrs-2.7/header-attrs.js","iss-eclipse-determination_files/jquery-1.11.3/jquery.min.js","iss-eclipse-determination_files/popper-2.6.0/popper.min.js","iss-eclipse-determination_files/tippy-6.2.7/tippy-bundle.umd.min.js","iss-eclipse-determination_files/tippy-6.2.7/tippy-light-border.css","iss-eclipse-determination_files/tippy-6.2.7/tippy.css","iss-eclipse-determination_files/tippy-6.2.7/tippy.umd.min.js","iss-eclipse-determination_files/webcomponents-2.0.0/webcomponents.js","preview.png","vectors_radiuss.svg"]}
|
||||
</script>
|
||||
<!--radix_placeholder_navigation_in_header-->
|
||||
<!--/radix_placeholder_navigation_in_header-->
|
||||
@@ -1456,7 +1458,7 @@ code span.wa { color: #5e5e5e; font-style: italic; } /* Warning */
|
||||
<!--radix_placeholder_front_matter-->
|
||||
|
||||
<script id="distill-front-matter" type="text/json">
|
||||
{"title":"ISS Eclipse Determination","description":"Determining how much sunlight a body is receiving.","authors":[{"author":"Anson Biggs","authorURL":"https://ansonbiggs.com","affiliation":" ","affiliationURL":"#","orcidID":""}],"publishedDate":"2021-04-01T00:00:00.000-07:00","citationText":"Biggs, 2021"}
|
||||
{"title":"ISS Eclipse Determination","description":"Determining how much sunlight a body orbiting a planet is receiving.","authors":[{"author":"Anson Biggs","authorURL":"https://ansonbiggs.com","affiliation":" ","affiliationURL":"#","orcidID":""}],"publishedDate":"2021-05-01T00:00:00.000-07:00","citationText":"Biggs, 2021"}
|
||||
</script>
|
||||
|
||||
<!--/radix_placeholder_front_matter-->
|
||||
@@ -1473,13 +1475,13 @@ code span.wa { color: #5e5e5e; font-style: italic; } /* Warning */
|
||||
<div class="dt=tag">Astrodynamics</div>
|
||||
</div>
|
||||
<!--/radix_placeholder_categories-->
|
||||
<p><p>Determining how much sunlight a body is receiving.</p></p>
|
||||
<p><p>Determining how much sunlight a body orbiting a planet is receiving.</p></p>
|
||||
</div>
|
||||
|
||||
<div class="d-byline">
|
||||
Anson Biggs <a href="https://ansonbiggs.com" class="uri">https://ansonbiggs.com</a>
|
||||
|
||||
<br/>04-01-2021
|
||||
<br/>05-01-2021
|
||||
</div>
|
||||
|
||||
<div class="d-article">
|
||||
@@ -1488,9 +1490,11 @@ code span.wa { color: #5e5e5e; font-style: italic; } /* Warning */
|
||||
<figure>
|
||||
<img src="geometry.svg" alt="Geometry of an Eclipse" /><figcaption aria-hidden="true">Geometry of an Eclipse</figcaption>
|
||||
</figure>
|
||||
<p>The above image is a simple representation of what an eclipse is. You’ll notice there is the Umbra which is complete darkness, then the Penumbra which is a shadow of varying darkness, and then the rest of the orbit is in complete sunlight. For this example I will be using the ISS which has a very low orbit so the Penumbra isn’t much of a problem. You can tell by looking at the diagram that higher altitude orbits would spend more time in the Penumbra.</p>
|
||||
<figure>
|
||||
<img src="vectors_radiuss.svg" alt="Body Radius’s and Position Vectors" /><figcaption aria-hidden="true">Body Radius’s and Position Vectors</figcaption>
|
||||
</figure>
|
||||
<p>Here is a more detailed view of the eclipse that will make it easier to explain the code. There are 2 Position vectors and 2 radius’s that need to be known for simple eclipse determination. There are more advanced cases where the atmosphere of the body your orbiting can greatly affect the Umbra and Penumbra, and other bodies could also potentially block the Sun, but for this example we will keep it simple since those have very little affect for the ISS’s orbit. <code style="color:#0b7285">Rsun</code> and <code style="color:#c92a2a">Rbody</code> are the radius’s of the Sun and Body (In this case Earth) respectively. <code style="color:#5f3dc4">r_sun_body</code> is a vector from the center of the Sun to the center of the target body. For this example I will only be using one vector, but for more rigorous eclipse determination its important to calculate this at least once a day since it does significantly change over the course of a year. The reason that I am ignoring it at the moment is because there is currently no good way to calculate <a href="https://ssd.jpl.nasa.gov/?ephemerides">Ephemerides</a> in Julia but the package is being worked on so I may revisit this and do a more rigorous analysis in the future. <code style="color:#5c940d">r_body_sc</code> is a position vector from the center of the body being orbitted, to the center of our spacecraft.</p>
|
||||
<h2 id="the-code">The Code</h2>
|
||||
<div class="layout-chunk" data-layout="l-body">
|
||||
<details>
|
||||
@@ -1505,75 +1509,109 @@ Show code
|
||||
<span id="cb1-6"><a href="#cb1-6" aria-hidden="true" tabindex="-1"></a>theme(<span class="op">:</span>ggplot2)</span></code></pre></div>
|
||||
</details>
|
||||
</div>
|
||||
<p>In order to get the orbit for the ISS I used a <a href="https://en.wikipedia.org/wiki/Two-line_element_set">Two-Line Element</a> which is a data format for explaining orbits. the US Joint Space Operations Center makes these widely available, but <a href="https://live.ariss.org/tle/" class="uri">https://live.ariss.org/tle/</a> makes the TLE for the ISS way more accessible <span class="citation" data-cites="ariss">(<a href="#ref-ariss" role="doc-biblioref"><span>“<span>ARISS</span> <span>TLE</span>,”</span> n.d.</a>)</span>. The Julia Package <a href="https://github.com/JuliaSpace/SatelliteToolbox.jl">SatelliteToolbox.jl</a> makes it super easy to turn a TLE into an orbit that can be propagated. Simply putting the TLE in a string and using the <code>tle</code> string macro like below and now we have access to the information to start making our ISS orbit.</p>
|
||||
<div class="layout-chunk" data-layout="l-body">
|
||||
<div class="sourceCode" id="cb2"><pre class="sourceCode julia"><code class="sourceCode julia"><span id="cb2-1"><a href="#cb2-1" aria-hidden="true" tabindex="-1"></a>ISS <span class="op">=</span> tle<span class="st">"""</span></span>
|
||||
<span id="cb2-2"><a href="#cb2-2" aria-hidden="true" tabindex="-1"></a><span class="st">ISS (ZARYA)</span></span>
|
||||
<span id="cb2-3"><a href="#cb2-3" aria-hidden="true" tabindex="-1"></a><span class="st">1 25544U 98067A 21103.84943184 .00000176 00000-0 11381-4 0 9990</span></span>
|
||||
<span id="cb2-4"><a href="#cb2-4" aria-hidden="true" tabindex="-1"></a><span class="st">2 25544 51.6434 300.9481 0002858 223.8443 263.8789 15.48881793278621</span></span>
|
||||
<span id="cb2-5"><a href="#cb2-5" aria-hidden="true" tabindex="-1"></a><span class="st">"""</span></span></code></pre></div>
|
||||
<pre><code>1-element Vector{TLE}:
|
||||
TLE: ISS (ZARYA) (Epoch = 2021-04-13T20:23:10.911)</code></pre>
|
||||
</div>
|
||||
<p>Now that we have the TLE we can pass that into SatelliteToolbox’s orbit propagator. Before we can propagate the orbit we need to have a range of time steps to pass into the propagator. The TLE gives the mean motion, n, which is the revolutions per day so using that we can calculate the amount of time required for one orbit which is all that were worried about for this analysis. The propagator returns a tuple containing the Orbital elements, a position vector with units meters, and a velocity vector with units meters per second. For this analysis were only worried about the position vector.</p>
|
||||
<div class="layout-chunk" data-layout="l-body">
|
||||
<pre class="juliam"><code>ISS[1].n</code></pre>
|
||||
</div>
|
||||
<div class="layout-chunk" data-layout="l-body">
|
||||
<div class="sourceCode" id="cb3"><pre class="sourceCode julia"><code class="sourceCode julia"><span id="cb3-1"><a href="#cb3-1" aria-hidden="true" tabindex="-1"></a>orbit <span class="op">=</span> init_orbit_propagator(<span class="dt">Val</span>(<span class="op">:</span>twobody)<span class="op">,</span> ISS[<span class="fl">1</span>])<span class="op">;</span></span>
|
||||
<span id="cb3-2"><a href="#cb3-2" aria-hidden="true" tabindex="-1"></a>time <span class="op">=</span> <span class="fl">0</span><span class="op">:</span><span class="fl">0.1</span><span class="op">:</span>((<span class="fl">24</span> <span class="op">/</span> ISS[<span class="fl">1</span>].n) <span class="op">.*</span> <span class="fl">60</span> <span class="op">*</span> <span class="fl">60</span>)<span class="op">;</span></span>
|
||||
<span id="cb3-3"><a href="#cb3-3" aria-hidden="true" tabindex="-1"></a>o<span class="op">,</span> r<span class="op">,</span> v <span class="op">=</span> propagate<span class="op">!</span>(orbit<span class="op">,</span> time)<span class="op">;</span></span></code></pre></div>
|
||||
<div class="sourceCode" id="cb5"><pre class="sourceCode julia"><code class="sourceCode julia"><span id="cb5-1"><a href="#cb5-1" aria-hidden="true" tabindex="-1"></a>orbit <span class="op">=</span> init_orbit_propagator(<span class="dt">Val</span>(<span class="op">:</span>twobody)<span class="op">,</span> ISS[<span class="fl">1</span>])<span class="op">;</span></span>
|
||||
<span id="cb5-2"><a href="#cb5-2" aria-hidden="true" tabindex="-1"></a>time <span class="op">=</span> <span class="fl">0</span><span class="op">:</span><span class="fl">0.1</span><span class="op">:</span>((<span class="fl">24</span> <span class="op">/</span> ISS[<span class="fl">1</span>].n) <span class="op">.*</span> <span class="fl">60</span> <span class="op">*</span> <span class="fl">60</span>)<span class="op">;</span> <span class="co"># ISS[1].n gives the mean motion, or orbits per day.</span></span>
|
||||
<span id="cb5-3"><a href="#cb5-3" aria-hidden="true" tabindex="-1"></a>o<span class="op">,</span> r<span class="op">,</span> v <span class="op">=</span> propagate<span class="op">!</span>(orbit<span class="op">,</span> time)<span class="op">;</span></span></code></pre></div>
|
||||
</div>
|
||||
<p>Now we just need way to use the radii and vectors discussed earlier to determine if the ISS is in the penumbra or umbra. This is a lot of pretty basic trigonometry and vector math.</p>
|
||||
<p><code>add more discussion about the math</code></p>
|
||||
<div class="layout-chunk" data-layout="l-body">
|
||||
<div class="sourceCode" id="cb4"><pre class="sourceCode julia"><code class="sourceCode julia"><span id="cb4-1"><a href="#cb4-1" aria-hidden="true" tabindex="-1"></a><span class="kw">function</span> sunlight(Rbody<span class="op">,</span> r_sun_body<span class="op">,</span> r_body_sc)</span>
|
||||
<span id="cb4-2"><a href="#cb4-2" aria-hidden="true" tabindex="-1"></a> Rsun <span class="op">=</span> <span class="fl">695_700</span>u<span class="st">"km"</span></span>
|
||||
<span id="cb4-3"><a href="#cb4-3" aria-hidden="true" tabindex="-1"></a> </span>
|
||||
<span id="cb4-4"><a href="#cb4-4" aria-hidden="true" tabindex="-1"></a> hu <span class="op">=</span> Rbody <span class="op">*</span> norm(r_sun_body) <span class="op">/</span> (Rsun <span class="op">-</span> Rbody)</span>
|
||||
<span id="cb4-5"><a href="#cb4-5" aria-hidden="true" tabindex="-1"></a> </span>
|
||||
<span id="cb4-6"><a href="#cb4-6" aria-hidden="true" tabindex="-1"></a> θe <span class="op">=</span> acos((r_sun_body ⋅ r_body_sc) <span class="op">/</span> (norm(r_sun_body) <span class="op">*</span> norm(r_body_sc)))</span>
|
||||
<span id="cb4-7"><a href="#cb4-7" aria-hidden="true" tabindex="-1"></a></span>
|
||||
<span id="cb4-8"><a href="#cb4-8" aria-hidden="true" tabindex="-1"></a> θu <span class="op">=</span> atan(Rbody <span class="op">/</span> hu)</span>
|
||||
<span id="cb4-9"><a href="#cb4-9" aria-hidden="true" tabindex="-1"></a> du <span class="op">=</span> hu <span class="op">*</span> sin(θu) <span class="op">/</span> sin(θe <span class="op">+</span> θu)</span>
|
||||
<span id="cb4-10"><a href="#cb4-10" aria-hidden="true" tabindex="-1"></a></span>
|
||||
<span id="cb4-11"><a href="#cb4-11" aria-hidden="true" tabindex="-1"></a> θp <span class="op">=</span> π <span class="op">-</span> atan(norm(r_sun_body) <span class="op">/</span> (Rsun <span class="op">+</span> Rbody))</span>
|
||||
<span id="cb4-12"><a href="#cb4-12" aria-hidden="true" tabindex="-1"></a> dp <span class="op">=</span> Rbody <span class="op">*</span> sin(θp) <span class="op">/</span> cos(θe <span class="op">-</span> θp)</span>
|
||||
<span id="cb4-13"><a href="#cb4-13" aria-hidden="true" tabindex="-1"></a></span>
|
||||
<span id="cb4-14"><a href="#cb4-14" aria-hidden="true" tabindex="-1"></a> S <span class="op">=</span> <span class="fl">1</span></span>
|
||||
<span id="cb4-15"><a href="#cb4-15" aria-hidden="true" tabindex="-1"></a> <span class="kw">if</span> (θe <span class="op"><</span> π <span class="op">/</span> <span class="fl">2</span>) <span class="op">&&</span> (norm(r_body_sc) <span class="op"><</span> du)</span>
|
||||
<span id="cb4-16"><a href="#cb4-16" aria-hidden="true" tabindex="-1"></a> S <span class="op">=</span> <span class="fl">0</span></span>
|
||||
<span id="cb4-17"><a href="#cb4-17" aria-hidden="true" tabindex="-1"></a> <span class="kw">end</span></span>
|
||||
<span id="cb4-18"><a href="#cb4-18" aria-hidden="true" tabindex="-1"></a> <span class="kw">if</span> (θe <span class="op"><</span> π <span class="op">/</span> <span class="fl">2</span>) <span class="op">&&</span> ((du <span class="op"><</span> norm(r_body_sc)) <span class="op">&&</span> (norm(r_body_sc) <span class="op"><</span> dp))</span>
|
||||
<span id="cb4-19"><a href="#cb4-19" aria-hidden="true" tabindex="-1"></a> S <span class="op">=</span> (norm(r_body_sc .<span class="op">|></span> u<span class="st">"km"</span>) <span class="op">-</span> du) <span class="op">/</span> (dp <span class="op">-</span> du) <span class="op">|></span> ustrip</span>
|
||||
<span id="cb4-20"><a href="#cb4-20" aria-hidden="true" tabindex="-1"></a> <span class="kw">end</span></span>
|
||||
<span id="cb4-21"><a href="#cb4-21" aria-hidden="true" tabindex="-1"></a></span>
|
||||
<span id="cb4-22"><a href="#cb4-22" aria-hidden="true" tabindex="-1"></a> <span class="kw">return</span> S</span>
|
||||
<span id="cb4-23"><a href="#cb4-23" aria-hidden="true" tabindex="-1"></a><span class="kw">end</span></span></code></pre></div>
|
||||
<div class="sourceCode" id="cb6"><pre class="sourceCode julia"><code class="sourceCode julia"><span id="cb6-1"><a href="#cb6-1" aria-hidden="true" tabindex="-1"></a><span class="kw">function</span> sunlight(Rbody<span class="op">,</span> r_sun_body<span class="op">,</span> r_body_sc)</span>
|
||||
<span id="cb6-2"><a href="#cb6-2" aria-hidden="true" tabindex="-1"></a> Rsun <span class="op">=</span> <span class="fl">695_700</span>u<span class="st">"km"</span></span>
|
||||
<span id="cb6-3"><a href="#cb6-3" aria-hidden="true" tabindex="-1"></a> </span>
|
||||
<span id="cb6-4"><a href="#cb6-4" aria-hidden="true" tabindex="-1"></a> hu <span class="op">=</span> Rbody <span class="op">*</span> norm(r_sun_body) <span class="op">/</span> (Rsun <span class="op">-</span> Rbody)</span>
|
||||
<span id="cb6-5"><a href="#cb6-5" aria-hidden="true" tabindex="-1"></a> </span>
|
||||
<span id="cb6-6"><a href="#cb6-6" aria-hidden="true" tabindex="-1"></a> θe <span class="op">=</span> acos((r_sun_body ⋅ r_body_sc) <span class="op">/</span> (norm(r_sun_body) <span class="op">*</span> norm(r_body_sc)))</span>
|
||||
<span id="cb6-7"><a href="#cb6-7" aria-hidden="true" tabindex="-1"></a></span>
|
||||
<span id="cb6-8"><a href="#cb6-8" aria-hidden="true" tabindex="-1"></a> θu <span class="op">=</span> atan(Rbody <span class="op">/</span> hu)</span>
|
||||
<span id="cb6-9"><a href="#cb6-9" aria-hidden="true" tabindex="-1"></a> du <span class="op">=</span> hu <span class="op">*</span> sin(θu) <span class="op">/</span> sin(θe <span class="op">+</span> θu)</span>
|
||||
<span id="cb6-10"><a href="#cb6-10" aria-hidden="true" tabindex="-1"></a></span>
|
||||
<span id="cb6-11"><a href="#cb6-11" aria-hidden="true" tabindex="-1"></a> θp <span class="op">=</span> π <span class="op">-</span> atan(norm(r_sun_body) <span class="op">/</span> (Rsun <span class="op">+</span> Rbody))</span>
|
||||
<span id="cb6-12"><a href="#cb6-12" aria-hidden="true" tabindex="-1"></a> dp <span class="op">=</span> Rbody <span class="op">*</span> sin(θp) <span class="op">/</span> cos(θe <span class="op">-</span> θp)</span>
|
||||
<span id="cb6-13"><a href="#cb6-13" aria-hidden="true" tabindex="-1"></a></span>
|
||||
<span id="cb6-14"><a href="#cb6-14" aria-hidden="true" tabindex="-1"></a> S <span class="op">=</span> <span class="fl">1</span></span>
|
||||
<span id="cb6-15"><a href="#cb6-15" aria-hidden="true" tabindex="-1"></a> <span class="kw">if</span> (θe <span class="op"><</span> π <span class="op">/</span> <span class="fl">2</span>) <span class="op">&&</span> (norm(r_body_sc) <span class="op"><</span> du)</span>
|
||||
<span id="cb6-16"><a href="#cb6-16" aria-hidden="true" tabindex="-1"></a> S <span class="op">=</span> <span class="fl">0</span></span>
|
||||
<span id="cb6-17"><a href="#cb6-17" aria-hidden="true" tabindex="-1"></a> <span class="kw">end</span></span>
|
||||
<span id="cb6-18"><a href="#cb6-18" aria-hidden="true" tabindex="-1"></a> <span class="kw">if</span> (θe <span class="op"><</span> π <span class="op">/</span> <span class="fl">2</span>) <span class="op">&&</span> ((du <span class="op"><</span> norm(r_body_sc)) <span class="op">&&</span> (norm(r_body_sc) <span class="op"><</span> dp))</span>
|
||||
<span id="cb6-19"><a href="#cb6-19" aria-hidden="true" tabindex="-1"></a> S <span class="op">=</span> (norm(r_body_sc .<span class="op">|></span> u<span class="st">"km"</span>) <span class="op">-</span> du) <span class="op">/</span> (dp <span class="op">-</span> du) <span class="op">|></span> ustrip</span>
|
||||
<span id="cb6-20"><a href="#cb6-20" aria-hidden="true" tabindex="-1"></a> <span class="kw">end</span></span>
|
||||
<span id="cb6-21"><a href="#cb6-21" aria-hidden="true" tabindex="-1"></a></span>
|
||||
<span id="cb6-22"><a href="#cb6-22" aria-hidden="true" tabindex="-1"></a> <span class="kw">return</span> S</span>
|
||||
<span id="cb6-23"><a href="#cb6-23" aria-hidden="true" tabindex="-1"></a><span class="kw">end</span></span></code></pre></div>
|
||||
</div>
|
||||
<p>Then we can pass all the values we’ve gathered into the function we just made.</p>
|
||||
<div class="layout-chunk" data-layout="l-body">
|
||||
<div class="sourceCode" id="cb5"><pre class="sourceCode julia"><code class="sourceCode julia"><span id="cb5-1"><a href="#cb5-1" aria-hidden="true" tabindex="-1"></a>S <span class="op">=</span> r .<span class="op">|></span> R <span class="op">-></span> sunlight(<span class="fl">6371</span>u<span class="st">"km"</span><span class="op">,</span> [<span class="fl">0.5370</span><span class="op">,</span> <span class="fl">1.2606</span><span class="op">,</span> <span class="fl">0.5466</span>] <span class="op">.*</span> <span class="fl">1e8</span>u<span class="st">"km"</span><span class="op">,</span> R <span class="op">.*</span> u<span class="st">"m"</span>)</span></code></pre></div>
|
||||
<div class="sourceCode" id="cb7"><pre class="sourceCode julia"><code class="sourceCode julia"><span id="cb7-1"><a href="#cb7-1" aria-hidden="true" tabindex="-1"></a>S <span class="op">=</span> r .<span class="op">|></span> R <span class="op">-></span> sunlight(<span class="fl">6371</span>u<span class="st">"km"</span><span class="op">,</span> [<span class="fl">0.5370</span><span class="op">,</span> <span class="fl">1.2606</span><span class="op">,</span> <span class="fl">0.5466</span>] <span class="op">.*</span> <span class="fl">1e8</span>u<span class="st">"km"</span><span class="op">,</span> R <span class="op">.*</span> u<span class="st">"m"</span>)<span class="op">;</span></span></code></pre></div>
|
||||
</div>
|
||||
<h2 id="plotting-the-results">Plotting the Results</h2>
|
||||
<p>The <code>sunlight</code> function returns values from 0 to 1, 0 being complete darkness, 1 being complete sunlight, and anything between being the fraction of light being received. Again since the ISS has a very low orbit, the amount of time spend in the penumbra is almost insignificant.</p>
|
||||
<div class="layout-chunk" data-layout="l-body-outset">
|
||||
<details>
|
||||
<summary>
|
||||
Show code
|
||||
</summary>
|
||||
<div class="sourceCode" id="cb6"><pre class="sourceCode julia"><code class="sourceCode julia"><span id="cb6-1"><a href="#cb6-1" aria-hidden="true" tabindex="-1"></a>light_range <span class="op">=</span> range(colorant<span class="st">"black"</span><span class="op">,</span> stop <span class="op">=</span> colorant<span class="st">"yellow"</span><span class="op">,</span> length <span class="op">=</span> <span class="fl">101</span>)<span class="op">;</span></span>
|
||||
<span id="cb6-2"><a href="#cb6-2" aria-hidden="true" tabindex="-1"></a>light_colors <span class="op">=</span> [light_range[unique(round(<span class="dt">Int</span><span class="op">,</span> <span class="fl">1</span> <span class="op">+</span> s <span class="op">*</span> <span class="fl">100</span>))][<span class="fl">1</span>] <span class="kw">for</span> s <span class="kw">in</span> S]<span class="op">;</span></span>
|
||||
<span id="cb6-3"><a href="#cb6-3" aria-hidden="true" tabindex="-1"></a></span>
|
||||
<span id="cb6-4"><a href="#cb6-4" aria-hidden="true" tabindex="-1"></a>plot(</span>
|
||||
<span id="cb6-5"><a href="#cb6-5" aria-hidden="true" tabindex="-1"></a> <span class="dt">LinRange</span>(<span class="fl">0</span><span class="op">,</span> <span class="fl">24</span><span class="op">,</span> length(S))<span class="op">,</span></span>
|
||||
<span id="cb6-6"><a href="#cb6-6" aria-hidden="true" tabindex="-1"></a> S <span class="op">.*</span> <span class="fl">100</span><span class="op">,</span></span>
|
||||
<span id="cb6-7"><a href="#cb6-7" aria-hidden="true" tabindex="-1"></a> linewidth <span class="op">=</span> <span class="fl">5</span><span class="op">,</span></span>
|
||||
<span id="cb6-8"><a href="#cb6-8" aria-hidden="true" tabindex="-1"></a> legend <span class="op">=</span> <span class="ex">false</span><span class="op">,</span></span>
|
||||
<span id="cb6-9"><a href="#cb6-9" aria-hidden="true" tabindex="-1"></a> color <span class="op">=</span> light_colors<span class="op">,</span></span>
|
||||
<span id="cb6-10"><a href="#cb6-10" aria-hidden="true" tabindex="-1"></a>)<span class="op">;</span></span>
|
||||
<span id="cb6-11"><a href="#cb6-11" aria-hidden="true" tabindex="-1"></a></span>
|
||||
<span id="cb6-12"><a href="#cb6-12" aria-hidden="true" tabindex="-1"></a>xlabel<span class="op">!</span>(<span class="st">"Time (hr)"</span>)<span class="op">;</span></span>
|
||||
<span id="cb6-13"><a href="#cb6-13" aria-hidden="true" tabindex="-1"></a>ylabel<span class="op">!</span>(<span class="st">"Sunlight (%)"</span>)<span class="op">;</span></span>
|
||||
<span id="cb6-14"><a href="#cb6-14" aria-hidden="true" tabindex="-1"></a>title<span class="op">!</span>(<span class="st">"ISS Sunlight Over a Day"</span>)</span></code></pre></div>
|
||||
<div class="sourceCode" id="cb8"><pre class="sourceCode julia"><code class="sourceCode julia"><span id="cb8-1"><a href="#cb8-1" aria-hidden="true" tabindex="-1"></a><span class="co"># Get fancy with the line color. </span></span>
|
||||
<span id="cb8-2"><a href="#cb8-2" aria-hidden="true" tabindex="-1"></a>light_range <span class="op">=</span> range(colorant<span class="st">"black"</span><span class="op">,</span> stop <span class="op">=</span> colorant<span class="st">"orange"</span><span class="op">,</span> length <span class="op">=</span> <span class="fl">101</span>)<span class="op">;</span></span>
|
||||
<span id="cb8-3"><a href="#cb8-3" aria-hidden="true" tabindex="-1"></a>light_colors <span class="op">=</span> [light_range[unique(round(<span class="dt">Int</span><span class="op">,</span> <span class="fl">1</span> <span class="op">+</span> s <span class="op">*</span> <span class="fl">100</span>))][<span class="fl">1</span>] <span class="kw">for</span> s <span class="kw">in</span> S]<span class="op">;</span></span>
|
||||
<span id="cb8-4"><a href="#cb8-4" aria-hidden="true" tabindex="-1"></a></span>
|
||||
<span id="cb8-5"><a href="#cb8-5" aria-hidden="true" tabindex="-1"></a>plot(</span>
|
||||
<span id="cb8-6"><a href="#cb8-6" aria-hidden="true" tabindex="-1"></a> <span class="dt">LinRange</span>(<span class="fl">0</span><span class="op">,</span> <span class="fl">24</span><span class="op">,</span> length(S))<span class="op">,</span></span>
|
||||
<span id="cb8-7"><a href="#cb8-7" aria-hidden="true" tabindex="-1"></a> S <span class="op">.*</span> <span class="fl">100</span><span class="op">,</span></span>
|
||||
<span id="cb8-8"><a href="#cb8-8" aria-hidden="true" tabindex="-1"></a> linewidth <span class="op">=</span> <span class="fl">5</span><span class="op">,</span></span>
|
||||
<span id="cb8-9"><a href="#cb8-9" aria-hidden="true" tabindex="-1"></a> legend <span class="op">=</span> <span class="ex">false</span><span class="op">,</span></span>
|
||||
<span id="cb8-10"><a href="#cb8-10" aria-hidden="true" tabindex="-1"></a> color <span class="op">=</span> light_colors<span class="op">,</span></span>
|
||||
<span id="cb8-11"><a href="#cb8-11" aria-hidden="true" tabindex="-1"></a>)<span class="op">;</span></span>
|
||||
<span id="cb8-12"><a href="#cb8-12" aria-hidden="true" tabindex="-1"></a></span>
|
||||
<span id="cb8-13"><a href="#cb8-13" aria-hidden="true" tabindex="-1"></a>xlabel<span class="op">!</span>(<span class="st">"Time (hr)"</span>)<span class="op">;</span></span>
|
||||
<span id="cb8-14"><a href="#cb8-14" aria-hidden="true" tabindex="-1"></a>ylabel<span class="op">!</span>(<span class="st">"Sunlight (%)"</span>)<span class="op">;</span></span>
|
||||
<span id="cb8-15"><a href="#cb8-15" aria-hidden="true" tabindex="-1"></a>title<span class="op">!</span>(<span class="st">"ISS Sunlight Over a Day"</span>)</span></code></pre></div>
|
||||
</details>
|
||||
<div class="figure"><span id="fig:unnamed-chunk-6"></span>
|
||||
<img src="iss-eclipse-determination_files/figure-html5/unnamed-chunk-6-J1.png" alt="Rocket Motor Data: [@thrustcurve]" width="300" data-distill-preview=1 />
|
||||
<div class="figure"><span id="fig:unnamed-chunk-7"></span>
|
||||
<img src="iss-eclipse-determination_files/figure-html5/unnamed-chunk-7-J1.png" alt="ISS Sunlight" width="300" data-distill-preview=1 />
|
||||
<p class="caption">
|
||||
Figure 1: Rocket Motor Data: <span class="citation" data-cites="thrustcurve">[@thrustcurve]</span>
|
||||
Figure 1: ISS Sunlight
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="sourceCode" id="cb7"><pre class="sourceCode r distill-force-highlighting-css"><code class="sourceCode r"></code></pre></div>
|
||||
<p>Looking at the plot its pretty easy to see by the vertical transition from 0% to 100% that the time in the penumbra is limited, but almost counterintutively it also looks like the ISS gets more sunlight than it does darkness. Using the raw sunlight data we can actually calculate almost exactly how much time is spent in each region.</p>
|
||||
Time in Sun:
|
||||
<div class="layout-chunk" data-layout="l-body">
|
||||
<div class="sourceCode" id="cb9"><pre class="sourceCode julia"><code class="sourceCode julia"><span id="cb9-1"><a href="#cb9-1" aria-hidden="true" tabindex="-1"></a>sun <span class="op">=</span> length(S[S.<span class="op">==</span><span class="fl">1</span>])<span class="op">/</span>length(S) <span class="op">*</span> <span class="fl">100</span></span></code></pre></div>
|
||||
<pre><code>62.03323593209401</code></pre>
|
||||
</div>
|
||||
Time in Darkness:
|
||||
<div class="layout-chunk" data-layout="l-body">
|
||||
<div class="sourceCode" id="cb11"><pre class="sourceCode julia"><code class="sourceCode julia"><span id="cb11-1"><a href="#cb11-1" aria-hidden="true" tabindex="-1"></a>umbra <span class="op">=</span> length(S[S.<span class="op">==</span><span class="fl">0</span>])<span class="op">/</span>length(S) <span class="op">*</span> <span class="fl">100</span></span></code></pre></div>
|
||||
<pre><code>37.64408511553699</code></pre>
|
||||
</div>
|
||||
Time in Penumbra:
|
||||
<div class="layout-chunk" data-layout="l-body">
|
||||
<div class="sourceCode" id="cb13"><pre class="sourceCode julia"><code class="sourceCode julia"><span id="cb13-1"><a href="#cb13-1" aria-hidden="true" tabindex="-1"></a>penumbra <span class="op">=</span> <span class="fl">100</span> <span class="op">-</span> umbra <span class="op">-</span> sun</span></code></pre></div>
|
||||
<pre><code>0.322678952369003</code></pre>
|
||||
</div>
|
||||
<p>The ISS spends about 62% of its time in the sun, this is because if you go back and reference the diagram at the beginning of this post you can see that the umbra is actually a cone. This is mainly due to the fact that the Sun is massive compared to the Earth, but this effect is also stronger with orbits of higher altitudes.</p>
|
||||
<div class="sourceCode" id="cb15"><pre class="sourceCode r distill-force-highlighting-css"><code class="sourceCode r"></code></pre></div>
|
||||
<div id="refs" class="references csl-bib-body hanging-indent" role="doc-bibliography">
|
||||
<div id="ref-ariss" class="csl-entry" role="doc-biblioentry">
|
||||
<span>“<span>ARISS</span> <span>TLE</span>.”</span> n.d. <em>Amateur Radio on the International Space Station</em>. <a href="https://live.ariss.org/tle/">https://live.ariss.org/tle/</a>.
|
||||
</div>
|
||||
</div>
|
||||
<!--radix_placeholder_article_footer-->
|
||||
<!--/radix_placeholder_article_footer-->
|
||||
</div>
|
||||
@@ -1586,6 +1624,8 @@ Figure 1: Rocket Motor Data: <span class="citation" data-cites="thrustcurve">[@t
|
||||
<!--/radix_placeholder_site_after_body-->
|
||||
<!--radix_placeholder_appendices-->
|
||||
<div class="appendix-bottom">
|
||||
<h3 id="references">References</h3>
|
||||
<div id="references-listing"></div>
|
||||
<h3 id="updates-and-corrections">Corrections</h3>
|
||||
<p>If you see mistakes or want to suggest changes, please <a href="https://gitlab.com/lander-team/air-prop-simulation">create an issue</a> on the source repository.</p>
|
||||
<h3 id="reuse">Reuse</h3>
|
||||
|
Reference in New Issue
Block a user