Замечание: Мы тоже будем пользоваться сокращением “LLM” (для “Large Language Models”).
В этой статье для Королевского института объединенных служб (RUSI), Алекс Вершинин обсуждает необходимость для Запада пересмотреть свою военную стратегию в отношении аттрициона в предвидении затяжных конфликтов. Статья противопоставляет аттриционную и маневренную войну, подчеркивая важность промышленной мощности, генерации сил и экономической устойчивости в победе в затяжных войнах.
Эта (полученная с помощью LLM) иерархическая диаграмма хорошо суммирует статью:
Примечание: Мы планируем использовать этот пост/статью в качестве ссылки в предстоящем посте/статье с соответствующей математической моделью (на основе Системной динамики.)
Структура поста:
Темы Табличное разбиение содержания.
Ментальная карта Структура содержания и связи концепций.
Суммарное изложение, идеи и рекомендации Основная помощь в понимании.
Модель системной динамики Как сделать данный наблюдения операциональными?
Темы
Вместо суммарного изложения рассмотрите эту таблицу тем:
тема
содержание
Введение
Статья начинается с подчеркивания необходимости для Запада подготовиться к аттриционной войне, контрастируя это с предпочтением коротких, решающих конфликтов.
Понимание Аттриционной Войны
Определяет аттриционную войну и подчеркивает ее отличия от маневренной войны, акцентируя важность промышленной мощности и способности заменять потери.
Экономическое Измерение
Обсуждает, как экономика и промышленные мощности играют ключевую роль в поддержании войны аттрициона, с примерами из Второй мировой войны.
Генерация Сил
Исследует, как различные военные доктрины и структуры, такие как НАТО и Советский Союз, влияют на способность генерировать и поддерживать силы в аттриционной войне.
Военное Измерение
Детализирует военные операции и стратегии, подходящие для аттриционной войны, включая важность ударов над маневрами и фазы таких конфликтов.
Современная Война
Исследует сложности современной войны, включая интеграцию различных систем и вызовы координации наступательных операций.
Последствия для Боевых Операций
Описывает, как аттриционная война влияет на глубинные удары и стратегическое поражение способности противника регенерировать боевую мощь.
Заключение
Резюмирует ключевые моменты о том, как вести и выигрывать аттриционную войну, подчеркивая важность стратегического терпения и тщательного планирования.
Ментальная карта
Вот ментальная карта показывает структуру статьи и суммирует связи между представленными концепциями:
Суммарное изложение, идеи и рекомендации
СУММАРНОЕ ИЗЛОЖЕНИЕ
Алекс Вершинин в “Искусстве аттриционной войны: Уроки войны России против Украины” для Королевского института объединенных служб обсуждает необходимость для Запада пересмотреть свою военную стратегию в отношении аттрициона в предвидении затяжных конфликтов. Статья противопоставляет аттриционную и маневренную войну, подчеркивая важность промышленной мощности, генерации сил и экономической устойчивости в победе в затяжных войнах.
ИДЕИ:
Аттриционные войны требуют уникальной стратегии, сосредоточенной на силе, а не на местности.
Западная военная стратегия традиционно отдает предпочтение быстрым, решающим битвам, не готова к затяжному аттриционному конфликту.
Войны аттрициона со временем выравнивают шансы между армиями с различными начальными возможностями.
Победа в аттриционных войнах больше зависит от экономической силы и промышленной мощности, чем от военного мастерства.
Интеграция гражданских товаров в военное производство облегчает быстрое вооружение в аттриционных войнах.
Западные экономики сталкиваются с трудностями в быстром масштабировании военного производства из-за мирного эффективности и аутсорсинга.
Аттриционная война требует массового и быстрого расширения армий, что требует изменения стратегий производства и обучения.
Эффективность военной доктрины НАТО ухудшается в аттриционной войне из-за времени, необходимого для замены опытных некомиссированных офицеров (NCOs).
Советская модель генерации сил, с ее массовыми резервами и офицерским управлением, более адаптируема к аттриционной войне.
Соединение профессиональных сил с массово мобилизованными войсками создает сбалансированную стратегию для аттриционной войны.
Современная война интегрирует сложные системы, требующие продвинутого планирования и координации, что затрудняет быстрые наступательные маневры.
Аттриционные стратегии сосредоточены на истощении способности противника регенерировать боевую мощь, защищая свою собственную.
Начальная фаза аттриционной войны подчеркивает удерживающие действия и наращивание боевой мощи, а не завоевание территории.
Наступательные операции в аттриционной войне следует откладывать до тех пор, пока резервы и промышленная мощность противника достаточно не истощены.
Глубинные удары по инфраструктуре и производственным возможностям противника имеют решающее значение в аттриционной войне.
Аттриционная война требует стратегического терпения и акцента на оборонительных операциях для подготовки к будущим наступлениям.
Ожидание Запада коротких, решающих конфликтов не соответствует реальности потенциальных аттриционных войн с равными противниками.
Признание важности экономических стратегий и промышленной мобилизации ключево для подготовки к и выигрышу затяжного конфликта.
Информационные операции могут манипулировать движениями и распределением ресурсов противника в свою выгоду в аттриционной войне.
ЦИТАТЫ:
“Аттриционные войны требуют своего ‘Искусства войны’ и ведутся с ‘подходом, сосредоточенным на силе’.”
“Та сторона, которая принимает аттриционный характер войны и сосредотачивается на уничтожении вражеских сил, а не на завоевании территории, скорее всего, победит.”
“Войны аттрициона выигрываются экономиками, позволяющими массовую мобилизацию армий через их промышленные сектора.”
“Проще и быстрее производить большое количество дешевого оружия и боеприпасов, особенно если их подкомпоненты взаимозаменяемы с гражданскими товарами.”
“Эффективность военной доктрины НАТО ухудшается в аттриционной войне
Модель системной динамики
В этом разделе мы показываем модель системной динамики, полученную с помощью запроса:
Сгенерируйте модель системной динамики для войны на истощение, описанной в следующей статье:
Описание модели, полученное с помощью LLM, имеет смысл, но для получения соответствующей рабочей модели требуются дополнительные запросы к LLM и/или (математическое) программирование и моделирование.
Результат LLM представлен ниже.
Разработка модели системной динамики для войны на истощение, описанной в предоставленном тексте, включает создание структуры, которая улавливает ключевые динамики истощения, генерации сил, экономической поддержки и влияния промышленной мощности на ведение войны. Эта модель будет сосредоточена на взаимодействиях между этими элементами для понимания долгосрочных результатов войны на истощение, особенно в контексте российской войны на Украине, как обсуждаетс
Компоненты модели системной динамики:
Запасы: Это накопления в системе, которые изменяются со временем. Для модели войны на истощение актуальные запасы могут включать:
Военный персонал: Сюда входят как высококвалифицированные профессиональные солдаты, так и мобилизованные или призванные военнослужащие низкого уровня.
Промышленная мощность: Способность производить военное оборудование, которое может быть разделено на высокотехнологичные сложные системы и массово производимые предметы низкого уровня.
Экономические ресурсы: Это финансовые и материальные ресурсы, доступные для поддержки военного производства и операций.
Боевая мощь: Общая эффективность и сила военных сил, на которую влияют как количество, так и качество сил и оборудования.
Потоки: Это скорости, которые изменяют запасы, представляя процессы внутри системы.
Набор и обучение: Добавление личного состава к запасу военного персонала.
Скорость истощения: Уменьшение военного персонала через боевые потери.
Скорость производства: Скорость, с которой промышленная мощность производит военное оборудование.
Распределение ресурсов: Поток экономических ресурсов в военное производство и операции.
Петли обратной связи: Эти петли помогают понять, как разные части системы влияют друг на друга, усиливая или уравновешивая динамику системы.
Усиливающая петля (R1): Увеличение промышленной мощности приводит к большему количеству военного оборудования, что повышает боевую мощь, потенциально приводя к военному успеху, который оправдывает дальнейшие инвестиции в промышленную мощность.
Уравновешивающая петля (B1): Высокие скорости истощения сокращают военный персонал, снижая боевую мощь, что может привести к переоценке военных стратегий и потенциальному сокращению агрессивных операций для сохранения сил.
Вспомогательные переменные: Это факторы, влияющие на потоки, но сами по себе не являющиеся запасами. Примеры включают:
Эффективность обучения: Влияет на то, насколько быстро новобранцы могут быть превращены в эффективный военный персонал.
Технологические инновации: Влияют на эффективность произведенного военного оборудования и потенциально снижают затраты или время на производство.
Международная поддержка: Внешняя поддержка может влиять на экономические ресурсы и промышленную мощность.
Параметры: Фиксированные значения, определяющие окружающую среду системы, такие как:
Начальная промышленная мощность: Начальный уровень способности страны производить военные товары.
Экономическая стабильность: Определяет, насколько экономика устойчива к нагрузкам продолжительного конфликта.
Процесс моделирования:
Инициализация: Установка начальных значений для запасов на основе исторических данных или оценок (например, промышленная мощность до войны, начальный уровень военного персонала).
Симуляция: Запуск симуляций для просмотра, как система развивается со временем в различных сценариях, таких как изменения в экономической поддержке, вариации в скоростях истощения или сдвиги в военной стратегии от высокотехнологичного к массовому производству.
Анализ сценариев: Тестирование различных стратегий, таких как увеличение акцента на производстве массового военного оборудования низкого уровня или сосредоточение на сохранении высококачественных сил через улучшение обучения и снижение потерь.
Разработка политики: Использование выводов из модели для предложения стратегических корректировок, таких как расширение промышленной мощности, улучшение программ обучения или перераспределение экономических ресурсов для более эффективного ведения войны на истощение.
Эта модель системной динамики предоставляет структурированный способ анализа сложных взаимодействий в войне на истощение, помогая стратегам и политикам понимать долгосрочные последствия различных военных и экономических стратегий.
Диаграмма модели системной динамики
Вот диаграмма описания модели, указанной выше:
Примечание: Приведенная выше диаграмма не представляет собой модель системной динамики как таковую. Она представляет концептуальные связи такой модели. В предстоящей статье мы планируем представить фактическую модель системной динамики с соответствующим описанием, диаграммами, уравнениями и результатами симуляции.
Remark: The content of this notebook is intentionally theoretically fundamental, but short and simple both mathematically and code-wise. Author’s intent is to develop similar computational workflows for (1) field battles, like the Normandy campaign during Word War II, 1944, or (2) urban warfare, like Second Battle of Fallujah, Iraq 2009, or Battle of Bakhmut, Ukraine 2023.
The examples below use the Battle of Iwo Jima because that is convenient both data-wise and mathematics-wise. Here are our reasons:
The battle is important for the USA military, hence well documented and used in multiple contexts.
See, for example, mathematical articles like [JE1] and [RS1].
(Relatively) well curated data can be found. Like:
Sizes of the military forces
Battle duration
There is no need to:
Take care of negative stocks
Simulate “will to fight” — Japanese soldiers fought to the last one
Japanese Prisoners Of War (POWs) became POWs because they were found unconscious…
Here is the invasion map of Iwo Jima, prepared in February 1945, [DR1]:
Document structure
Generalized model and variants Main theory.
SDMon Model Programmer’s version.
Direct model simulation Using the Battle of Iwo Jima data and related pre-computed rates.
Calibration We can get the theoretically computed rates by using numerics!
Future plans Make models, not war.
Generalized models
This section presents a translation to English of introductory paragraphs of [NM1]. (The same general model and breakdown is presented in [AS1].)
In the most general form, the Lanchester models can be described by the by the equation:
where:
$a$ and $e$ define the rate of non-combat losses
$b$ and $f$ define the rate of losses due to exposure to area targets
$c$ and $g$ are losses due to forward enemy exposure
$d$ and $h$ are approaching or retreating reserves
To determine the casualties of wars, actual or potential, the following four models are of greatest importance.
1.Lanchester proper model (only the coefficients $b$ and $f$ are available)
In this case:
The number of casualties is proportional to the number of encounters between individuals.
The number of encounters between individuals of the opposing sides is proportional to the number of victims.
The number of victims is proportional to the number of encounters between individuals of the opposing parties.
Product of the number of parties: $x \times y$.
This interaction is most relevant when the two sides are located in a common territory:
Guerrilla warfare, repression, enmity between two ethnic groups, etc.
2.Osipov model (coefficients $a$ and $e$)
The number of victims is proportional to the number of the opposing side.
This could be a classic military engagement where the two sides are in contact only on the front lines.
3.Peterson model (coefficients $a$ and $e$)
The number of casualties is determined by the size of one’s side.
This could be a model of the Cold War, where the more of their submarines are on alert, the more of them die.
4.Brackney model (coefficients $a$ and $f$ or $b$ and $e$)
The casualties of one side is proportional to the number of encounters and the other to the number of its opponent.
The model was inspired of the Vietnam War and describes quite satisfactory.
I.e. a conflict in which one side is engaged in classical warfare and the other in guerrilla warfare.
Model “rigidness”
The simplest, with Osipov terms only, generalized Lanchester model is:
That model is a “rigid model” that admits an exact solution. (See Arnold’s book “«Rigid» and «soft» mathematical models”, [VA1].)
Here is the solution:
The evolution of the number of soldiers of armies $x$ and $y$ occurs along the hyperbola given by the equation $a x(t) ^2- b y(t)^2\text{==}\text{const}.$ The war evolves along that hyperbola, hence it depends on the starting point.
The corresponding manifold of hyperbolas is separated by the line $a x = b y$. If the starting point lies above this line, then the hyperbola finishes on the $y$-axis. This means that in the course of the war army $x$ decreases to zero and army $y$ wins.
Remark: Note that if the efficiency coefficients $a$ and $b$ are not constant then the equation $a x = b y$ determines a curve.
Here is an interactive interface that illustrates the properties of the simplest model:
In this section we define the general model in a simple programmaticform using the paclet “MonadicSystemDynamics”, [AAp2].
Remark: A better programmatic form would have equation elements that prevent (army) stocks to become negative.
Remark: Compared to the previous section, below we follow “wordier” but self-explanatory notation that helps model understanding, evaluation, and enhancements.
Here are the stocks:
aStocks = <| X[t] -> "Soldiers of army X", Y[t] -> "Soldiers of army Y" |>;
Here are the rates:
aRates = <|
fireEfficiencyX -> "Efficiency of force X ",
fireEfficiencyY -> "Efficiency of force Y",
fireEfficiencyXonY -> "Efficiency of force X on Y",
fireEfficiencyYonX -> "Efficiency of force Y on X",
growthX -> "Growth rate of force X due to new recruits",
growthY -> "Growth rate of force Y due to new recruits",
diseaseX -> "Disease rate in force X",
diseaseY -> "Disease rate in force Y",
fireFriendlyX -> "Friendly fire rate in force X",
fireFriendlyY -> "Friendly fire rate in force Y"
|>;
Here are rules that assign concrete values to the rates:
In this section we show that using optimization methods — calibration — we can obtain the same efficiency rates as the ones theoretically computed in [JE1] using the same data.
Remark: This should bring some confidence in using SDMon; and since the calibration process is easy to specify, it should encourage SDMon’s use for other SD models.
Remark: Proper calibration time series for the USA soldiers stock $X$ can be obtained from the web page “Iwo Jima, a look back”. (The corresponding data ingestion notebook is going to be published soon.)
Future plans
Here are a few directions to extend this work into:
Inclusion of different types of forces
Simulation of “will to fight”
Easy with NDSolve and, hence, with SDMon.
Inclusion of weapon and ammunition production stocks and related supply rates
For example, as in [AA2].
Modeling the war impact on countries’ economics and populations
Modeling the role of propaganda
Make interactive interfaces with knobs for the parameters
With selectors of scenarios based on known battles.
[AS1] Andrei Shatyrko, Bedrik Puzha, Veronika Novotná, “Comparative Analysis and New Field of Application Lanchester’s Combat Models”, (2018), Post-conference proceedings of selected papers extended version Conference MITAV-2018, Brno, Czech Republic, 2018. P.118-133. ISBN 978-80-7582-065-5.
[JE1] J.H. Engel, “A verification of Lanchester’s law”, (1953), Journal of the Operations Research Society of America, Vol. 2, No. 2. (May, 1954), pp. 163-171. (JSTOR link.)
[VA1] Vladimir I. Arnold, Rigid and soft mathematical models, 2nd ed. (2008), Moscow Center of Continuous Mathematical Education. In Russian: Владимир И. Арнольд, “«Жесткие» и «мягкие» математические модели”, (2008), М.: МЦНМО, 2014, 32 с. ISBN 978-5-94057-427-9.
Two weeks ago (June 1st and 2nd) I participated in the Wolfram Language conference in St. Petersburg, Russia.
Here are the corresponding announcements:
Interestingly, I first prepared a Latent Semantic Analysis (LSA) talk, but then found out that the organizers listed another talk I discussed with them, on extending dynamic systems models. (The latter one is the first we discussed, so, it was my “fault” that I wanted to talk about LSA.)
Here are the presentation notebooks for LSA in English and Russian .
Some afterthoughts
Тhe conference was very “strong”, my presentation was the “weakest.”
With “strong” I refer to the content and style of the presentations.
This was also the first scientific presentation I gave in Russian. I also got a participation diploma .
I prepared the initial models of artillery shells manufacturing, but much more work has to be done in order to have a meaningful article or presentation. (Hopefully, I am finishing that soon.)
In this document we give usage examples for the functions of the package, “SystemDynamicsModelGraph.m”, [AAp1]. The package provides functions for making dependency graphs for the stocks in System Dynamics (SD) models. The primary motivation for creating the functions in this package is to have the ability to introspect, proofread, and verify the (typical) ODE models made in SD.
A more detailed explanation is:
For a given SD system S of Ordinary Differential Equations (ODEs) we make Mathematica graph objects that represent the interaction of variable dependent functions in S.
Those graph objects give alternative (and hopefully convenient) way of visualizing the model of S.
Load packages
The following commands load the packages [AAp1, AAp2, AAp3]:
When the second argument given to ModelDependencyGraph is Automatic the stocks in the equations are heuristically found with the function ModelHeuristicStocks:
“SEI2HR” stands for “Susceptible, Exposed, Infected two, Hospitalized, Recovered” (populations.) “Econ” stands for “Economic”.
In this notebook we also deal with both quarantine scenarios and medical supplies scenarios. In the notebook [AA4] we deal with quarantine scenarios over a simpler model, SEI2HR.
Remark: We consider the contagious disease propagation models as instances of the more general System Dynamics (SD) models. We use SD terminology in this notebook.
The models
SEI2R
The model SEI2R is introduced and explained in the notebook [AA2]. SEI2R differs from the classical SEIR model, [Wk1, HH1], with the following elements:
Two separate infected populations: one is “severely symptomatic”, the other is “normally symptomatic”
The monetary equivalent of lost productivity due to infected or died people is tracked
SEI2HR
For the formulation of SEI2HR we use a system of Differential Algebraic Equations (DAE’s). The package [AAp1] allows the use of a formulation that has just Ordinary Differential Equations (ODE’s).
Here are the unique features of SEI2HR:
People stocks
There are two types of infected populations: normally symptomatic and severely symptomatic.
There is a hospitalized population.
There is a deceased from infection population.
Hospital beds
Hospital beds are a limited resource that determines the number of hospitalized people.
Only severely symptomatic people are hospitalized according to the available hospital beds.
The hospital beds stock is not assumed constant, it has its own change rate.
Money stocks
The money from lost productivity is tracked.
The money for hospital services is tracked.
SEI2HR-Econ
SEI2HR-Econ adds the following features to SEI2HR:
Medical supplies
Medical supplies production is part of the model.
Medical supplies delivery is part of the model..
Medical supplies accumulation at hospitals is taken into account.
Medical supplies demand tracking.
Hospitalization
Severely symptomatic people are hospitalized according to two limited resources: hospital beds and medical supplies.
Money stocks
Money for medical supplies production is tracked.
SEI2HR-Econ’s place a development plan
This graph shows the “big picture” of the model development plan undertaken in [AAr1] and SEI2HR (discussed in this notebook) is in that graph:
Notebook structure
The rest of notebook has the following sequence of sections:
Package load section
SEI2HR-Econ structure in comparison of SEI2HR
Explanations of the equations of SEI2HR-Econ
Quarantine scenario modeling preparation
Medical supplies production and delivery scenario modeling preparation
Parameters and initial conditions setup
Populations, hospital beds, quarantine scenarios, medical supplies scenarios
Simulation solutions
Interactive interface
Sensitivity analysis
Load packages
The epidemiological models framework used in this notebook is implemented with the packages [AAp1-AAp4, AA3]; many of the plot functions are from the package [AAp5].
In this section we provide rationale for the equations of SEI2HR-Econ.
The equations for Susceptible, Exposed, Infected, Recovered populations of SEI2R are “standard” and explanations about them are found in [WK1, HH1]. For SEI2HR those equations change because of the stocks Hospitalized Population and Hospital Beds. For SEI2HR-Econ the SEI2HR equations change because of the stocks Medical Supplies, Medical Supplies Demand, and Hospital Medical Supplies.
The equations time unit is one day. The time horizon is one year. Since we target COVID-19, [Wk2, AA1], we do not consider births.
Remark: For convenient reading the equations in this section have tooltips for the involved stocks and rates.
Verbalization description of the model
We start with one infected (normally symptomatic) person, the rest of the people are susceptible. The infected people meet other people directly or get in contact with them indirectly. (Say, susceptible people touch things touched by infected.) For each susceptible person there is a probability to get the decease. The decease has an incubation period: before becoming infected the susceptible are (merely) exposed. The infected recover after a certain average infection period or die. A certain fraction of the infected become severely symptomatic. The severely symptomatic infected are hospitalized if there are enough hospital beds and enough medical supplies. The hospitalized severely infected have different death rate than the non-hospitalized ones. The number of hospital beds might change: hospitals are extended, new hospitals are build, or there are not enough medical personnel or supplies.
The different types of populations (infected, hospitalized, recovered, etc.) have their own consumption rates of medical supplies. The medical supplies are produced with a certain rate (units per day) and delivered after a certain delay period. The hospitals have their own storage for medical supplies. Medical supplies are delivered to the hospitals only, non-hospitalized people go to the medical supplies producer to buy supplies. The hospitals have precedence for the medical supplies: if the medical supplies are not enough for everyone, the hospital needs are covered first (as much as possible.)
The medical supplies producer has a certain storage capacity (for supplies.) The medical supplies delivery vehicles have a certain – generally speaking, smaller – capacity. The hospitals have a certain capacity to store medical supplies. It is assumed that both producer and hospitals have initial stocks of medical supplies. (Following a certain normal, general preparedness protocol.)
The combined demand from all populations for medical supplies is tracked (accumulated.) The deaths from infection are tracked (accumulated.) Money for medical supplies production, money for hospital services, and money from lost productivity are tracked (accumulated.)
The equations below give mathematical interpretation of the model description above.
Code for the equations
Each equation in this section are derived with code like this:
and then the output cell is edited to be “DisplayFormula” and have CellLabel value corresponding to the stock of interest.
The infected and hospitalized populations
SEI2HR has two types of infected populations: a normally symptomatic one and a severely symptomatic one. A major assumption for SEI2HR is that only the severely symptomatic people are hospitalized. (That assumption is also reflected in the diagram in the introduction.)
Each of those three populations have their own contact rates and mortality rates.
Here are the contact rates from the SEI2HR-Econ dictionary
Remark: Below with “Infected Population” we mean both stocks Infected Normally Symptomatic Population (INSP) and Infected Severely Symptomatic Population (ISSP).
Total Population
In this notebook we consider a DAE’s formulation of SEI2HR-Econ. The stock Total Population has the following (obvious) algebraic equation:
0z7878rbvh3ut
Note that with Max we specified that the total population cannot be less than .
Remark: As mentioned in the introduction, the package [AAp1] allows for the use of non-algebraic formulation, without an equation for TP.
Susceptible Population
The stock Susceptible Population (SP) is decreased by (1) infections derived from stocks Infected Populations and Hospitalized Population (HP), and (2) morality cases derived with the typical mortality rate.
1gercwr5szizt
Because we hospitalize the severely infected people only instead of the term
09xmdu8xq7e0p
we have the terms
0dkc6td55qv7p
The first term is for the infections derived from the hospitalized population. The second term for the infections derived from people who are infected severely symptomatic and not hospitalized.
Births term
Note that we do not consider in this notebook births, but the births term can be included in SP’s equation:
The births rate is the same as the death rate, but it can be programmatically changed. (See [AAp2].)
Exposed Population
The stock Exposed Population (EP) is increased by (1) infections derived from the stocks Infected Populations and Hospitalized Population, and (2) mortality cases derived with the typical mortality rate. EP is decreased by (1) the people who after a certain average incubation period (aincp) become ill, and (2) mortality cases derived with the typical mortality rate.
083x1htqp0kkx
Infected Normally Symptomatic Population
INSP is increased by a fraction of the people who have been exposed. That fraction is derived with the parameter severely symptomatic population fraction (sspf). INSP is decreased by (1) the people who recover after a certain average infection period (aip), and (2) the normally symptomatic people who die from the disease.
01cfzpu1jv3o4
Infected Severely Symptomatic Population
ISSP is increased by a fraction of the people who have been exposed. That fraction is corresponds to the parameter severely symptomatic population fraction (sspf). ISSP is decreased by (1) the people who recover after a certain average infection period (aip), (2) the hospitalized severely symptomatic people who die from the disease, and (3) the non-hospitalized severely symptomatic people who die from the disease.
0zhs2d6lt6gz8
Note that we do not assume that severely symptomatic people recover faster if they are hospitalized, only that they have a different death rate.
Hospitalized Population
The amount of people that can be hospitalized is determined by the available Hospital Beds (HB) – the stock Hospitalized Population (HP) is subject to a resource limitation by the stock HB.
The equation of the stock HP can be easily understood from the following dynamics description points:
If the number of hospitalized people is less that the number of hospital beds we hospitalize the new ISSP people.
The Available Hospital Beds (AHB) are determined by the minimum of (i) the non-occupied hospital beds, and (ii) the hospital medical supplies divided by the ISSP consumption rate.
If the new ISSP people are more than AHB the hospital takes as many as AHB.
Hospitalized people have the same average infection period (aip).
Hospitalized (severely symptomatic) people have their own mortality rate.
Here is the HP equation:
1c35mhvi92ffe
Note that although we know that in a given day some hospital beds are going to be freed they are not considered in the hospitalization plans for that day. Similarly, we know that new medical supplies are coming but we do not include them into AHB.
Recovered Population
The stock Recovered Population (RP) is increased by the recovered infected people and decreased by mortality cases derived with the typical mortality rate.
04y15eqwki71f
Deceased Infected Population
The stock Deceased Infected Population (DIP) accumulates the deaths of the people who are infected. Note that we utilize the different death rates for HP and ISSP.
1ikrv4a51h9xo
Hospital Beds
The stock Hospital Beds (HB) can change with a rate that reflects the number of hospital beds change rate (nhbcr) per day. Generally speaking, using nhbcr we can capture scenarios, like, extending hospitals, building new hospitals, recruitment of new medical personnel, loss of medical personnel (due to infections.)
1is45mamhsayd
Hospital Medical Supplies
The Hospital Medical Supplies (HMS) are decreased according to the medical supplies consumption rate (mscr) of HP and increased by a Medical Supplies (MS) delivery term (to be described next.)
The MS delivery term is build with the following assumptions / postulates:
Every day the hospital attempts to order MS that correspond to HB multiplied by mscr.
The hospital has limited capacity of MS storage, .
The MS producer has limited capacity for delivery, .
The hospital demand for MS has precedence over the demands for the non-hospitalized populations.
Hence, if the MS producer has less stock of MS than the demand of the hospital then MS producer’s whole amount of MS goes to the hospital.
The supplies are delivered with some delay period: the medical supplies delivery period (msdp).
Here is the MS delivery term:
1uxby6ipa49dw
Here is the corresponding HMS equation:
0ri4ohdddjxle
Medical Supplies
The equation of the Medical Supplies (MS) stock is based on the following assumptions / postulates:
The non-hospitalized people go to the MS producer to buy supplies. (I.e. MS delivery is to the hospital only.)
The MS producer vehicles have certain capacity, .
The MS producer has a certain storage capacity (for MS stock.)
Each of the populations INSP, ISSP, and HP has its own specific medical supplies consumption rate (mscr). EP, RP, and TP have the same mscr.
The hospital has precedence in its MS order. I.e. the demand from the hospital is satisfied first, and then the demand of the rest of the populations.
Here is the MS delivery term described in the previous section:
1dy38wd13b0h6
Here is the MS formula with the MS delivery term replaced with “Dlvr”:
We can see from that equation that MS is increased by medical supplies production rate (mspr) with measuring dimension number of units per day. The production is restricted by the storage capacity, :
(*Min[mspr[HB], -MS[t] + \[Kappa][MS]]*)
MS is decreased by the MS delivery term and the demand from the non-hospitalized populations. Because the hospital has precedence, we use this term form in the equation:
(*Min[-Dlvr + MS[t], "non-hospital demand"]*)
Here is the full MS equation:
0xc7vujwb2npw
Medical Supplies Demand
The stock Medical Supplies Demand (MSD) simply accumulates the MS demand derived from population stocks and their corresponding mscr:
0ut8smszrobx2
Money for Hospital Services
The stock Money for Hospital Services (MHS) simply tracks expenses for hospitalized people. The parameter hospital services cost rate (hscr) with unit money per bed per day simply multiplies HP.
0evzoim1tjwsj
Money from Lost Productivity
The stock Money from Lost Productivity (MLP) simply tracks the work non-availability of the infected and died from infection people. The parameter lost productivity cost rate (lpcr) with unit money per person per day multiplies the total count of the infected and dead from infection.
1fhewr6izy46n
Quarantine scenarios
In order to model quarantine scenarios we use piecewise constant functions for the contact rates and .
Remark: Other functions can be used, like, functions derived through some statistical fitting.
Remark: We use the code in this section to do the computations in the section “Sensitivity Analysis”.
Interactive interface
Using the interface in this section we can interactively see the effects of changing parameters. (This interface is programmed without using parametrized NDSolve solutions in order to be have code that corresponds to the interface implementations in [AAr2].)
When making and using this kind of dynamics models it is important to see how the solutions react to changes of different parameters. For example, we should try to find answers to questions like “What ranges of which parameters bring dramatic changes into important stocks?”
Sensitivity Analysis (SA) is used to determine how sensitive is a SD model to changes of the parameters and to changes of model’s equations, [BC1]. More specifically, parameter sensitivity, which we apply below, allows us to see the changes of stocks dynamic behaviour for different sequences (and combinations) of parameter values.
Remark: This section to mirrors to a point the section with same name in [AA4], except in this notebook we are more interested in medical supplies related SA because quarantine related SA is done in [AA4].
Remark: SA shown below should be done for other stocks and rates. In order to keep this exposition short we focus on ISSP, DIP, and HP. Also, it is interesting to think in terms of “3D parameter sensitivity plots.” We also do such plots.
Evaluations by Area under the curve
For certain stocks we might be not just interested in their evolution in time but also in their cumulative values. I.e. we are interested in the so called Area Under the Curve (AUC) metric for those stocks.
There are three ways to calculate AUC for stocks of interest:
Add aggregation equations in the system of ODE’s. (Similar to the stock DIP in SEI2HR.)
For example, in order to compute AUC for ISSP we can add to SEI2HR the equation:
(*aucISSP'[t] = ISSP[t]*)
- More details for such equation addition are given in [AA2].
Apply NIntegrate over stocks solution functions.
Apply Trapezoidal rule to stock solution function values over a certain time grid.
Below we use 1 and 3.
Variation of medical supplies delivery period
Here we calculate the solutions for a certain combination of capacities and rates:
In order to demonstrate the effect of medical supplies production rate (mspr) it is beneficial to eliminate the hospital beds availability restriction – we assume that we have enough hospital beds for all infected severely symptomatic people.
Here we calculate the solutions for a certain combination of capacities and rates:
[HH1] Herbert W. Hethcote (2000). “The Mathematics of Infectious Diseases”. SIAM Review. 42 (4): 599–653. Bibcode:2000SIAMR..42..599H. doi:10.1137/s0036144500371907.
“SEI2HR” stands for “Susceptible, Exposed, Infected two, Hospitalized, Recovered” (populations.)
In this notebook we also deal with quarantine scenarios.
Remark: We consider the contagious disease propagation models as instances of the more general System Dynamics (SD) models. We use SD terminology in this notebook.
The models
SEI2R
The model SEI2R are introduced and explained in the notebook [AA2]. SEI2R differs from the classical SEIR model , [Wk1, HH1], with the following elements:
Two separate infected populations: one is “severely symptomatic”, the other is “normally symptomatic”
The monetary equivalent of lost productivity due to infected or died people is tracked.
SEI2HR
For the formulation of SEI2HR we use a system of Differential Algebraic Equations (DAE’s). The package [AAp1] allows the use of a formulation that has just Ordinary Differential Equations (ODE’s).
Here are the unique features of SEI2HR:
People stocks
Two types of infected populations: normally symptomatic and severely symptomatic
Hospitalized population
Deceased from infection population
Hospital beds
Hospital beds are a limited resource that determines the number of hospitalized people
Only severely symptomatic people are hospitalized according to the available hospital beds
The hospital beds stock is not assumed constant, it has its own change rate.
Money stocks
The money from lost productivity are tracked
The money for hospital services are tracked
SEI2HR’s place a development plan
This graph shows the “big picture” of the model development plan undertaken in [AAr1] and SEI2HR (discussed in this notebook) is in that graph:
1cg8j8gglqwi1
Notebook structure
The rest of notebook has the following sequence of sections:
Package load section
SEI2HR structure in comparison of SEI2R
Explanations of the equations of SEI2HR
Quarantine scenario modeling preparation
Parameters and initial conditions setup
Populations, hospital beds, quarantine scenarios
Parametric simulation solution
Interactive interface
Sensitivity analysis
Load packages
The epidemiological models framework used in this notebook is implemented with the packages [AAp1, AAp2, AA3]; many of the plot functions are from the package [AAp4].
In this section we provide rationale of the model equations of SEI2HR.
The equations for Susceptible, Exposed, Infected, Recovered populations of SEI2R are “standard” and explanations about them are found in [WK1, HH1]. For SEI2HR those equations change because of the stocks Hospitalized Population and Hospital Beds.
The equations time unit is one day. The time horizon is one year. Since we target COVID-19, [Wk2, AA1], we do not consider births.
Remark: For convenient reading the equations in this section have tooltips for the involved stocks and rates.
Verbalization description of the model
We start with one infected (normally symptomatic) person, the rest of the people are susceptible. The infected people meet other people directly or get in contact with them indirectly. (Say, susceptible people touch things touched by infected.) For each susceptible person there is a probability to get the decease. The decease has an incubation period: before becoming infected the susceptible are (merely) exposed. The infected recover after a certain average infection period or die. A certain fraction of the infected become severely symptomatic. If there are enough hospital beds the severely symptomatic infected are hospitalized. The hospitalized severely infected have different death rate than the non-hospitalized ones. The number of hospital beds might change: hospitals are extended, new hospitals are build, or there are not enough medical personnel or supplies. The deaths from infection are tracked (accumulated.) Money for hospital services and money from lost productivity are tracked (accumulated.)
The equations below give mathematical interpretation of the model description above.
Code for the equations
Each equation in this section are derived with code like this:
and then the output cell is edited to be “DisplayFormula” and have CellLabel value corresponding to the stock of interest.
The infected and hospitalized populations
SEI2HR has two types of infected populations: a normally symptomatic one and a severely symptomatic one. A major assumption for SEI2HR is that only the severely symptomatic people are hospitalized. (That assumption is also reflected in the diagram in the introduction.)
Each of those three populations have their own contact rates and mortality rates.
Here are the contact rates from the SEI2HR dictionary
Remark: Below with “Infected Population” we mean both stocks Infected Normally Symptomatic Population (INSP) and Infected Severely Symptomatic Population (ISSP).
Total Population
In this notebook we consider a DAE’s formulation of SEI2HR. The stock Total Population has the following (obvious) algebraic equation:
0peb290e1lx2d
Note that with Max we specified that the total population cannot be less than .
Remark: As mentioned in the introduction, the package [AAp1] allows for the use of non-algebraic formulation, without an equation for TP.
Susceptible Population
The stock Susceptible Population (SP) is decreased by (1) infections derived from stocks Infected Populations and Hospitalized Population (HP), and (2) morality cases derived with the typical mortality rate.
0h1zwgod2xs4g
Because we hospitalize the severely infected people only instead of the term
09xmdu8xq7e0p
we have the terms
0dkc6td55qv7p
The first term is for the infections derived from the hospitalized population. The second term for the infections derived from people who are infected severely symptomatic and not hospitalized.
Births term
Note that we do not consider in this notebook births, but the births term can be included in SP’s equation:
The births rate is the same as the death rate, but it can be programmatically changed. (See [AAp2].)
Exposed Population
The stock Exposed Population (EP) is increased by (1) infections derived from the stocks Infected Populations and Hospitalized Population, and (2) mortality cases derived with the typical mortality rate. EP is decreased by (1) the people who after a certain average incubation period (aincp) become ill, and (2) mortality cases derived with the typical mortality rate.
0mrj0gt13ppsn
Infected Normally Symptomatic Population
INSP is increased by a fraction of the people who have been exposed. That fraction is derived with the parameter severely symptomatic population fraction (sspf). INSP is decreased by (1) the people who recover after a certain average infection period (aip), and (2) the normally symptomatic people who die from the disease.
0hy96yb7pg654
Infected Severely Symptomatic Population
ISSP is increased by a fraction of the people who have been exposed. That fraction is corresponds to the parameter severely symptomatic population fraction (sspf). ISSP is decreased by (1) the people who recover after a certain average infection period (aip), (2) the hospitalized severely symptomatic people who die from the disease, and (3) the non-hospitalized severely symptomatic people who die from the disease.
19hml5ravi0a8
Note that we do not assume that severely symptomatic people recover faster if they are hospitalized, only that they have a different death rate.
Hospitalized Population
The amount of people that can be hospitalized is determined by the available Hospital Beds (HB) – the stock Hospitalized Population (HP) is subject to a resource limitation by the stock HB.
The equation of the stock HP can be easily understood from the following dynamics description points:
If the number of hospitalized people is less that the number of hospital beds we hospitalize the new ISSP people.
If the new ISSP people are more than the Available Hospital Beds (AHB) we take as many as AHB.
Hospitalized people have the same average infection period (aip).
Hospitalized (severely symptomatic) people have their own mortality rate.
0ippnyp2hf90k
Note that although we know that in a given day some hospital beds are going to be freed they are not considered in the hospitalization plans for that day.
Recovered Population
The stock Recovered Population (RP) is increased by the recovered infected people and decreased by mortality cases derived with the typical mortality rate.
042iy3oy8o454
Deceased Infected Population
The stock Deceased Infected Population (DIP) accumulates the deaths of the people who are infected. Note that we utilize the different death rates for HP and ISSP.
1glekhgj1v0e7
Hospital Beds
The stock Hospital Beds (HB) can change with a rate that reflects the number of hospital beds change rate (nhbcr) per day. Generally speaking, using nhbcr we can capture scenarios, like, extending hospitals, building new hospitals, recruitment of new medical personnel, loss of medical personnel (due to infections.)
1is45mamhsayd
Money for Hospital Services
The stock Money for Hospital Services (MHS) simply tracks expenses for hospitalized people. The parameter hospital services cost rate (hscr) with unit money per bed per day simply multiplies HP.
0evzoim1tjwsj
Money from Lost Productivity
The stock Money from Lost Productivity (MLP) simply tracks the work non-availability of the infected and died from infection people. The parameter lost productivity cost rate (lpcr) with unit money per person per day multiplies the total count of the infected and dead from infection.
1133o7bm975sr
Quarantine scenarios
In order to model quarantine scenarios we use piecewise constant functions for the contact rates and .
Remark: Other functions can be used, like, functions derived through some statistical fitting.
When making and using this kind of dynamics models it is important to see how the solutions react to changes of different parameters. For example, we should try to find answers to questions like “What ranges of which parameters bring dramatic changes into important stocks?”
Sensitivity analysis is used to determine how sensitive is a SD model to changes of the parameters and to changes of model’s equations, [BC1]. More specifically, parameter sensitivity, which we apply below, allows us to see the changes of stocks dynamic behaviour for different sequences (and combinations) of parameter values.
Remark: The sensitivity analysis shown below should be done for other stocks and rates. In order to keep this exposition short we focus on ISSP, DIP, and HP.
It is interesting to think in terms of “3D parameter sensitivity plots.” We also do such plots.
Evaluations by Area under the curve
For certain stocks we might be not just interested in their evolution in time but also in their cumulative values. I.e. we are interested in the so called Area Under the Curve (AUC) metric for those stocks.
There are three ways to calculate AUC for stocks of interest:
Add aggregation equations in the system of ODE’s. (Similar to the stock DIP in SEI2HR.)
For example, in order to compute AUC for ISSP we can add to SEI2HR the equation:
(*aucISSP'[t] = ISSP[t]*)
- More details for such equation addition are given in [AA2].
Apply NIntegrate over stocks solution functions.
Apply Trapezoidal rule to stock solution function values over a certain time grid.
Below we use 1 and 3.
Remark: The AUC measure for a stock is indicated with the prefix “∫”. For example AUC for ISSP is marked with “∫ISSP”.
Ranges
Below we use the following sets of quarantine starts and quarantine durations.
[HH1] Herbert W. Hethcote (2000). “The Mathematics of Infectious Diseases”. SIAM Review. 42 (4): 599–653. Bibcode:2000SIAMR..42..599H. doi:10.1137/s0036144500371907.
Last weekend – 2020-03-20 ÷ 2020-03-22 – I participated in the (Germany-centric) hackathon WirVsVirus. (I friend of mine who lives in Germany asked me to team up and sign up.)
Multiple people helped with the discussion of ideas, directions where to find data, with actual data gathering, and related documented analysis. Of course, just discussing the proposed solutions was already a great help!
What was accomplished
Work plans
The following mind-map reflects pretty well what was planned and done:
We considered a fair amount of other data. But because of the time limitations of the hackathon we had to use only the one above.
Single-site models
During the development phase I used the model SEI2R, but since we wanted to have a “geo-spatial-temporal epidemiological economics model” I productized the implementation of SEI2HR-Econ, [AAp1].
Here are the stocks, rates, and equations of SEI2HR-Econ:
Multi-site SEI2R (SEI2HR-Econ) over a hexagonal grid graph
I managed to follow through with a large part of the work plan for the hackathon and make multi-site scaled model that “follows the money”, [AA1]. Here is a diagram that shows the travelling patterns graph and solutions at one of the nodes:
Here is (a snapshot of) an interactive interface for studying and investigating the solution results:
For more details see the notebook [AA1]. Different parameters can be set in the “Parameters” section. Especially of interest are the quarantine related parameters: start, duration, effect on contact rates and traffic patterns.
I also put in that notebook code for exporting simulations results and programmed visualization routines in R, [AA2]. (In order other members of team to be able to explore the results.)
In this notebook we describe and exemplify an algorithm that allows the specification and execution geo-spatial-temporal simulations of infectious disease spreads. (Concrete implementations and examples are given.)
The assumptions of the typical compartmental epidemiological models do not apply for countries or cities that are non-uniformly populated. (For example, China, USA, Russia.) There is a need to derive epidemiological models that take into account the non-uniform distribution of populations and related traveling patterns within the area of interest.
Here is a visual aid (made with a random graph over the 30 largest cities of China):
1acjs15vamk0b
In this notebook we show how to extend core, single-site epidemiological models into larger models for making spatial-temporal simulations. In the explanations and examples we use SEI2R, [AA2, AAp1], as a core epidemiological model, but other models can be adopted if they adhere to the model data structure of the package “EpidemiologyModels.m”, [AAp1].
From our experiments with we believe that the proposed multi-site extension algorithm gives a modeling ingredient that is hard emulate by other means within single-site models.
Definitions
Single-site: A geographical location (city, neighbourhood, campus) for which the assumptions of the classical compartmental epidemiological models hold.
Single site epidemiological model: A compartmental epidemiological model for a single site. Such model has a system of Ordinary Differential Equations (ODE’s) and site dependent initial conditions.
Multi-site area: An area comprised of multiple single sites with known traveling patterns between them. The area has a directed graph with nodes that correspond to the sites and a positive matrix for the traveling patterns between the sites.
Problem definition: Given (i) a single site epidemiological model , (ii) a graph connecting multiple sites, and (iii) a traveling patterns matrix between the nodes of derive an epidemiological model that simulates more adequately viral decease propagation over .
Multi-Site Epidemiological Model Extension Algorithm (MSEMEA): An algorithm that derives from a given single site epidemiological model and multi-site area an epidemiological model that can be used to simulate the geo-spatial-temporal epidemics and infectious disease spreads. (The description of MSEMEA is the main message of this notebook.)
Load packages
The epidemiological models framework used in this notebook is implemented with the packages [AAp1, AAp2, AA3]; the interactive plots functions are from the package [AAp4].
The section “General algorithm description” gives rationale and conceptual steps of MSEMEA.
The next two sections of the notebook follow the procedure outline using the SEI2R model as , a simple graph with two nodes as , and both constant and time-dependent matrices for .
The section “Constant traveling patterns over a grid graph” presents an important test case with a grid graph that we use to test and build confidence in MSEMEA. The sub-section “Observations” is especially of interest.
The section “Time-dependent traveling patterns over a random graph” presents a nearly “real life” application of MSEMEA using a random graph and a time dependent travelling patterns matrix.
The section “Money from lost productivity” shows how to track the money losses across the sites.
The last section “Future plans” outlines envisioned (immediate) extensions work presented in this notebook.
General algorithm description
In this section we describe a modeling approach that uses different mathematical modeling approaches for (i) the multi-site travelling patterns and (ii) the single-site disease spread interactions, and then (iii) unifies them into a common model.
Splitting and scaling
The traveling between large, densely populated cities is a very different process of the usual people mingling in those cities. The usual large, dense city mingling is assumed and used in the typical compartmental epidemiological models. It seems it is a good idea to split the two processes and derive a common model.
Assume that all journeys finish within a day. We can model the people arriving (flying in) into a city as births, and people departing a city as deaths.
Let as take a simple model like SIR or SEIR and write the equation for every site we consider. This means for every site we have the same ODE’s with site-dependent initial conditions.
Consider the traveling patterns matrix , which is a contingency matrix derived from source-destination traveling records. (Or the adjacency matrix of a travelling patterns graph.) The matrix entry of tells us how many people traveled from site to site . We systematically change the ODE’s of the sites in following way.
Assume that site had only travelers coming from site and going to site . Assume that the Total Population (TP) sizes for sites and are and respectively. Assume that only people from the Susceptible Population (SP) traveled. If the adopted single-site model is SIR, [Wk1], we take the SP equation of site
and change into the equation
assuming that
Remark: In the package [AAp3] the transformations above are done with the more general and robust formula:
The transformed systems of ODE’s of the sites are joined into one “big” system of ODE’s, appropriate initial conditions are set, and the “big” ODE system is solved. (The sections below show concrete examples.)
Steps of MSEMEA
MSEMEA derives a compartmental model that combines (i) a graph representation of multi-site traveling patterns with (ii) a single-site compartmental epidemiological model.
Here is a visual aid for the algorithm steps below:
0i0g3m8u08bj405c2sz8hd3ryj
Get a single-site epidemiological compartmental model data structure, .
The model data structure has stocks and rates dictionaries, equations, initial conditions, and prescribed rate values; see [AA2, AAp1].
Derive the site-to-site traveling patterns matrix for the sites in the graph .
For each of node of make a copy of the model and denote with .
In general, the models have different initial conditions.
The models can also have different death rates, contact rates, etc.
Combine the models into the scaled model .
Change the equations of , to reflect the traveling patterns matrix .
Join the systems of ODE’s of , into one system of ODE’s.
Set appropriate or desired initial conditions for each of the populations in .
Solve the ODE’s of .
Visualize the results.
Precaution
Care should be taken when specifying the initial conditions of MSEMEA’s system of ODE’s (sites’ populations) and the traveling patterns matrix. For example, the simulations can “blow up” if the traveling patterns matrix values are too large. As it was indicated above, the package [AAp3] puts some safe-guards, but in our experiments with random graphs and random traveling patterns matrices occasionally we still get “wild” results.
Analogy with Large scale air-pollution modeling
There is a strong analogy between MSEMEA and Eulerian models of Large Scale Air-Pollution Modeling (LSAPM), [AA3, ZZ1].
The mathematical models of LSAPM have a “chemistry part” and an “advection-diffusion part.” It is hard to treat such mathematical model directly – different kinds of splittings are used. If we consider 2D LSAPM then we can say that we cover the modeling area with steer tank reactors, then with the chemistry component we simulate the species chemical reactions in those steer tanks, and with the advection-diffusion component we change species concentrations in the steer tanks (according to some wind patterns.)
Similarly, with MSEMEA we separated the travel of population compartments from the “standard” epidemiological modeling interaction between the population compartments.
Similarly to the so called “rotational test” used in LSAPM to evaluate numerical schemes, we derive and study the results of “grid graph tests” for MSEMEA.
From the plots above we see that both sites start with total populations of people. Because more travelers go from 1 to 2 we see that the exposed, infected, and recovered populations are larger at 2.
Time dependent travel matrices
Instead of using constant traveling patterns matrices we can use matrices with time functions as entries. It is instructive to repeat the computations above using this matrix:
As expected from the graph structure, we can see in the first site plot that its total population is decreasing – nobody is traveling to the first site. Similarly, we can see in the last site plot that its total population is increasing – nobody leaves the last site.
Graph evolution visualizations
We can visualize the spatial-temporal evolution of model’s populations using sequences of graphs. The graphs in the sequences are copies of the multi-site graph each copy having its nodes colored according to the populations in the solutions steps.
We can see from the plot above that at the grid vertexes we have typical SEIR curve shapes for the corresponding infected populations.
Let us evaluate the solutions for the infected populations for over all graph vertexes and sum them. Here is the corresponding “globally-aggregated” plot:
We can see that the globally aggregated plot has a very different shape than the individual vertex plots. The globally aggregated plot has more symmetric look; the individual vertex plots have much steeper gradients on their left sides.
We can conjecture that a multi-site model made by MSEMEA would capture better real life situations than any single-site model. For example, by applying MSEMEA we might be more successful in our calibration attempts for the Hubei data shown (and calibrated upon) in [AA2.].
Interactive interface
With this interactive interface we see the evolution of all populations across the graph:
Obviously the simulations over the described grid graph, related constant traveling patterns matrix, and constant populations have the purpose to build confidence in conceptual design of MSEMEA and its implementation.
The following observations agree with our expectations for MSEMEA’s results over the “grid graph test”.
The populations plots at each site resemble the typical plots of SEI2R.
The total population at the first site linearly decreases.
The total population at the last site linearly increases.
The plots of the total populations clearly have gradually increasing gradients from the low index value nodes to the high index value nodes.
For the infected populations there is a clear wave that propagates diagonally from the low index value nodes to the high index value nodes.
In the direction of the general “graph flow.“
The front of the infected populations wave is much steeper (gives “higher contrast”) than the tail.
This should be expected from the single-site SEI2R plots.
For the recovered populations there is a clear “saturation wave” pattern that indicates that the recovered populations change from to values close to the corresponding final total populations.
The globally aggregated solutions might have fairly different shapes than the single-site solutions. Hence, we think that MSEMEA gives a modeling ingredient that is hard to replicate or emulate by other means in single-site models.
Time-dependent traveling patterns over a random graph
In this section we apply the model extension and simulation over a random graph with random time-dependent traveling patterns matrix.
Remark: The computations in this section work with larger random graphs; we use a small graph for more legible presentation of the workflow and results. Also, the computations should clearly demonstrate the ability to do simulations with real life data.
Derive a traveling patterns matrix with entries that are random functions:
[HH1] Herbert W. Hethcote (2000). “The Mathematics of Infectious Diseases”. SIAM Review. 42 (4): 599–653. Bibcode:2000SIAMR..42..599H. doi:10.1137/s0036144500371907.
The package provides the functions UMLClassNode and UMLClassGraph.
The function UMLClassNode has the signature
UMLClassNode[classSymbol, opts]
UMLClassNode creates a Grid object with a class name and its methods for the specified class symbol. The option “Abstact” can be used to specify abstract class names and methods. The option “EntityColumn” can be used to turn on and off the explanations column.
The function UMLClassGraph that has the signature:
UMLClassGraph creates an UML graph diagram for the specified symbols (representing classes) and their relationships. It takes as options the options of UMLClassNode and Graph.
UML diagrams creation
Let us visualize a simple relationship between buildings, people, books, and a client program.
In the diagram above the classes Person and Building are abstract (that is why are in italic). Member inherits Person, Library and Museum inherit Building. Library can contain (many) Book objects and it is associated with Member. Client associates with Building and Person.
UML diagram generation
The main package function UMLClassGraph is capable of generating UML diagrams over Design Patterns code written in the style exemplified and described in my WTC 2015 talk Object-Oriented Design Patterns.
Let us look into a simple UML generation example for the design pattern Template Method.
Here is the Mathematica code for that design pattern: