Thursday, October 9, 2025
HomeMatlabDifferential Equations Modeling with MATLAB – SCUDEM » Pupil Lounge

Differential Equations Modeling with MATLAB – SCUDEM » Pupil Lounge


Becoming a member of us immediately is Wesley Hamilton, who’s a STEM Outreach Engineer right here at MathWorks. Wesley will speak about SIMIODE’s SCUDEM competitors. Wesley, over to you…

Overview

This weblog put up has three objectives:

  1. Introduce SIMIODE’s SCUDEM competitors, which MathWorks now helps,
  2. Present how one would possibly begin growing a mannequin to deal with an actual world (SCUDEM) drawback, and
  3. Showcase the ODE fixing performance supplied by MATLAB.

We’ll be showcasing how a brand new group to SCUDEM, and math modeling, would possibly get began growing an answer to an issue. As such the mannequin received’t be notably refined, however the modeling course of employed can (and will) be replicated as a greater follow when competing.

SIMIODE and SCUDEM

The Systemic Initiative for Modeling Investigations and Alternatives with Differential Equations (SIMIODE) is a company that, as described on their web site, “is a Group of Follow targeted on a modeling first methodology of educating differential equations”. Since 2017, SIMIODE has organized the SIMIODE Problem Utilizing Differential Equations Modeling (SCUDEM). This annual competitors has groups decide one in all three issues, and develop a differential equation mannequin to reply their chosen drawback. This yr SCUDEM will run from October 20 to November 30, wherein time groups will develop their fashions and put together a brief youtube video describing their work. The SCUDEM web site has extra data on participating, together with registration data and issues and outcomes from earlier years.

This yr, MathWorks is happy to offer direct assist for SCUDEM by the use of licenses and preparatory supplies. Learn on for a few of these new preparatory supplies.

The issue

For this weblog put up, we’re going to sort out the 2022 SCUDEM drawback A, which ask groups to develop a mannequin that describes ISS astronauts’ stress when finishing duties and serving to/getting helped by ISS guests. Take a minute to learn by the issue assertion in its entirety by going to https://qubeshub.org/neighborhood/teams/scudem/wiki/SCUDEMVII2022, after which click on on “Downside Statements” beneath “Official Problem Issues for SCUDEM VII 2022”. A PDF with all three of the 2022 drawback statements will probably be downloaded.

Earlier than establishing a mannequin, we have to have a strong grasp of the particular drawback we’re being requested to deal with. Right here, let’s stroll by the issue assertion paragraph by paragraph and select key items that may assist us specify what precisely we’re constructing a mannequin for.

A gaggle of people lately bought a flight to go to the Worldwide Area Station [1]. Every of them needed to full a rigorous coaching regime and exhibit that they have been able to dealing with the bodily and psychological calls for of area journey. After they arrived, they have been anticipated to offer assist and help to the astronauts who have been on the station and the brand new crew members had numerous duties and experiments to finish.

Within the mannequin we develop, we’re going to specify two totally different teams of individuals that will behave (and be modeled) in another way. For the reason that ISS has a smaller variety of crew, we now have two choices to discover:

  1. observe a extra agent-based mannequin method, the place we maintain monitor of particular person astronauts and guests, or
  2. deal with the astronauts and guests as single entities, in order that we’re modeling e.g. the collective stress of the astronauts and never people’ stress.

Both method can work, and each approaches will not be troublesome to implement in MATLAB. Let’s learn on to see what different data would possibly inform which of those choices we’ll decide.

The hectic schedule almost overwhelmed the newly arrived visitors, and the additional consideration they required added to the stress felt by the prevailing crew. What could be performed to ease this burden, but end in a extra environment friendly use of time for a flight crew? Earlier than answering this query, a method to mannequin the stress and capabilities of a flight crew should be created.

A key piece of data is that “stress” and “capabilities” are explicitly talked about. At this level, these will be the two portions we construct a mannequin round for every group or every astronaut/customer. Furthermore, the particular point out that the guests added to the stress of the astronauts is vital – after we check our mannequin, we might need to run a simulation with out guests to substantiate that the stress of the astronauts is steady (in some capability), because the supplied data means that the guests probably threw issues out of stability.

Develop a mathematical mannequin of the stress and capabilities of a bunch of individuals. Assume that there’s an current group of individuals in place on the vacation spot who’re already beneath a substantial amount of strain to finish their assigned duties. The mannequin ought to embody the addition of a second group of succesful individuals who arrive after present process the stress of an area launch and wouldn’t have prior publicity to the brand new atmosphere. Given the anticipated stress ranges over time what’s the affect on the entire group?

This paragraph has the principle activity: Develop a mathematical mannequin of the stress and capabilities of a bunch of individuals. As above, we’re nonetheless specializing in stress and functionality as the 2 numeric portions to make use of, and the particular point out of a group of individuals suggests it’s not out-of-line to deal with all astronauts as a single entity (the group of astronatus), and similar with the guests. In any other case, we’re being requested to say one thing about stress ranges over time – if ultimately we don’t need to maintain monitor of each stress and capabilities, then we must always positively maintain stress as the principle quantitative object we work with.

Your mannequin ought to be capable to take a schedule for the entire group after which predict the affect on the group of individuals. It’s best to determine what occurs beneath totally different situations together with the expectation of a right away excessive stage of productiveness, a brief interval of relaxation adopted by a pointy rise in a excessive stage of productiveness, after which a gradual enhance from low to excessive ranges of productiveness. Which state of affairs ends in the bottom stress and highest web productiveness? Additionally, what ought to floor observers count on from small deviations from a given schedule?

Right here we’re given just a few extra particular necessities to incorporate:

  1. incorporate a schedule for the astronauts and guests,
  2. incorporate totally different ranges of productiveness for all onboard,
  3. incorporate (small) deviations within the schedule.

All of this ought to be integrated to say one thing in regards to the long-term stress of everybody onboard.

So to summarize (a few of) what we’ve picked out of the issue assertion:

  • mannequin the stress and capabilities for astronauts and guests, and
  • incorporate a schedule with various quantities of productiveness every day.

Within the subsequent part, we’ll determine how we need to quantify every thing earlier than incorporating our preliminary mannequin in MATLAB.

An preliminary mannequin – plan

Fashions could be as advanced or so simple as one wishes. Right here, we’ll begin with growing a easy mannequin to showcase a viable method, which is able to hopefully give us some preliminary outcomes and pave the best way to a extra advanced, and descriptive of the state of affairs, mannequin.

To start out, let’s simply mannequin the stress of the astronauts and guests and incorporate capabilities by the mannequin parameters; afterward we might revisit this determination and look extra intently into how capabilities and stress work together. Thus, our capabilities of curiosity will probably be

  • $ s_a $ for the stress of astronauts, and
  • $ s_v $ for the stress of the guests,

and our system of differential equations will seem like

$ frac{ds_a}{dt} = … $

$ frac{ds_v}{dt} = … $

There are just a few methods we would mannequin the change in stress, and since we’re not skilled specialists within the psychology of stress, we’ll rely closely on assumptions to arrange our mannequin. Let’s begin by growing the mannequin for an astronaut’s stress, after which take a look at how a customer’s stress is integrated.

We’ll assume that the rise in stress is proportional to the quantity of labor being performed and the quantity of stress already amassed, and stress decreases whereas at relaxation at a price proportional to their present stress stage: for this we’ll want

  1. a continuing of proportionality for stress accumulation $ alpha_a $,
  2. a continuing of proportionality for stress decumulation $ beta_a $, and
  3. a operate detailing the quantity of labor an astronaut is doing $ W(t) $.

Because the astronaut is working ($ W(t)>0 $), their whole stress ought to enhance. When the astronaut is at relaxation ($ W(t)=0 $), their whole stress ought to lower. For our preliminary method let’s assume that astronauts work at a continuing price of $ W(t)=1 $ when on-duty. With this framework we will write

$ frac{d s_a}{dt} = alpha_a W(t) s_a(t) – beta_a s_a(t) (1 – W(t)) $.

Since there was nothing particular on this framework to astronauts, we’ll assume customer stress follows the identical mannequin (with their very own constants of proportionality:

$ frac{d s_v}{dt} = alpha_v W(t) s_v(t) – beta_v s_v(t) (1 – W(t)) $

In future variations of this mannequin, we might modify the work operate to be totally different for astronauts and guests, however for now we’ll keep on with this method.

Subsequent, we have to focus on the interplay of stress between astronauts and the guests. An preliminary assumption we’ll make is that an astronaut’s stress accumulation can also be proportional to the stress of the guests, and vise versa, so our equations turn into

$ frac{d s_a}{dt} = alpha_a W(t) s_a(t)s_v(t) – beta_a s_a(t) (1 – W(t)) $,

$ frac{d s_v}{dt} = alpha_v W(t) s_a(t)s_v(t) – beta_v s_v(t) (1 – W(t)) $.

As soon as we run simulations we will begin specifying the constants that make sense for our mannequin, however we do have to specify forward of the simulation, primarily based on astronauts’ precise schedules. For this, we will do a little analysis; this text suggests astronauts work from 6 am to 9.30 pm, with three meals and a pair of.5 hours of train. And not using a particular schedule to repeat, we’ll make the next assumption for the astronauts’ and guests’ schedule:
  • astronauts get up at 6 am however spend 60 minutes for breakfast/understanding/taking a break, so work begins at 7 am;
  • astronauts work for 4 hours till 11 am, after which take 90 minutes for lunch/understanding/taking a break, so work resumes at 12.30 pm;
  • astronauts work for five hours till 5.30 pm, earlier than taking one other 90 minutes for dinner/understanding/taking a break, till work resumes at 7 pm;
  • astronauts work for two hours till 9 pm earlier than taking a remaining 30 minute break, earlier than going to mattress at 9.30 pm.

This tough schedule embody the two.5 hours of train, in addition to one other 2 hours for assorted meals and breaks.

From the angle of our work operate $ W(t) $, utilizing a 24-hour clock, which means that

$ W(t) = 1 $ for $ 7leq tleq 11 $, $ 12.5leq tleq 17.5 $, $ 19leq tleq 21.5 $, and

$ W(t) = 0 $ in any other case.

All calculations ought to be performed modulo 24 since we need to monitor stress over just a few days.

Right here it’s value reiterating that this mannequin is sort of fundamental, and that’s okay! We’re making an attempt to determine a baseline mannequin earlier than we begin refining our assumptions and increasing our mannequin to extra precisely handle what the issue assertion is definitely asking for.

Subsequent, let’s implement our mannequin in MATLAB!

An preliminary mannequin – implementation in MATLAB

Let’s begin by implementing simply the mannequin for astronauts’ stress ranges. Our objective is to determine a baseline for our constants of proportionality, earlier than we incorporate the guests. Specifically, our expectation is that astronauts’ stress ranges ought to be steady over just a few days, so we have to specify constants that respect this expectation.

Since we need to simulate stress over time, we’ll be utilizing MATLAB, and specifically MATLAB’s ODE performance. With the discharge of MATLAB 2023b there may be some slick performance for establishing and fixing ODEs – our method follows this new performance as described in this latest weblog put up.

First, let’s encode the work operate. Due to the character of LiveScripts the precise operate is included on the finish of this put up, however the monospace that follows is a direct copy of that operate:

operate w = W(t)

normT = mod(flooring(t),24) + (t – flooring(t));

if (normT >= 7) && (normT <= 11)

w = 1;

elseif (normT >= 12.5) && (normT <= 17.5)

w = 1;

elseif (normT >= 19) && (normT <= 21)

w = 1;

else

w = 0;

finish

finish

Specifically, be aware that since we’re working our mannequin just a few days into the long run, we have to convert from the time that the mission began to a neighborhood 24-hour clock.

Subsequent, let’s incorporate the constants of proportionality utilizing sliders; the intention right here is to experiment to determine cheap values for the astronauts and their stress ranges:

Lastly, let’s write down the operate $ frac{ds_a}{dt} $ :

dsa = @(t,y) alphaA*y*W(t) – betaA*y*(1-W(t));

With these items in place, we will now resolve the ODE and see what the astronauts’ stress ranges over time is:

initF = ode(ODEFcn=dsa,InitialTime=7,InitialValue=initValA); % Arrange the issue by creating an ode object

sol = resolve(initF,7,100); % Remedy it over the interval [0,10]

plot(sol.Time,sol.Resolution,“-o”)

Subsequent, let’s incorporate the addition of the guests. To do that, we want the brand new set of constants of proportionality, in addition to a brand new operate describing the differential equation that may look much like what we had earlier than:

Right here we’re assuming that the guests get burdened extra simply ($ alpha_v > alpha_a $), and don’t destress as simply ($ beta_v < beta_a $). In any other case, our operate for the system of equations ought to now be a vector (the primary coordinate is the astronauts’ stress, and the second coordinate is the guests’ stress):

ds = @(t,y) [alphaA*y(1)*y(2)*W(t) – betaA*y(1)*(1-W(t)); alphaV*y(1)*y(2)*W(t) – betaV*y(2)*(1-W(t))];

F = ode(ODEFcn=ds,InitialTime=7,InitialValue=[initValA;initValV]); % Arrange the issue by creating an ode object

sol = resolve(F,7,100); % Remedy it over the interval [0,10]

plot(sol.Time,sol.Resolution,“-o”)

As above, the blue curve is the stress of astronauts, whereas the orange curve is the stress of the guests.

Attempt enjoying round with the parameters, and also you’ll see that it’s simple for, after the addition of holiday makers, stress ranges to blow uncontrolled. With that stated, we have been capable of finding a spread of parameters that recommend, at the least with these assumptions, the astronauts and guests are in a position to finally discover concord of their working circumstances.

Subsequent steps

To reiterate: it is a very, very fundamental, preliminary mannequin for human stress. Whereas we now have some preliminary outcomes from this mannequin which can be interpretable, there are a number of modifications we will do to make the mannequin much more descriptive and life like, together with, however not restricted to:

  • modifying the working operate $ W(t)% $ to include the working circumstances laid out in the issue assertion,
  • (probably) modifying the stress interactions for people, and never the cumulative group,
  • revisiting the preliminary mannequin for the adjustments in stress, probably including crew capabilities for performing work as one other operate,
  • and so forth.

Concerned about extra? Try a few of our different preparatory supplies for MATLAB and math modeling listed on the SCUDEM web site, in addition to different MathWorks blogs for extra concepts, suggestions, and tips on the way to successfully use MATLAB.

Capabilities

normT = mod(flooring(t),24) + (t – flooring(t));

if (normT >= 7) && (normT <= 11)

elseif (normT >= 12.5) && (normT <= 17.5)

elseif (normT >= 19) && (normT <= 21.5)



RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments