1
0
mirror of https://gitlab.com/Anson-Projects/projects.git synced 2025-07-22 06:01:33 +00:00

progress on sunlight article

This commit is contained in:
2021-05-03 16:34:29 -07:00
parent 9100c42a71
commit bd361632cf
41 changed files with 2727 additions and 60 deletions

View File

@@ -88,35 +88,36 @@ 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"/>
<meta property="description" itemprop="description" content="Determining how much sunlight a body 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-14"/>
<meta property="article:created" itemprop="dateCreated" content="2021-04-14"/>
<meta property="article:published" itemprop="datePublished" content="2021-04-01"/>
<meta property="article:created" itemprop="dateCreated" content="2021-04-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"/>
<meta property="og:description" content="Determining how much sunlight a body 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"/>
<meta property="twitter:description" content="Determining how much sunlight a body is receiving."/>
<!--/radix_placeholder_meta_tags-->
<!--radix_placeholder_rmarkdown_metadata-->
<script type="text/json" id="radix-rmarkdown-metadata">
{"type":"list","attributes":{"names":{"type":"character","attributes":{},"value":["title","description","draft","author","date","output"]}},"value":[{"type":"character","attributes":{},"value":["ISS Eclipse Determination"]},{"type":"character","attributes":{},"value":["Determining how much sunlight a body \n"]},{"type":"logical","attributes":{},"value":[true]},{"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":["04-14-2021"]},{"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":"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"]}]}
</script>
<!--/radix_placeholder_rmarkdown_metadata-->
<script type="text/json" id="radix-resource-manifest">
{"type":"character","attributes":{},"value":["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/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"]}
{"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"]}
</script>
<!--radix_placeholder_navigation_in_header-->
<!--/radix_placeholder_navigation_in_header-->
@@ -1455,7 +1456,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","authors":[{"author":"Anson Biggs","authorURL":"https://ansonbiggs.com","affiliation":"&nbsp;","affiliationURL":"#","orcidID":""}],"publishedDate":"2021-04-14T00:00:00.000-07:00","citationText":"Biggs, 2021"}
{"title":"ISS Eclipse Determination","description":"Determining how much sunlight a body is receiving.","authors":[{"author":"Anson Biggs","authorURL":"https://ansonbiggs.com","affiliation":"&nbsp;","affiliationURL":"#","orcidID":""}],"publishedDate":"2021-04-01T00:00:00.000-07:00","citationText":"Biggs, 2021"}
</script>
<!--/radix_placeholder_front_matter-->
@@ -1467,20 +1468,112 @@ code span.wa { color: #5e5e5e; font-style: italic; } /* Warning */
<div class="d-title">
<h1>ISS Eclipse Determination</h1>
<!--radix_placeholder_categories-->
<div class="dt-tags">
<div class="dt=tag">Julia</div>
<div class="dt=tag">Astrodynamics</div>
</div>
<!--/radix_placeholder_categories-->
<p><p>Determining how much sunlight a body</p></p>
<p><p>Determining how much sunlight a body is receiving.</p></p>
</div>
<div class="d-byline">
Anson Biggs <a href="https://ansonbiggs.com" class="uri">https://ansonbiggs.com</a>
<br/>04-14-2021
<br/>04-01-2021
</div>
<div class="d-article">
<p>Distill is a publication format for scientific and technical writing, native to the web.</p>
<p>Learn more about using Distill at <a href="https://rstudio.github.io/distill" class="uri">https://rstudio.github.io/distill</a>.</p>
<div class="sourceCode" id="cb1"><pre class="sourceCode r distill-force-highlighting-css"><code class="sourceCode r"></code></pre></div>
<p>Determining the eclipses a satellite will encounter is a major driving factor when designing a mission in space. Thermal and power budgets have to be made with the fact that a satellite will periodically be in the complete darkness of space with no solar radiation to power the solar panels and keep the spacecraft from freezing.</p>
<h2 id="what-is-an-eclipse">What is an Eclipse</h2>
<figure>
<img src="geometry.svg" alt="Geometry of an Eclipse" /><figcaption aria-hidden="true">Geometry of an Eclipse</figcaption>
</figure>
<figure>
<img src="vectors_radiuss.svg" alt="Body Radiuss and Position Vectors" /><figcaption aria-hidden="true">Body Radiuss and Position Vectors</figcaption>
</figure>
<h2 id="the-code">The Code</h2>
<div class="layout-chunk" data-layout="l-body">
<details>
<summary>
Show code
</summary>
<div class="sourceCode" id="cb1"><pre class="sourceCode julia"><code class="sourceCode julia"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a><span class="kw">using</span> Unitful</span>
<span id="cb1-2"><a href="#cb1-2" aria-hidden="true" tabindex="-1"></a><span class="kw">using</span> LinearAlgebra</span>
<span id="cb1-3"><a href="#cb1-3" aria-hidden="true" tabindex="-1"></a><span class="kw">using</span> SatelliteToolbox</span>
<span id="cb1-4"><a href="#cb1-4" aria-hidden="true" tabindex="-1"></a><span class="kw">using</span> Plots</span>
<span id="cb1-5"><a href="#cb1-5" aria-hidden="true" tabindex="-1"></a><span class="kw">using</span> Colors</span>
<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>
<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">&quot;&quot;&quot;</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">&quot;&quot;&quot;</span></span></code></pre></div>
</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>
<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">&quot;km&quot;</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">&lt;</span> π <span class="op">/</span> <span class="fl">2</span>) <span class="op">&amp;&amp;</span> (norm(r_body_sc) <span class="op">&lt;</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">&lt;</span> π <span class="op">/</span> <span class="fl">2</span>) <span class="op">&amp;&amp;</span> ((du <span class="op">&lt;</span> norm(r_body_sc)) <span class="op">&amp;&amp;</span> (norm(r_body_sc) <span class="op">&lt;</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">|&gt;</span> u<span class="st">&quot;km&quot;</span>) <span class="op">-</span> du) <span class="op">/</span> (dp <span class="op">-</span> du) <span class="op">|&gt;</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>
<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">|&gt;</span> R <span class="op">-&gt;</span> sunlight(<span class="fl">6371</span>u<span class="st">&quot;km&quot;</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">&quot;km&quot;</span><span class="op">,</span> R <span class="op">.*</span> u<span class="st">&quot;m&quot;</span>)</span></code></pre></div>
</div>
<h2 id="plotting-the-results">Plotting the Results</h2>
<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">&quot;black&quot;</span><span class="op">,</span> stop <span class="op">=</span> colorant<span class="st">&quot;yellow&quot;</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">&quot;Time (hr)&quot;</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">&quot;Sunlight (%)&quot;</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">&quot;ISS Sunlight Over a Day&quot;</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 />
<p class="caption">
Figure 1: Rocket Motor Data: <span class="citation" data-cites="thrustcurve">[@thrustcurve]</span>
</p>
</div>
</div>
<div class="sourceCode" id="cb7"><pre class="sourceCode r distill-force-highlighting-css"><code class="sourceCode r"></code></pre></div>
<!--radix_placeholder_article_footer-->
<!--/radix_placeholder_article_footer-->
</div>
@@ -1492,7 +1585,12 @@ code span.wa { color: #5e5e5e; font-style: italic; } /* Warning */
<!--radix_placeholder_site_after_body-->
<!--/radix_placeholder_site_after_body-->
<!--radix_placeholder_appendices-->
<div class="appendix-bottom"></div>
<div class="appendix-bottom">
<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>
<p>Text and figures are licensed under Creative Commons Attribution <a rel="license" href="https://creativecommons.org/licenses/by/4.0/">CC BY 4.0</a>. Source code is available at <a href="https://gitlab.com/lander-team/air-prop-simulation">https://gitlab.com/lander-team/air-prop-simulation</a>, unless otherwise noted. The figures that have been reused from other sources don't fall under this license and can be recognized by a note in their caption: "Figure from ...".</p>
</div>
<!--/radix_placeholder_appendices-->
<!--radix_placeholder_navigation_after_body-->
<!--/radix_placeholder_navigation_after_body-->