{"id":10352,"date":"2023-10-09T06:00:14","date_gmt":"2023-10-09T10:00:14","guid":{"rendered":"https:\/\/blogs.mathworks.com\/student-lounge\/?p=10352"},"modified":"2023-10-08T19:32:50","modified_gmt":"2023-10-08T23:32:50","slug":"differential-equations-modeling-with-matlab-scudem","status":"publish","type":"post","link":"https:\/\/blogs.mathworks.com\/student-lounge\/2023\/10\/09\/differential-equations-modeling-with-matlab-scudem\/","title":{"rendered":"Differential Equations Modeling with MATLAB &#8211; SCUDEM"},"content":{"rendered":"<div class=\"rtcContent\">\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\"><\/div>\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\"><span style=\"font-style: italic;\">Joining us today is Wesley Hamilton, who is a STEM Outreach Engineer here at MathWorks. Wesley will talk about SIMIODE&#8217;s SCUDEM competition. Wesley, over to you\u2026 <\/span><\/div>\n<h2 id=\"H_5AFF2E3F\" style=\"margin: 20px 10px 5px 4px; padding: 0px; line-height: 20px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 20px; font-weight: bold; text-align: left;\">Overview<\/h2>\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\">This blog post has three goals:<\/div>\n<ol style=\"margin: 10px 0px 20px; padding-left: 0px; font-family: Helvetica, Arial, sans-serif; font-size: 14px;\">\n<li style=\"margin-left: 56px; line-height: 21px; min-height: 0px; text-align: left; white-space: pre-wrap;\">Introduce SIMIODE&#8217;s SCUDEM competition, which MathWorks now supports,<\/li>\n<li style=\"margin-left: 56px; line-height: 21px; min-height: 0px; text-align: left; white-space: pre-wrap;\">Show how one might start developing a model to address a real world (SCUDEM) problem, and<\/li>\n<li style=\"margin-left: 56px; line-height: 21px; min-height: 0px; text-align: left; white-space: pre-wrap;\">Showcase the ODE solving functionality provided by MATLAB.<\/li>\n<\/ol>\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\">We&#8217;ll be showcasing how a new team to SCUDEM, and math modeling, <span style=\"font-style: italic;\">might<\/span> get started developing a solution to a problem. As such the model won&#8217;t be particularly refined, but the modeling process employed can (and should) be replicated as a better practice when competing.<\/div>\n<div style=\"margin-bottom: 20px; padding-bottom: 4px;\">\n<div style=\"margin: 0px; padding: 10px 0px 10px 5px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: bold; text-align: start;\"><span style=\"font-weight: bold;\">Table of Contents<\/span><\/div>\n<p style=\"margin: -1px 0px 0px; padding: 5px 0px 5px 4px; line-height: 11px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: start;\"><a href=\"#H_5AFF2E3F\">Overview<br \/>\n<\/a><a href=\"#H_4F8C6647\">SIMIODE and SCUDEM<br \/>\n<\/a><a href=\"#H_0E195BB9\">The problem<br \/>\n<\/a><a href=\"#H_4ADB8342\">An initial model &#8211; plan<br \/>\n<\/a><a href=\"#H_D700539F\">An initial model &#8211; implementation in MATLAB<br \/>\n<\/a><a href=\"#H_033A0FB1\">Next steps<br \/>\n<\/a><a href=\"#H_3601F4E4\">Functions<\/a><\/p>\n<\/div>\n<\/div>\n<h2 id=\"H_4F8C6647\" style=\"margin: 3px 10px 5px 4px; padding: 0px; line-height: 20px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 20px; font-weight: bold; text-align: left;\">SIMIODE and SCUDEM<\/h2>\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\">The Systemic Initiative for Modeling Investigations and Opportunities with Differential Equations (SIMIODE) is an organization that, as described on their <a href=\"https:\/\/www.simiode.org\/\">website<\/a>, &#8220;is a Community of Practice focused on a modeling first method of teaching differential equations&#8221;. Since 2017, SIMIODE has organized the SIMIODE Challenge Using Differential Equations Modeling (SCUDEM). This annual competition has teams pick one of three problems, and develop a differential equation model to answer their chosen problem. This year SCUDEM will run from October 20 to November 30, in which time teams will develop their models and prepare a short youtube video describing their work. The <a href=\"https:\/\/qubeshub.org\/community\/groups\/scudem\">SCUDEM website<\/a> has more information on taking part, including registration information and problems and results from previous years.<\/div>\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\">This year, MathWorks is excited to provide direct support for SCUDEM by way of licenses and preparatory materials. Read on for some of these new preparatory materials.<\/div>\n<h2 id=\"H_0E195BB9\" style=\"margin: 3px 10px 5px 4px; padding: 0px; line-height: 20px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 20px; font-weight: bold; text-align: left;\">The problem<\/h2>\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\">For this blog post, we&#8217;re going to tackle the 2022 SCUDEM problem A, which ask teams to develop a model that describes ISS astronauts&#8217; stress when completing tasks and helping\/getting helped by ISS visitors. Take a minute to read through the problem statement in its entirety by going to <a href=\"https:\/\/qubeshub.org\/community\/groups\/scudem\/wiki\/SCUDEMVII2022,\">https:\/\/qubeshub.org\/community\/groups\/scudem\/wiki\/SCUDEMVII2022,<\/a> and then click on &#8220;Problem Statements&#8221; underneath &#8220;Official Challenge Problems for SCUDEM VII 2022&#8221;. A PDF with all three of the 2022 problem statements will be downloaded.<\/div>\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\">Before setting up a model, we need to have a solid grasp of the actual problem we&#8217;re being asked to address. Here, let&#8217;s walk through the problem statement paragraph by paragraph and pick out key pieces that will help us specify what exactly we&#8217;re building a model for.<\/div>\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: center;\"><span style=\"font-style: italic;\">A group of individuals recently purchased a flight to go to the International Space Station [1]. Each of them had to complete a rigorous training regime and demonstrate that they were capable of handling the physical and mental demands of space travel. When they arrived, they were expected to provide help and assistance to the astronauts who were at the station and the new crew members had a large number of tasks and experiments to complete. <\/span><\/div>\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\">In the model we develop, we&#8217;re going to specify two different groups of people that may behave (and be modeled) differently. Since the ISS has a smaller number of crew, we have two options to explore:<\/div>\n<ol style=\"margin: 10px 0px 20px; padding-left: 0px; font-family: Helvetica, Arial, sans-serif; font-size: 14px;\">\n<li style=\"margin-left: 56px; line-height: 21px; min-height: 0px; text-align: left; white-space: pre-wrap;\">follow a more agent-based model approach, where we keep track of individual astronauts and visitors, or<\/li>\n<li style=\"margin-left: 56px; line-height: 21px; min-height: 0px; text-align: left; white-space: pre-wrap;\">treat the astronauts and visitors as single entities, so that we&#8217;re modeling e.g. the collective stress of the astronauts and not individuals&#8217; stress.<\/li>\n<\/ol>\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\">Either approach can work, and both approaches may not be difficult to implement in MATLAB. Let&#8217;s read on to see what other information might inform which of these options we&#8217;ll pick.<\/div>\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: center;\"><span style=\"font-style: italic;\">The hectic schedule nearly overwhelmed the newly arrived guests, and the extra attention they required added to the stress felt by the existing crew. What can be done to ease this burden, yet result in a more efficient use of time for a flight crew? Before answering this question, a way to model the stress and capabilities of a flight crew must be created. <\/span><\/div>\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\">A key piece of information is that &#8220;stress&#8221; and &#8220;capabilities&#8221; are explicitly mentioned. At this point, these may be the two quantities we build a model around for each group or each astronaut\/visitor. Moreover, the specific mention that the visitors added to the stress of the astronauts is important &#8211; when we test our model, we may want to run a simulation without visitors to confirm that the stress of the astronauts is stable (in some capacity), since the provided information suggests that the visitors potentially threw things out of stability.<\/div>\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: center;\"><span style=\"font-style: italic;\">Develop a mathematical model of the stress and capabilities of a group of people. Assume that there is an existing group of people in place at the destination who are already under a great deal of pressure to complete their assigned tasks. The model should include the addition of a second group of capable people who arrive after undergoing the stress of a space launch and do not have prior exposure to the new environment. Given the expected stress levels over time what is the impact on the whole group? <\/span><\/div>\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\">This paragraph has the main task: <span style=\"font-style: italic;\">Develop a mathematical model of the stress and capabilities of a group of people<\/span>. As above, we&#8217;re still looking at focusing on stress and capability as the two numeric quantities to use, and the specific mention of a <span style=\"font-style: italic;\">group<\/span> of people suggests it&#8217;s not out-of-line to treat all astronauts as a single entity (the <span style=\"font-style: italic;\">group<\/span> of astronatus), and same with the visitors. Otherwise, we&#8217;re being asked to say something about stress levels over time &#8211; if in the end we don&#8217;t want to keep track of both stress and capabilities, then we should definitely keep stress as the main quantitative object we work with.<\/div>\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: center;\"><span style=\"font-style: italic;\">Your model should be able to take a schedule for the whole group and then predict the impact on the group of people. You should identify what happens under different scenarios including the expectation of an immediate high level of productivity, a short period of rest followed by a sharp rise in a high level of productivity, and then a gradual increase from low to high levels of productivity. Which scenario results in the lowest stress and highest net productivity? Also, what should ground observers expect from small deviations from a given schedule? <\/span><\/div>\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\">Here we&#8217;re given a few more specific requirements to include:<\/div>\n<ol style=\"margin: 10px 0px 20px; padding-left: 0px; font-family: Helvetica, Arial, sans-serif; font-size: 14px;\">\n<li style=\"margin-left: 56px; line-height: 21px; min-height: 0px; text-align: left; white-space: pre-wrap;\">incorporate a schedule for the astronauts and visitors,<\/li>\n<li style=\"margin-left: 56px; line-height: 21px; min-height: 0px; text-align: left; white-space: pre-wrap;\">incorporate different levels of productivity for all onboard,<\/li>\n<li style=\"margin-left: 56px; line-height: 21px; min-height: 0px; text-align: left; white-space: pre-wrap;\">incorporate (small) deviations in the schedule.<\/li>\n<\/ol>\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\">All of this should be incorporated to say something about the long-term stress of everyone onboard.<\/div>\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\">So to summarize (some of) what we&#8217;ve picked out of the problem statement:<\/div>\n<ul style=\"margin: 10px 0px 20px; padding-left: 0px; font-family: Helvetica, Arial, sans-serif; font-size: 14px;\">\n<li style=\"margin-left: 56px; line-height: 21px; min-height: 0px; text-align: left; white-space: pre-wrap;\">model the stress and capabilities for astronauts and visitors, and<\/li>\n<li style=\"margin-left: 56px; line-height: 21px; min-height: 0px; text-align: left; white-space: pre-wrap;\">incorporate a schedule with varying amounts of productivity each day.<\/li>\n<\/ul>\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\">In the next section, we&#8217;ll identify how we want to quantify everything before incorporating our initial model in MATLAB.<\/div>\n<h2 id=\"H_4ADB8342\" style=\"margin: 3px 10px 5px 4px; padding: 0px; line-height: 20px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 20px; font-weight: bold; text-align: left;\">An initial model &#8211; plan<\/h2>\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\">Models can be as complex or as simple as one desires. Here, we&#8217;ll start with developing a simple model to showcase a viable approach, which will hopefully give us some preliminary results and pave the way to a more complex, and descriptive of the situation, model.<\/div>\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\">To start, let&#8217;s just model the stress of the astronauts and visitors and incorporate capabilities through the model parameters; later on we may revisit this decision and look more closely into how capabilities and stress interact. Thus, our functions of interest will be<\/div>\n<ul style=\"margin: 10px 0px 20px; padding-left: 0px; font-family: Helvetica, Arial, sans-serif; font-size: 14px;\">\n<li style=\"margin-left: 56px; line-height: 21px; min-height: 0px; text-align: left; white-space: pre-wrap;\"><span style=\"vertical-align: -6px;\">$ s_a $<\/span> for the stress of astronauts, and<\/li>\n<li style=\"margin-left: 56px; line-height: 21px; min-height: 0px; text-align: left; white-space: pre-wrap;\"><span style=\"vertical-align: -6px;\">$ s_v $<\/span> for the stress of the visitors,<\/li>\n<\/ul>\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\">and our system of differential equations will look like<\/div>\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\"><span style=\"vertical-align: -15px;\">$ \\frac{ds_a}{dt} = &#8230; $<\/span><\/div>\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\"><span style=\"vertical-align: -15px;\">$ \\frac{ds_v}{dt} = &#8230; $<\/span><\/div>\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\">There are a few ways we might model the change in stress, and since we&#8217;re not trained specialists in the psychology of stress, we&#8217;ll rely heavily on assumptions to set up our model. Let&#8217;s start by developing the model for an astronaut&#8217;s stress, and then look at how a visitor&#8217;s stress is incorporated.<\/div>\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\">We&#8217;ll assume that the increase in stress is proportional to the amount of work being done and the amount of stress already accumulated, and stress decreases while at rest at a rate proportional to their current stress level: for this we&#8217;ll need<\/div>\n<ol style=\"margin: 10px 0px 20px; padding-left: 0px; font-family: Helvetica, Arial, sans-serif; font-size: 14px;\">\n<li style=\"margin-left: 56px; line-height: 21px; min-height: 0px; text-align: left; white-space: pre-wrap;\">a constant of proportionality for stress accumulation <span style=\"vertical-align: -6px;\">$ \\alpha_a $<\/span>,<\/li>\n<li style=\"margin-left: 56px; line-height: 21px; min-height: 0px; text-align: left; white-space: pre-wrap;\">a constant of proportionality for stress decumulation <span style=\"vertical-align: -6px;\">$ \\beta_a $<\/span>, and<\/li>\n<li style=\"margin-left: 56px; line-height: 21px; min-height: 0px; text-align: left; white-space: pre-wrap;\">a function detailing the amount of work an astronaut is doing <span style=\"vertical-align: -5px;\">$ W(t) $<\/span>.<\/li>\n<\/ol>\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\">As the astronaut is working (<span style=\"vertical-align: -5px;\">$ W(t)&gt;0 $<\/span>), their total stress should increase. When the astronaut is at rest (<span style=\"vertical-align: -5px;\">$ W(t)=0 $<\/span>), their total stress should decrease. For our initial approach let&#8217;s assume that astronauts work at a constant rate of <span style=\"vertical-align: -5px;\">$ W(t)=1 $<\/span> when on-duty. With this framework we can write<\/div>\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\"><span style=\"vertical-align: -15px;\">$ \\frac{d s_a}{dt} = \\alpha_a W(t) s_a(t) &#8211; \\beta_a s_a(t) (1 &#8211; W(t)) $<\/span>.<\/div>\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\">Since there was nothing specific in this framework to astronauts, we&#8217;ll assume visitor stress follows the same model (with their own constants of proportionality:<\/div>\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\"><span style=\"vertical-align: -15px;\">$ \\frac{d s_v}{dt} = \\alpha_v W(t) s_v(t) &#8211; \\beta_v s_v(t) (1 &#8211; W(t)) $<\/span><\/div>\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\">In future versions of this model, we may modify the work function to be different for astronauts and visitors, but for now we&#8217;ll stick with this approach.<\/div>\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\">Next, we need to discuss the interaction of stress between astronauts and the visitors. An initial assumption we&#8217;ll make is that an astronaut&#8217;s stress accumulation is also proportional to the stress of the visitors, and vise versa, so our equations become<\/div>\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\"><span style=\"vertical-align: -15px;\">$ \\frac{d s_a}{dt} = \\alpha_a W(t) s_a(t)s_v(t) &#8211; \\beta_a s_a(t) (1 &#8211; W(t)) $<\/span>,<\/div>\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\"><span style=\"vertical-align: -15px;\">$ \\frac{d s_v}{dt} = \\alpha_v W(t) s_a(t)s_v(t) &#8211; \\beta_v s_v(t) (1 &#8211; W(t)) $<\/span>.<\/div>\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\">Once we run simulations we can start specifying the constants that make sense for our model, but we do need to specify ahead of the simulation, based on astronauts&#8217; actual schedules. For this, we can do some research; <a href=\"https:\/\/www.clickorlando.com\/news\/space-news\/2020\/11\/14\/a-day-in-space-heres-what-an-astronauts-daily-routine-looks-like\/#:~:text=Here%27s%20a%20look%20at%20an,maintain%20muscle%20tone%20and%20fitness.\">this article<\/a> suggests astronauts work from 6 am to 9.30 pm, with three meals and 2.5 hours of exercise. Without a specific schedule to copy, we&#8217;ll make the following assumption for the astronauts&#8217; and visitors&#8217; schedule:<\/div>\n<ul style=\"margin: 10px 0px 20px; padding-left: 0px; font-family: Helvetica, Arial, sans-serif; font-size: 14px;\">\n<li style=\"margin-left: 56px; line-height: 21px; min-height: 0px; text-align: left; white-space: pre-wrap;\">astronauts wake up at 6 am but spend 60 minutes for breakfast\/working out\/taking a break, so work starts at 7 am;<\/li>\n<li style=\"margin-left: 56px; line-height: 21px; min-height: 0px; text-align: left; white-space: pre-wrap;\">astronauts work for 4 hours until 11 am, and then take 90 minutes for lunch\/working out\/taking a break, so work resumes at 12.30 pm;<\/li>\n<li style=\"margin-left: 56px; line-height: 21px; min-height: 0px; text-align: left; white-space: pre-wrap;\">astronauts work for 5 hours until 5.30 pm, before taking another 90 minutes for dinner\/working out\/taking a break, until work resumes at 7 pm;<\/li>\n<li style=\"margin-left: 56px; line-height: 21px; min-height: 0px; text-align: left; white-space: pre-wrap;\">astronauts work for 2 hours until 9 pm before taking a final 30 minute break, before going to bed at 9.30 pm.<\/li>\n<\/ul>\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\">This rough schedule include the 2.5 hours of exercise, as well as another 2 hours for assorted meals and breaks.<\/div>\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\">From the perspective of our work function <span style=\"vertical-align: -5px;\">$ W(t) $<\/span>, using a 24-hour clock, this means that<\/div>\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\"><span style=\"vertical-align: -5px;\">$ W(t) = 1 $<\/span> for <span style=\"vertical-align: -5px;\">$ 7\\leq t\\leq 11 $<\/span>, <span style=\"vertical-align: -5px;\">$ 12.5\\leq t\\leq 17.5 $<\/span>, <span style=\"vertical-align: -5px;\">$ 19\\leq t\\leq 21.5 $<\/span>, and<\/div>\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\"><span style=\"vertical-align: -5px;\">$ W(t) = 0 $<\/span> otherwise.<\/div>\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\">All calculations should be done modulo 24 since we want to track stress over a few days.<\/div>\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\">Here it&#8217;s worth reiterating that this model is quite basic, and that&#8217;s okay! We&#8217;re trying to establish a baseline model before we start refining our assumptions and extending our model to more accurately address what the problem statement is actually asking for.<\/div>\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\">Next, let&#8217;s implement our model in MATLAB!<\/div>\n<h2 id=\"H_D700539F\" style=\"margin: 3px 10px 5px 4px; padding: 0px; line-height: 20px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 20px; font-weight: bold; text-align: left;\">An initial model &#8211; implementation in MATLAB<\/h2>\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\">Let&#8217;s start by implementing just the model for astronauts&#8217; stress levels. Our goal is to establish a baseline for our constants of proportionality, before we incorporate the visitors. In particular, our expectation is that astronauts&#8217; stress levels should be stable over a few days, so we need to specify constants that respect this expectation.<\/div>\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\">Since we want to simulate stress over time, we&#8217;ll be using MATLAB, and in particular MATLAB&#8217;s ODE functionality. With the release of MATLAB 2023b there is some slick functionality for setting up and solving ODEs &#8211; our approach follows this new functionality as described in <a href=\"https:\/\/blogs.mathworks.com\/matlab\/2023\/10\/03\/the-new-solution-framework-for-ordinary-differential-equations-odes-in-matlab-r2023b\/\">this recent blog post<\/a>.<\/div>\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\">First, let&#8217;s encode the work function. Because of the nature of LiveScripts the actual function is included at the end of this post, but the monospace that follows is a direct copy of that function:<\/div>\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\"><span style=\"font-family: monospace;\">function w = W(t)<\/span><\/div>\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\"><span style=\"font-family: monospace;\"> normT = mod(floor(t),24) + (t &#8211; floor(t));<\/span><\/div>\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\"><span style=\"font-family: monospace;\"> if (normT &gt;= 7) &amp;&amp; (normT &lt;= 11)<\/span><\/div>\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\"><span style=\"font-family: monospace;\"> w = 1;<\/span><\/div>\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\"><span style=\"font-family: monospace;\"> elseif (normT &gt;= 12.5) &amp;&amp; (normT &lt;= 17.5)<\/span><\/div>\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\"><span style=\"font-family: monospace;\"> w = 1;<\/span><\/div>\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\"><span style=\"font-family: monospace;\"> elseif (normT &gt;= 19) &amp;&amp; (normT &lt;= 21)<\/span><\/div>\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\"><span style=\"font-family: monospace;\"> w = 1;<\/span><\/div>\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\"><span style=\"font-family: monospace;\"> else<\/span><\/div>\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\"><span style=\"font-family: monospace;\"> w = 0;<\/span><\/div>\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\"><span style=\"font-family: monospace;\"> end<\/span><\/div>\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\"><span style=\"font-family: monospace;\">end<\/span><\/div>\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\">In particular, note that since we&#8217;re running our model a few days into the future, we need to convert from the time that the mission started to a local 24-hour clock.<\/div>\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\">Next, let&#8217;s incorporate the constants of proportionality using sliders; the intention here is to experiment to identify reasonable values for the astronauts and their stress levels:<\/div>\n<div style=\"background-color: #f5f5f5; margin: 10px 0 10px 0;\">\n<div class=\"inlineWrapper\">\n<div style=\"border-left: 1px solid #bfbfbf; border-right: 1px solid #bfbfbf; border-top: 1px solid #bfbfbf; border-bottom: 0px none #212121; border-radius: 4px 4px 0px 0px; padding: 6px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: #212121; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14px;\"><span style=\"white-space: pre;\">alphaA = <\/span>0.3<span style=\"white-space: pre;\">;<\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div style=\"border-left: 1px solid #bfbfbf; border-right: 1px solid #bfbfbf; border-top: 0px none #212121; border-bottom: 0px none #212121; border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: #212121; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14px;\"><span style=\"white-space: pre;\">betaA = <\/span>2<span style=\"white-space: pre;\">;<\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div style=\"border-left: 1px solid #bfbfbf; border-right: 1px solid #bfbfbf; border-top: 0px none #212121; border-bottom: 1px solid #bfbfbf; border-radius: 0px 0px 4px 4px; padding: 0px 45px 4px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: #212121; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14px;\"><span style=\"white-space: pre;\">initValA = <\/span>0.3<span style=\"white-space: pre;\">;<\/span><\/div>\n<\/div>\n<\/div>\n<div style=\"margin: 10px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\">Finally, let&#8217;s write down the function <span style=\"vertical-align: -15px;\">$ \\frac{ds_a}{dt} $<\/span> :<\/div>\n<div style=\"background-color: #f5f5f5; margin: 10px 0 10px 0;\">\n<div class=\"inlineWrapper\">\n<div style=\"border-radius: 4px; padding: 6px 45px 4px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: #212121; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14px; border: 1px solid #bfbfbf;\"><span style=\"white-space: pre;\">dsa = @(t,y) alphaA*y*W(t) &#8211; betaA*y*(1-W(t));<\/span><\/div>\n<\/div>\n<\/div>\n<div style=\"margin: 10px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\">With these pieces in place, we can now solve the ODE and see what the astronauts&#8217; stress levels over time is:<\/div>\n<div style=\"background-color: #f5f5f5; margin: 10px 0 10px 0;\">\n<div class=\"inlineWrapper\">\n<div style=\"border-left: 1px solid #bfbfbf; border-right: 1px solid #bfbfbf; border-top: 1px solid #bfbfbf; border-bottom: 0px none #212121; border-radius: 4px 4px 0px 0px; padding: 6px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: #212121; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14px;\"><span style=\"white-space: pre;\">initF = ode(ODEFcn=dsa,InitialTime=7,InitialValue=initValA); <span style=\"color: #008013;\">% Set up the problem by creating an ode object<\/span><\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div style=\"border-left: 1px solid #bfbfbf; border-right: 1px solid #bfbfbf; border-top: 0px none #212121; border-bottom: 0px none #212121; border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: #212121; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14px;\"><span style=\"white-space: pre;\">sol = solve(initF,7,100); <span style=\"color: #008013;\">% Solve it over the interval [0,10]<\/span><\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper outputs\">\n<div style=\"border-left: 1px solid #bfbfbf; border-right: 1px solid #bfbfbf; border-top: 0px none #212121; border-bottom: 1px solid #bfbfbf; border-radius: 0px; padding: 0px 45px 4px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: #212121; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14px;\"><span style=\"white-space: pre;\">plot(sol.Time,sol.Solution,<span style=\"color: #a709f5;\">&#8220;-o&#8221;<\/span>)<\/span><\/div>\n<div style=\"color: #212121; padding: 10px 0px 6px 17px; background: #ffffff none repeat scroll 0% 0% \/ auto padding-box border-box; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14px; overflow-x: hidden; line-height: 17.234px;\">\n<div class=\"inlineElement eoOutputWrapper embeddedOutputsFigure\" style=\"width: 1146px;\" data-scroll-top=\"null\" data-scroll-left=\"null\" data-testid=\"output_0\">\n<div class=\"figureElement eoOutputContent\"><img decoding=\"async\" class=\"figureImage figureContainingNode\" style=\"width: 406px; padding-bottom: 0px;\" src=\"https:\/\/blogs.mathworks.com\/student-lounge\/files\/2023\/10\/23Oct9_1.png\" \/><\/div>\n<div class=\"outputLayer selectedOutputDecorationLayer doNotExport\"><\/div>\n<div class=\"outputLayer activeOutputDecorationLayer doNotExport\"><\/div>\n<div class=\"outputLayer scrollableOutputDecorationLayer doNotExport\"><\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\">Next, let&#8217;s incorporate the addition of the visitors. To do this, we need the new set of constants of proportionality, as well as a new function describing the differential equation that will look similar to what we had before:<\/div>\n<div style=\"background-color: #f5f5f5; margin: 10px 0 10px 0;\">\n<div class=\"inlineWrapper\">\n<div style=\"border-left: 1px solid #bfbfbf; border-right: 1px solid #bfbfbf; border-top: 1px solid #bfbfbf; border-bottom: 0px none #212121; border-radius: 4px 4px 0px 0px; padding: 6px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: #212121; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14px;\"><span style=\"white-space: pre;\">alphaV = <\/span>0.9<span style=\"white-space: pre;\">;<\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div style=\"border-left: 1px solid #bfbfbf; border-right: 1px solid #bfbfbf; border-top: 0px none #212121; border-bottom: 0px none #212121; border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: #212121; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14px;\"><span style=\"white-space: pre;\">betaV = <\/span>1.5<span style=\"white-space: pre;\">;<\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div style=\"border-left: 1px solid #bfbfbf; border-right: 1px solid #bfbfbf; border-top: 0px none #212121; border-bottom: 1px solid #bfbfbf; border-radius: 0px 0px 4px 4px; padding: 0px 45px 4px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: #212121; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14px;\"><span style=\"white-space: pre;\">initValV = <\/span>0.5<span style=\"white-space: pre;\">;<\/span><\/div>\n<\/div>\n<\/div>\n<div style=\"margin: 10px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\">Here we&#8217;re assuming that the visitors get stressed more easily (<span style=\"vertical-align: -6px;\">$ \\alpha_v &gt; \\alpha_a $<\/span>), and don&#8217;t destress as easily (<span style=\"vertical-align: -6px;\">$ \\beta_v &lt; \\beta_a $<\/span>). Otherwise, our function for the system of equations should now be a vector (the first coordinate is the astronauts&#8217; stress, and the second coordinate is the visitors&#8217; stress):<\/div>\n<div style=\"background-color: #f5f5f5; margin: 10px 0 10px 0;\">\n<div class=\"inlineWrapper\">\n<div style=\"border-left: 1px solid #bfbfbf; border-right: 1px solid #bfbfbf; border-top: 1px solid #bfbfbf; border-bottom: 0px none #212121; border-radius: 4px 4px 0px 0px; padding: 6px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: #212121; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14px;\"><span style=\"white-space: pre;\">ds = @(t,y) [alphaA*y(1)*y(2)*W(t) &#8211; betaA*y(1)*(1-W(t)); alphaV*y(1)*y(2)*W(t) &#8211; betaV*y(2)*(1-W(t))];<\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div style=\"border-left: 1px solid #bfbfbf; border-right: 1px solid #bfbfbf; border-top: 0px none #212121; border-bottom: 0px none #212121; border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: #212121; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14px;\"><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div style=\"border-left: 1px solid #bfbfbf; border-right: 1px solid #bfbfbf; border-top: 0px none #212121; border-bottom: 0px none #212121; border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: #212121; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14px;\"><span style=\"white-space: pre;\">F = ode(ODEFcn=ds,InitialTime=7,InitialValue=[initValA;initValV]); <span style=\"color: #008013;\">% Set up the problem by creating an ode object<\/span><\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div style=\"border-left: 1px solid #bfbfbf; border-right: 1px solid #bfbfbf; border-top: 0px none #212121; border-bottom: 0px none #212121; border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: #212121; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14px;\"><span style=\"white-space: pre;\">sol = solve(F,7,100); <span style=\"color: #008013;\">% Solve it over the interval [0,10]<\/span><\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper outputs\">\n<div style=\"border-left: 1px solid #bfbfbf; border-right: 1px solid #bfbfbf; border-top: 0px none #212121; border-bottom: 1px solid #bfbfbf; border-radius: 0px; padding: 0px 45px 4px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: #212121; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14px;\"><span style=\"white-space: pre;\">plot(sol.Time,sol.Solution,<span style=\"color: #a709f5;\">&#8220;-o&#8221;<\/span>)<\/span><\/div>\n<div style=\"color: #212121; padding: 10px 0px 6px 17px; background: #ffffff none repeat scroll 0% 0% \/ auto padding-box border-box; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14px; overflow-x: hidden; line-height: 17.234px;\">\n<div class=\"inlineElement eoOutputWrapper embeddedOutputsFigure\" style=\"width: 1146px;\" data-scroll-top=\"null\" data-scroll-left=\"null\" data-testid=\"output_1\">\n<div class=\"figureElement eoOutputContent\"><img decoding=\"async\" class=\"figureImage figureContainingNode\" style=\"width: 406px; padding-bottom: 0px;\" src=\"https:\/\/blogs.mathworks.com\/student-lounge\/files\/2023\/10\/23Oct9_2.png\" \/><\/div>\n<div class=\"outputLayer selectedOutputDecorationLayer doNotExport\"><\/div>\n<div class=\"outputLayer activeOutputDecorationLayer doNotExport\"><\/div>\n<div class=\"outputLayer scrollableOutputDecorationLayer doNotExport\"><\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<div style=\"margin: 10px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\">As above, the blue curve is the stress of astronauts, while the orange curve is the stress of the visitors.<\/div>\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\">Try playing around with the parameters, and you&#8217;ll see that it&#8217;s easy for, after the addition of visitors, stress levels to blow out of control. With that said, we <span style=\"font-style: italic;\">were<\/span> able to find a range of parameters that suggest, at least with these assumptions, the astronauts and visitors are able to eventually find harmony in their working conditions.<\/div>\n<h2 id=\"H_033A0FB1\" style=\"margin: 3px 10px 5px 4px; padding: 0px; line-height: 20px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 20px; font-weight: bold; text-align: left;\">Next steps<\/h2>\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\">To reiterate: this is a very, <span style=\"font-weight: bold;\">very<\/span> basic, initial model for human stress. While we have some preliminary results from this model that are interpretable, there are several modifications we can do to make the model even more descriptive and realistic, including, but not limited to:<\/div>\n<ul style=\"margin: 10px 0px 20px; padding-left: 0px; font-family: Helvetica, Arial, sans-serif; font-size: 14px;\">\n<li style=\"margin-left: 56px; line-height: 21px; min-height: 0px; text-align: left; white-space: pre-wrap;\">modifying the working function <span style=\"vertical-align: -5px;\">$ W(t)% $<\/span> to incorporate the working conditions specified in the problem statement,<\/li>\n<li style=\"margin-left: 56px; line-height: 21px; min-height: 0px; text-align: left; white-space: pre-wrap;\">(possibly) modifying the stress interactions for individuals, and not the cumulative group,<\/li>\n<li style=\"margin-left: 56px; line-height: 21px; min-height: 0px; text-align: left; white-space: pre-wrap;\">revisiting the initial model for the changes in stress, possibly adding crew capabilities for performing work as another function,<\/li>\n<li style=\"margin-left: 56px; line-height: 21px; min-height: 0px; text-align: left; white-space: pre-wrap;\">etc.<\/li>\n<\/ul>\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\">Interested in more? Check out some of our other preparatory materials for MATLAB and math modeling listed on the SCUDEM website, as well as other MathWorks blogs for more ideas, tips, and tricks on how to effectively use MATLAB.<\/div>\n<h2 id=\"H_3601F4E4\" style=\"margin: 3px 10px 5px 4px; padding: 0px; line-height: 20px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 20px; font-weight: bold; text-align: left;\">Functions<\/h2>\n<div style=\"background-color: #f5f5f5; margin: 10px 0 10px 0;\">\n<div class=\"inlineWrapper\">\n<div style=\"border-left: 1px solid #bfbfbf; border-right: 1px solid #bfbfbf; border-top: 1px solid #bfbfbf; border-bottom: 0px none #212121; border-radius: 4px 4px 0px 0px; padding: 6px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: #212121; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14px;\"><span style=\"white-space: pre;\"><span style=\"color: #0e00ff;\">function <\/span>w = W(t)<\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div style=\"border-left: 1px solid #bfbfbf; border-right: 1px solid #bfbfbf; border-top: 0px none #212121; border-bottom: 0px none #212121; border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: #212121; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14px;\"><span style=\"white-space: pre;\">normT = mod(floor(t),24) + (t &#8211; floor(t));<\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div style=\"border-left: 1px solid #bfbfbf; border-right: 1px solid #bfbfbf; border-top: 0px none #212121; border-bottom: 0px none #212121; border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: #212121; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14px;\"><span style=\"white-space: pre;\"><span style=\"color: #0e00ff;\">if <\/span>(normT &gt;= 7) &amp;&amp; (normT &lt;= 11)<\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div style=\"border-left: 1px solid #bfbfbf; border-right: 1px solid #bfbfbf; border-top: 0px none #212121; border-bottom: 0px none #212121; border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: #212121; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14px;\"><span style=\"white-space: pre;\"> w = 1;<\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div style=\"border-left: 1px solid #bfbfbf; border-right: 1px solid #bfbfbf; border-top: 0px none #212121; border-bottom: 0px none #212121; border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: #212121; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14px;\"><span style=\"white-space: pre;\"><span style=\"color: #0e00ff;\">elseif <\/span>(normT &gt;= 12.5) &amp;&amp; (normT &lt;= 17.5)<\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div style=\"border-left: 1px solid #bfbfbf; border-right: 1px solid #bfbfbf; border-top: 0px none #212121; border-bottom: 0px none #212121; border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: #212121; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14px;\"><span style=\"white-space: pre;\"> w = 1;<\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div style=\"border-left: 1px solid #bfbfbf; border-right: 1px solid #bfbfbf; border-top: 0px none #212121; border-bottom: 0px none #212121; border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: #212121; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14px;\"><span style=\"white-space: pre;\"><span style=\"color: #0e00ff;\">elseif <\/span>(normT &gt;= 19) &amp;&amp; (normT &lt;= 21.5)<\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div style=\"border-left: 1px solid #bfbfbf; border-right: 1px solid #bfbfbf; border-top: 0px none #212121; border-bottom: 0px none #212121; border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: #212121; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14px;\"><span style=\"white-space: pre;\"> w = 1;<\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div style=\"border-left: 1px solid #bfbfbf; border-right: 1px solid #bfbfbf; border-top: 0px none #212121; border-bottom: 0px none #212121; border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: #212121; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14px;\"><span style=\"white-space: pre;\"><span style=\"color: #0e00ff;\">else<\/span><\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div style=\"border-left: 1px solid #bfbfbf; border-right: 1px solid #bfbfbf; border-top: 0px none #212121; border-bottom: 0px none #212121; border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: #212121; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14px;\"><span style=\"white-space: pre;\"> w = 0;<\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div style=\"border-left: 1px solid #bfbfbf; border-right: 1px solid #bfbfbf; border-top: 0px none #212121; border-bottom: 0px none #212121; border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: #212121; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14px;\"><span style=\"white-space: pre;\"><span style=\"color: #0e00ff;\">end<\/span><\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div style=\"border-left: 1px solid #bfbfbf; border-right: 1px solid #bfbfbf; border-top: 0px none #212121; border-bottom: 1px solid #bfbfbf; border-radius: 0px 0px 4px 4px; padding: 0px 45px 4px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: #212121; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14px;\"><span style=\"white-space: pre;\"><span style=\"color: #0e00ff;\">end<\/span><\/span><\/div>\n<\/div>\n<\/div>\n<p><script type=\"text\/javascript\">var css = ''; var head = document.head || document.getElementsByTagName('head')[0], style = document.createElement('style'); head.appendChild(style); style.type = 'text\/css'; if (style.styleSheet){ style.styleSheet.cssText = css; } else { style.appendChild(document.createTextNode(css)); }<\/script><a href=\"https:\/\/blogs.mathworks.com\/student-lounge\/files\/2023\/10\/23Oct9.mlx\"><button class=\"btn btn-sm btn_color_blue pull-right add_margin_10\">Download Live Script<\/button><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"overview-image\"><img src=\"https:\/\/blogs.mathworks.com\/student-lounge\/files\/2023\/10\/23Oct9_2.png\" class=\"img-responsive attachment-post-thumbnail size-post-thumbnail wp-post-image\" alt=\"\" decoding=\"async\" loading=\"lazy\" \/><\/div>\n<p>Joining us today is Wesley Hamilton, who is a STEM Outreach Engineer here at MathWorks. Wesley will talk about SIMIODE&#8217;s SCUDEM competition. Wesley, over to you\u2026<br \/>\nOverview<br \/>\nThis blog post has&#8230; <a class=\"read-more\" href=\"https:\/\/blogs.mathworks.com\/student-lounge\/2023\/10\/09\/differential-equations-modeling-with-matlab-scudem\/\">read more >><\/a><\/p>\n","protected":false},"author":183,"featured_media":10346,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[487,6],"tags":[695],"_links":{"self":[{"href":"https:\/\/blogs.mathworks.com\/student-lounge\/wp-json\/wp\/v2\/posts\/10352"}],"collection":[{"href":"https:\/\/blogs.mathworks.com\/student-lounge\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.mathworks.com\/student-lounge\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/student-lounge\/wp-json\/wp\/v2\/users\/183"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/student-lounge\/wp-json\/wp\/v2\/comments?post=10352"}],"version-history":[{"count":11,"href":"https:\/\/blogs.mathworks.com\/student-lounge\/wp-json\/wp\/v2\/posts\/10352\/revisions"}],"predecessor-version":[{"id":10385,"href":"https:\/\/blogs.mathworks.com\/student-lounge\/wp-json\/wp\/v2\/posts\/10352\/revisions\/10385"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/student-lounge\/wp-json\/wp\/v2\/media\/10346"}],"wp:attachment":[{"href":"https:\/\/blogs.mathworks.com\/student-lounge\/wp-json\/wp\/v2\/media?parent=10352"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/student-lounge\/wp-json\/wp\/v2\/categories?post=10352"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/student-lounge\/wp-json\/wp\/v2\/tags?post=10352"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}