#  StateCensusLaws.org: A Web Application for Consuming and Annotating Legal
Discourse Learning

Alexander Spangher and Jonathan May
Information Sciences Institute
University of Southern California
<EMAIL_ADDRESS><EMAIL_ADDRESS>

###### Abstract

In this work, we create a web application to highlight the output of NLP
models trained to parse and label discourse segments in law text. Our system
is built primarily with journalists and legal interpreters in mind, and we
focus on state-level law that uses U.S. Census population numbers to allocate
resources and organize government.

Our system exposes a corpus we collect of $6,000$ state-level laws that
pertain to the U.S. census, and highlights our discourse parsing model’s
output. We also build in a novel, flexible annotation framework that can
handle span-tagging and relation tagging on an arbitrary input text document.
This framework can allow journalists and interested practitioners to correct
tags, and tag more documents.

##  1 Introduction

Since at least 1958, AI practitioners have explored how to analyze legal
documents – i.e. laws, court opinions and regulations – to yield greater
insight into legal decision-making Mehl (1958). A number of systems seek to
help citizens understand law Dale (2019), by answering
questions111https://www.chatbotsecommerce.com/nrf-launches-parker-first-
australian-privacy-law-chatbot/, generating
documents222https://legal.thomsonreuters.com.au/products/contract-express/,
https://turbotax.intuit.com/, or helping users file motions Gibbs (2016).

However, researchers trying to compare and contrast large bodies of law, such
as journalists or academics, have virtually no open-source resources: an
informal survey of legal journalists we conducted before starting this
project333Many were former colleagues at the New York Times or current
colleagues at the USC Annenberg School for Communication and Journalism.
yielded several insights: (1) there are no open accessible, free, online
sources to perform full-text searches on all state law (2) it is hard to track
entities across laws (3) it is hard to know when a law applies. Our web
application aims to address all three of these short-comings.

…in counties having a metropolitan form of government and in counties having a
population of not less than three hundred thirty-five thousand (335,000) nor
more than three hundred thirty-six thousand (336,000), according to the 1990
federal census or any subsequent federal census, the magistrate or magistrates
shall be selected and appointed by and serve at the pleasure of the trial
court judge…

Figure 1: Paragraph from a sample law, Tennessee § 36-5-402, referencing a
bureaucratic process impacted by population counts determined by the upcoming
federal census. The colored blocks represent the following concepts, which we
will define in the text: probe, test, subject, consequence, object. Our web
application aggregates these span tags across state-level laws, helping civil
citizens and journalists more easily discern the impacts of a U.S. Census
undercount.

In this work, we present a web application444http://www.statecensuslaws.org/,
an annotation framework, and a set of web-scrapers designed to meet these
challenges. This system is the fruit of theoretical work, publication-
upcoming, in which we propose a discourse schema for analyZing law
(illustrated in Figure 1), an annotated dataset, and a set of models. At the
core, our framework seeks to answer the following key questions: (1) When does
this law apply? (2) Who gains what powers? (3) Who gains what restrictions?
This paper makes three key contributions:

  1. 1.

Searching and consuming model output: We present a web-app to expose and help
users navigate through a discourse framework for law that we develop, annotate
and train models on.

  2. 2.

Collecting and Updating Annotations: We develop a light-weight and modular
Javascript-based annotation interface for span and relation-labeling to
integrate into webpages, standalone apps, or Amazon Mechanical Turk (AMT)
tasks.

  3. 3.

Web Scraping Public Domain U.S. State Law: We release a set of 25 robust
Dockerized web-scrapers to collect U.S. state law wholesale or by keyword.
These scrapers are designed to overcome uncivil attempts to block law-scraping
that hinders research. We collect and release a database of more than $6,000$
state-level laws using these scrapers.

Our particular subject area in this work – state-level laws pertaining to the
2020 U.S. Census – is relevant for several reasons: (1) The 2020 U.S. Census
has faced massive challenges and certain populations might be undercounted
Naylor (2020); Mervis (2019); Berry-James et al. (2020). (2) Very little
research exists exploring the effects of an undercount on state-level
processes.555Research exists illuminating the effects of populations
undercounts on Federal budgeting and Congressional representation Reamer
(2018); Berry-James et al. (2020), but because of the challenges discussed,
state-level law is harder to probe. (3) Journalists, our primary users, can
provide useful feedback for ongoing work on discourse-schema development.

We outline our discourse schema and modeling in Section 2. We next discuss our
dataset collection process, including the web-scrapers we release for
gathering public-domain U.S. state law text (Section 3). In Section 4 we
describe our lightweight and modular span and relation annotation interface
which we used to collect data. Next, in Section 5, we describe our web-app,
where we surface our model’s output to journalists and engage volunteers to
improve our annotations. Finally, we discuss an ongoing use-case to illustrate
how one might use our app in Section 6.

##  2 Background

We briefly introduce the key components of our discourse schema, the dataset
we collect, and the BERT-CRF-based modeling we perform.

###  2.1 Schema

The five principal discourse elements that we identify in our schema are:
SUBJECT, CONSEQUENCE, OBJECT, PROBE and TEST. PROBES, SUBJECTS and OBJECTS are
entities while TESTS and CONSEQUENCES are verb phrases. We describe each in
turn.

The first three elements in our schema, SUBJECT, CONSEQUENCE, and OBJECT,
uncover how law dictates first-degree interactions between entities666
Inspired by seminal work done by Gardner (1984). . As such, a SUBJECT is an
entity directly gaining a power or a restriction under a law. The CONSEQUENCE
is the specific power or restriction placed on the SUBJECT. The OBJECT is the
entity being affected by the SUBJECT’s gain in powers or
restrictions.777SUBJECT, CONSEQUENCE and OBJECT example: The trial court judge
shall adjudicate property disputes between claimants. OBJECTS are not always
present,888Example of a SUBJECT-CONSEQUENCE relation without an OBJECT: The
trial court judge shall begin session at or before 9am. and SUBJECTS might be
expressed passively.999Passive SUBJECT (and passive OBJECT) example: Taxes
shall be collected at the beginning of every month. The SUBJECT and OBJECT,
“Tax-collector” and “Tax-payer”, are not actively expressed. (SUBJECTS and
OBJECTS are nearly always individuals or organizations).

The last two elements in our schema, TEST, and PROBE, indicate when laws
apply. A TEST is an explicit condition applied to an entity to determine when
a SUBJECT-CONSEQUENCE-OBJECT relation holds. A PROBE is an entity that is
tested but not part of a legally-mediated relationship.101010PROBE and TEST
example: In counties with a population above 10,000, the trial court judge
shall adjudicate property disputes between claimants. A TEST need not only
apply to a PROBE; it can apply to a SUBJECT, OBJECT, or even a CONSEQUENCE.

###  2.2 Annotated Dataset and Modeling

Our dataset collection is described in Section 3. From our full dataset, we
sample a set of law-paragraphs to annotate.We build an annotation framework,
described in Section 4, and enlist two expert annotators. As of this writing,
we have 573 law paragraphs annotated according to the span-level schema
described in Section 2.1.

We test a class of models aimed at performing span-tagging, and use our top-
performing model, BERT-CRF (based on Li et al. (2019); Spangher et al. (2021))
in the current production pipeline. Our model accuracy improves with more
data, and a primary purpose of our web-app is to collect more annotations from
users (Section 4). We provide our predicted outputs in the database as well.

##  3 Dataset Construction

Our collected dataset comprises the more than 100,000 active state-level laws
in the United States, including roughly 6,000 laws that reference Census
population counts from a public-domain law website,
Justia,111111https://www.justia.com/ and directly from state
websites.121212Some of the laws provided by Justia, such as those for
Colorado, contain data in unhelpful forms, such as PDF files (see
https://law.justia.com/codes/colorado/2019/), so we extract directly in these
cases. In total, we build parsers for 24 official state websites and one for
Justia.

State law is always public
domain;131313https://fairuse.stanford.edu/overview/public-domain/welcome/ yet
in practice, it is often inaccessible for bulk downloads and web scraping. For
instance, many websites license LexisNexis, a for-profit company, as the
official provider for their state codes141414Ex. Colorado, Georgia and
Tennessee: http://www.lexisnexis.com/hottopics/colorado,
http://www.lexisnexis.com/hottopics/gacode,
http://www.lexisnexis.com/hottopics/tncode. Although these websites are
publicly and freely accessible (as apart from other LexisNexis-hosted
resources, which require memberships to access), they employ a range of
mechanisms (e.g. timeouts, dynamically-generated URLs, cookie-based access)
that make them difficult to scrape.151515The practical effect of mechanisms to
block bulk downloads is the hindrance of law corpora collection for
journalistic or academic study, where computation might be applied either to
search, parse or compare the laws.

To circumvent these blocking mechanisms, our scrapers are robust and, in many
cases, mimic human web-browsing behavior in order to provide full access to
public-domain law. We develop a generalized scraper for LexisNexis Public
Access websites that uses scrapy161616Scrapy, https://scrapy.org/, is a
popular python library for scraping that handles timeouts, retries and
storage. and selenium-webdriver171717selenium-webdriver,
https://www.selenium.dev/ is a programmatic web-browser that is commonly used
to navigate websites by mimicking human behavior and to render dynamic
webpages for retrieval. In order to scrape Justia, we launch three Google
Compute Engine (GCE) instances for a total of 60 compute hours. We will open-
source our scraping routines as well as the Docker images we created to
perform these scrapes. Our scrapers are flexible and can download either full
codes or all codes related to a query. Our Docker containers contain the
necessary python libraries (e.g. scrapy) and binary libraries selenium-
webdriver and gsutil for scraping and Google Cloud Platform (GCP) storage.
These routines constitute a considerable resource for academic inquiries into
state-level law.

Figure 2: Our lightweight annotation interface allows users to identify spans
by highlighting text, assigning labels to spans using the dropdown, and
assigning relations by right-clicking to draw lines. We track user-identity
using Google sign-in. (While our interface can collect relational labels, we
do not study them in this work.) Figure 3: A flow-based sitemap for our
website, statecensuslaws.org, with some details about the back-end and
database setup. The left-column shows Flow 1, where a user can search and view
full-text results. The right-column shows Flow 2, where a user can view top
law-discourse spans and see all laws these spans are used in. Each flow leads
to the annotation framework.

##  4 Annotation Interface

We wanted a lightweight, modular, Javascript-based annotation framework that
could handle span annotation and relation assignment. We wanted it to be
easily adaptable for multiple use-cases: (1) to serve as a standalone web-app
to be distributed to undergraduate helpers and volunteers, (2) to be
integrated into a larger web-app to help site visitors annotate new laws and
correct problematic annotations they see, and (3) to be compiled to Amazon
Mechanical Turk (AMT) HTMLQuestions181818An HTMLQuestion is an HTML page that
is submitted to AMT,
https://docs.aws.amazon.com/AWSMechTurk/latest/AWSMturkAPI/ApiReference_HTMLQuestionArticle.html.
AMT handles the traffic split and data collection..

Although many web-based, NLP-focused annotation tools exist (78, by Neves and
Ševa (2021)’s count), we surveyed options, including brat Stenetorp et al.
(2012), GATE Bontcheva et al. (2013), YEDDA Yang et al. (2017) and WebAnnon
Yimam et al. (2013), and found that none of them met our requirements.
Although all these options were web-based, none were flexible enough to be
integrated easily into larger websites. Further, none were able to
automatically generate AMT tasks.

Not finding an appropriate solution, we designed a simple and modularized
annotation framework in 600 lines of JQuery, Javascript and HTML, with a
Datastore backend191919Google Datastore is a NoSQL, scalable JSON store, which
is suitable for our usecase. https://cloud.google.com/datastore. Our
annotation framework supports span annotation and relation tagging.

Figure 4: Our database setup. ElasticSearch contains the full text of laws for
Flow 1. MySQL contains tables for summary statistics, rendering annotation
HTML, and collecting annotation-data/model-output (BERT-CRF feeds into MySQL
span_summ.). Datastore handles task assignment for volunteers.

The annotation interface itself, shown in Figure 2, is powered by a stateful
page object, called PageHandler, that is instantiated with several parameters
(page_height, buttons, relations) and handles all of the page interactions.
The PageHandler is placed directly in the HTML page containing the text to be
annotated, so any service that can render text can automatically become an
annotation service. In our case, we built Jinja templates to render our HTML,
since our server is coded in Python-Flask. We additionally provide a helper
function that, with input data, can compile our Jinja templates as static,
fully-functional AMT HTMLQuestions.

We use a Datastore backend to track progress towards annotation tasks, as
shown in Figure 4. We code data entries (the equivalent of MySQL tables) to
track helper-statistics, helper_summ, how many tasks are left to assign,
incomp_tasks, and how many annotations have been completed, comp_annot. We
track these statistics to ensure that we can obtain multiple annotations for
each task, and that no helper sees the same task more than once. We perform
one GET request at the beginning of each user session to collect user-stats
and then use client-side cookies throughout the session to minimize the number
of requests we send to the back-end. We use a NoSQL database because they are
low-latency and designed for streaming, and Datastore because our web-app is
hosted on Google App Engine. We include our Datastore management back-end as
part of the annotation package. To use our tool with other NoSQL
providers,202020e.g. Amazon DynamoDB – https://aws.amazon.com/dynamodb/ a port
is necessary.

The annotation interface is designed for modularity first-and-foremost. We
release the annotation code as part of this framework. In the future, the
annotation component of this project will be abstracted and distributed in its
own stand-alone Javascript package for the benefit of researchers needing a
similar application.

##  5 Web Interface

We design a web interface that serves three principle use cases: (1) enabling
full-text search on our database, (2) exposing users to our discourse schema
by extracting spans across laws and (3) allowing users to both correct/update
and provide new annotations. Our website has two principlal flows: Flow 1:
searching laws by keyword, and Flow 2: grouping laws by span, shown in Figure
3.

In Flow 1, users can use a query box to perform full-text and faceted search
on laws and then click on and return results to read the full text of the law.
ElasticSearch powers both of these endpoints, as shown in Figure 4. This flow
is useful for when journalists want to explore a specific term or concept
irrespective of its discourse role, or simply familiarize themselves with the
corpus.

In Flow 2, users can view aggregate counts of different discourse elements, by
type, across the corpora. This helps to summarize the corpora from a
functional standpoint, as described in Section 2. Users navigate this flow by
clicking on one of five buttons to see the counts of each of the five
principle discourse spans, then clicking on any of the returned span results
to view all laws with this span. MySQL serves both of these endpoints (and
provides additional metrics, such as a map in the about.html page, not shown
here.).

In both flows, visitors can access our annotation framework, described in
Section 4. From Flow 1, they can click search results to tag a specific
paragraph, and from Flow 2 they can click to correct an annotated paragraph.
Additionally, they can annotate a randomly selected paragraph by clicking
“Help Us Tag.”

##  6 Use Cases

We describe two example articles that are currently being explored by users of
our system.

In the first example, journalists hypothesized that the allocation of new
liquor licenses might be population-based. To explore this, they used Flow 1;
they searched for the term “alcohol OR liquor OR beverage” in the search
interface and discovered that interface returned 270 laws. They reached out to
us and, offline, we analyzed the breakdown in states212121With this project,
we introduce a web-app which can primarily help journalists explore our models
and generate leads for stories – we do not intend for it to fully answer all
analytical questions. As such, there is a back-and-forth with all the
journalists we are working with.. We found that the states most likely to base
liquor licenses off population counts were Tennessee, New York and Illinois.
They then asked us to extract all TESTS from these laws. We found that mid-
size cities would be the most likely to be impacted by a 5% or 10% undercount
in population. The journalists identified key cities and sought sources in
these areas. This work is ongoing.

In another example, journalists explored Flow 2. They noticed that some TESTS
are based on explicit population thresholds (ex. Figure 1) and that some of
these thresholds were very narrow. They reached out to us. We compiled several
keyword filters and regular expressions extract specific population
thresholds. We found that, in Tennessee in particular, over 40% of all Census-
related laws imposed narrow population tests of fewer than 500 people and 10%
imposed tests of fewer than 100 people. This raised questions: what is the
purpose of these narrowly targeted laws? Were they trying to target specific
counties without mentioning them by name? The journalists are now
investigating further by tracking down the authors of these laws.

##  7 Related Work

Although the field of AI-driven legal aids is multifaceted and growing
Kauffman and Soares (2020), free and open-source frameworks remain few Morris
(2019); Dale (2019); Vergottini (2011). Our discourse-driven web application,
designed for legal exploratory analysis is one of the few AI-powered, free
applications that exist, and the first to open source tools for legal document
collection.

For-profit legal inquiry systems, as mentioned above, are numerous. Bloomberg
Law222222https://pro.bloomberglaw.com/, Westlaw232323https://www.westlaw.com/,
LexisNexis242424https://www.lexisnexis.com and Wolters
Kluwar252525https://www.wolterskluwer.com are the four main services for legal
research Dale (2019), which provide subscription-based, Google-style searches.
CaseText262626https://casetext.com/ and Ravel272727https://home.ravellaw.com/
were two upstart case-text search engines (although both have now been
aquired); CaseText offered crowdsourced annotations and Ravel linked cases
together to create visual maps of important cases Lee et al. (2015). We
similarly provide a way of collecting user-annotations, and a novel way
linking together cases, although ours is linguistically grounded in discourse
theory.

Various discourse schemas have been developed to understand law texts,
including deontological logic-based schemas Wyner and Peters (2011); Zeni et
al. (2015), and subject matter-specific schemas Espejo-Garcia et al. (2019).
Ours is the first discourse-based approach to take steps towards a big-data
approach by setting up a framework for the ingestion of crowdsourced
annotations.

Finally, outside of the legal domain, other areas have experienced a growth in
academically-oriented systems for human-in-the-loop inquiry. The COVID-19
pandemic has produced a burst in NLP-driven corpora-collection Wang et al.
(2020), demonstrations Sohrab et al. (2020); Hope et al. (2020); Spangher et
al. (2020) and workshops Verspoor et al. (2020b, a).

Such concerted effort in the NLP domain to expose open resources and build
free tools for subject matter experts is an inspiring guide for how
researchers can contribute to wider inquiries. We hope such acknowledgement of
our ability as NLP researchers to empower others becomes commonplace for other
applications as well, forming a common alliance between academics, civil-
minded journalists and other researchers and end-users.

##  8 Conclusion

In this work, we have presented three open-source components. (1) A web-app
highlighting a novel discourse schema and its application to U.S. Census-
related state law. (2) A flexible and modular annotation framework that can be
seamlessly embedded into web-apps to allow visitors to contribute and update
annotations. (3) A set of 25 web-scrapers to help researchers gather public-
domain legal text. Our concrete goal is to facilitate journalistic exploration
into laws possibly affected by the 2020 U.S. Census, of which we have multiple
ongoing projects already. Our longer-term goal is to collect feedback and
data, and improve our database and machine learning systems. We hope that such
efforts can continue to push Legaltech into a more open and accessible domain,
and make it easier to understand the laws governing our society.

##  9 Impact Statement

There were several possible ethical considerations we encountered during this
research which we wish to address.

Dataset Creation: The creation of our dataset involved scraping numerous
websites, including state websites, state-licensed LexisNexis pages and
https://www.justia.com. In the third case, Justia, we did not violate any
terms of service. In fact, Justia’s robots.txt file282828Found here
https://www.justia.com/robots.txt. Such files govern the site-owners’
standards for scraping and crawling. is the most permissive possible, giving
unlimited license to any crawler. It is generally accepted that robots.txt
files are implied licenses of
access,292929https://stackoverflow.com/questions/999056/ethics-of-robots-txt
and we did not disregard Justia’s file before scraping.

Content derived from the first two categories, state law websites and
official, state-licensed websites like LexisNexis are, by law, public domain
Wolfe (2019); MacWright (2013). Web-scraping the public domain is neither
illegal nor unethical Mehta (2021). As we did in the body of the paper, we
again emphatically criticize attempts by providers to make web-scraping
difficult, and we went to lengths to overcome this.

Dataset Annotation: All parties involved in annotating our dataset received
valid compensation. We relied entirely on expert researchers to collect our
annotations. This included the authors of this paper. All the researchers who
provided annotations for us were affiliated with our institution and
compensated appropriately by our institution (we leave the determination of
“appropriate” for our institution to define).

Although we describe accommodating AMT tasks in the body of the paper, thus
far, we have not used any annotations made by Turkers on AMT or or by
journalists/researchers using our site. If we do, we will ensure there are no
ethical issues by securing university IRB approval or exemption, as deemed fit
by the IRB. For the Turkers, we will calculate a payment that equals, on
average, $15 an hour. For the journalists/researchers, we will have exchanged
something of value (the use of our web-app) for the annotation.

Website Usage: Our website has significant accessibility limitations for the
seeing-impaired and for non-English speakers. We have not addressed them in
this current version, but are mindful and actively searching for options to
expand accessibility.

There are two ways in which seeing-impaired users might suffer. First, blind
users will not be able to read any of the site without external tools, as we
have not recorded or built in any native audio-scripts, keyboard shortcuts or
voice-activated commands. Secondly, part of our website, Flow 2, introduces
users to our discourse schema by introducing them to . The web-app does not
attempt to natively include accessibility options for seeing-impaired users.

Our website focuses on U.S.-based laws and contains only English-language
text. We do not attempt, in this version, to perform translations. Our plan in
the present iteration of this work was to work with U.S.-based journalists
studying U.S.-based law. We have not yet undertaken a study to compare how
well our discourse schema would apply to non-U.S. law, be it common or civil
Dainow (1966). However, if this approach proves useful for journalists and
researchers, we will certainly seek to undertake this.

## References

  * Berry-James et al. (2020) RaJade M Berry-James, Susan T Gooden, and Richard Greggory Johnson III. 2020.  Civil rights, social equity, and census 2020.  _Public Administration Review_ , 80(6):1100–1108.
  * Bontcheva et al. (2013) Kalina Bontcheva, Hamish Cunningham, Ian Roberts, Angus Roberts, Valentin Tablan, Niraj Aswani, and Genevieve Gorrell. 2013.  Gate teamware: a web-based, collaborative text annotation framework.  _Language Resources and Evaluation_ , 47(4):1007–1029.
  * Dainow (1966) Joseph Dainow. 1966.  The civil law and the common law: some points of comparison.  _Am. J. Comp. L._ , 15:419.
  * Dale (2019) Robert Dale. 2019.  Law and word order: NLP in legal tech.  _Natural Language Engineering_ , 25(1):211–217.
  * Espejo-Garcia et al. (2019) Borja Espejo-Garcia, Francisco J Lopez-Pellicer, Javier Lacasta, Ramón Piedrafita Moreno, and F Javier Zarazaga-Soria. 2019.  End-to-end sequence labeling via deep learning for automatic extraction of agricultural regulations.  _Computers and Electronics in Agriculture_ , 162:106–111.
  * Gardner (1984) Anne von der Lieth Gardner. 1984.  Artificial intelligence approach to legal reasoning.  Technical report, Stanford Univ.
  * Gibbs (2016) Samuel Gibbs. 2016.  Chatbot lawyer overturns 160,000 parking tickets in london and new york.  _The Guardian_.
  * Hope et al. (2020) Tom Hope, Jason Portenoy, Kishore Vasan, Jonathan Borchardt, Eric Horvitz, Daniel Weld, Marti Hearst, and Jevin West. 2020.  SciSight: Combining faceted navigation and research group detection for COVID-19 exploratory scientific search.  In _Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing: System Demonstrations_ , pages 135–143, Online. Association for Computational Linguistics.
  * Kauffman and Soares (2020) Marcos Eduardo Kauffman and Marcelo Negri Soares. 2020.  AI in legal services: new trends in AI-enabled legal services.  _Service Oriented Computing and Applications_ , 14(4):223–226.
  * Lee et al. (2015) Katrina June Lee, Susan Azyndar, and Ingrid AB Mattson. 2015.  A new era: Integrating today’s next gen research tools ravel and casetext in the law school classroom.  _Rutgers Computer & Tech. LJ_, 41:31.
  * Li et al. (2019) Xiangci Li, Gully Burns, and Nanyun Peng. 2019.  Discourse tagging for scientific evidence extraction.  _arXiv preprint arXiv:1909.04758_.
  * MacWright (2013) Tom MacWright. 2013.  State law is public domain. what’s public domain? _macwright.com_.
  * Mehl (1958) Lucien Mehl. 1958.  _Automation in the legal world_.  National Physical Laboratory.
  * Mehta (2021) Ivan Mehta. 2021.  Us court says scraping a site without permission isn’t illegal.  _TNW | Security_.
  * Mervis (2019) Jeffrey Mervis. 2019.  Census citizenship question is dropped, but challenges linger.  _Science_ , 365(6450):211–211.
  * Morris (2019) Jason Morris. 2019.  Making mischief with open-source legal tech: Radiant law.
  * Naylor (2020) Lorenda A Naylor. 2020.  Counting an invisible class of citizens: The lgbt population and the us census.  _Public Integrity_ , 22(1):54–72.
  * Neves and Ševa (2021) Mariana Neves and Jurica Ševa. 2021.  An extensive review of tools for manual annotation of documents.  _Briefings in bioinformatics_ , 22(1):146–163.
  * Reamer (2018) Andrew Reamer. 2018.  Counting for dollars 2020: the role of the decennial census in the geographic distribution of federal funds.  _Initial Analysis_ , 16.
  * Sohrab et al. (2020) Mohammad Golam Sohrab, Khoa Duong, Makoto Miwa, Goran Topić, Ikeda Masami, and Takamura Hiroya. 2020.  BENNERD: A neural named entity linking system for COVID-19.  In _Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing: System Demonstrations_ , pages 182–188, Online. Association for Computational Linguistics.
  * Spangher et al. (2021) Alexander Spangher, Jonathan May, Sz-rung Shiang, and Lingjia Deng. 2021.  Multitask learning for class-imbalanced discourse classification.  _arXiv preprint arXiv:2101.00389_.
  * Spangher et al. (2020) Alexander Spangher, Nanyun Peng, Jonathan May, and Emilio Ferrara. 2020.  Enabling low-resource transfer learning across COVID-19 corpora by combining event-extraction and co-training.  In _Proceedings of the 1st Workshop on NLP for COVID-19 at ACL 2020_ , Online. Association for Computational Linguistics.
  * Stenetorp et al. (2012) Pontus Stenetorp, Sampo Pyysalo, Goran Topić, Tomoko Ohta, Sophia Ananiadou, and Jun’ichi Tsujii. 2012.  brat: a web-based tool for NLP-assisted text annotation.  In _Proceedings of the Demonstrations at the 13th Conference of the European Chapter of the Association for Computational Linguistics_ , pages 102–107, Avignon, France. Association for Computational Linguistics.
  * Vergottini (2011) Grant Vergottini. 2011.  To go open source or not?
  * Verspoor et al. (2020a) Karin Verspoor, Kevin Bretonnel Cohen, Michael Conway, Berry de Bruijn, Mark Dredze, Rada Mihalcea, and Byron Wallace, editors. 2020a.  _Proceedings of the 1st Workshop on NLP for COVID-19 (Part 2) at EMNLP 2020_. Association for Computational Linguistics, Online.
  * Verspoor et al. (2020b) Karin Verspoor, Kevin Bretonnel Cohen, Mark Dredze, Emilio Ferrara, Jonathan May, Robert Munro, Cecile Paris, and Byron Wallace, editors. 2020b.  _Proceedings of the 1st Workshop on NLP for COVID-19 at ACL 2020_. Association for Computational Linguistics, Online.
  * Wang et al. (2020) Lucy Lu Wang, Kyle Lo, Yoganand Chandrasekhar, Russell Reas, Jiangjiang Yang, Doug Burdick, Darrin Eide, Kathryn Funk, Yannis Katsis, Rodney Michael Kinney, Yunyao Li, Ziyang Liu, William Merrill, Paul Mooney, Dewey A. Murdick, Devvret Rishi, Jerry Sheehan, Zhihong Shen, Brandon Stilson, Alex D. Wade, Kuansan Wang, Nancy Xin Ru Wang, Christopher Wilhelm, Boya Xie, Douglas M. Raymond, Daniel S. Weld, Oren Etzioni, and Sebastian Kohlmeier. 2020\.  CORD-19: The COVID-19 open research dataset.  In _Proceedings of the 1st Workshop on NLP for COVID-19 at ACL 2020_ , Online. Association for Computational Linguistics.
  * Wolfe (2019) Jan Wolfe. 2019.  U.s. high court to rule on scope of copyright for legal codes.
  * Wyner and Peters (2011) Adam Z Wyner and Wim Peters. 2011.  On rule extraction from regulations.  In _JURIX_ , volume 11, pages 113–122.
  * Yang et al. (2017) Jie Yang, Yue Zhang, Linwei Li, and Xingxuan Li. 2017.  Yedda: A lightweight collaborative text span annotation tool.  _arXiv preprint arXiv:1711.03759_.
  * Yimam et al. (2013) Seid Muhie Yimam, Iryna Gurevych, Richard Eckart de Castilho, and Chris Biemann. 2013.  Webanno: A flexible, web-based and visually supported system for distributed annotations.  In _Proceedings of the 51st Annual Meeting of the Association for Computational Linguistics: System Demonstrations_ , pages 1–6.
  * Zeni et al. (2015) Nicola Zeni, Nadzeya Kiyavitskaya, Luisa Mich, James R Cordy, and John Mylopoulos. 2015.  Gaiust: supporting the extraction of rights and obligations for regulatory compliance.  _Requirements engineering_ , 20(1):1–22.


# Dual control of coupled oscillator networks

Per Sebastian Skardal<EMAIL_ADDRESS>Department of
Mathematics, Trinity College, Hartford, CT 06106, USA  Alex Arenas
Departament d’Enginyeria Informatica i Matemátiques, Universitat Rovira i
Virgili, 43007 Tarragona, Spain

###### Abstract

Robust coordination and organization in large ensembles of nonlinear
oscillatory units play a vital role in a wide range of natural and engineered
system. The control of self-organizing network-coupled systems has recently
seen significant attention, but largely in the context of modifying or
augmenting existing structures. This leaves a gap in our understanding of
reactive control, where and how to design direct interventions, and what such
control strategies may teach us about existing structures and dynamics. Here
we study reactive control of coupled oscillator networks and demonstrate dual
control strategies that may be implemented interchangeably to achieve
synchronization. These differing strategies take advantage of different
network properties, the first directly targeting oscillator that are difficult
to entrain, and the second targeting oscillators with strong influence on
others. Thus, in addition to enlarge strategies for network control, the
different control sets shed light on the oscillators dynamical and structural
roles within the system. We close with a demonstration of the applicability of
dual control of a power grid dynamics.

###### pacs:

05.45.Xt, 89.75.Hc

A vital benchmark for human scientific endeavor is to understand, control, and
optimize, natural and man-made complex systems around us. A special challenge
emerges in the context of coordinating large, network-coupled ensembles of
oscillators Strogatz2003 ; Pikovsky2003 ; Arenas2008PhysRep . In addition to
exhibiting a daunting complexity, self-organization of such systems underpin
critical function in a wide range of applications such as cell circuits,
cardiac pacemakers, and power grids Prindle2012Nature ; Glass1988 ;
Rohden2012PRL . On the one hand, the control of network dynamics, both linear
and nonlinear, has seen significant attention in recent years
Cornelius2012NatComms ; Yan2012PRL ; Liu2013Nature ; Yuan2013NatComms ;
Sun2013PRL ; Menichetti2014PRL ; Pasqualetti2014IEEE ; Menara2019IEEEa ;
Montanari2022PNAS ; Duan2022PNAS , with attention to control and optimization
of oscillator systems specifically focusing largely on the design of the
underlying network structure Hoppensteadt1999PRL ; Skardal2014PRL ;
Fazlyab2017Automatica ; Forrow2018PRX ; Menara2019IEEEb ; Baggio2021NatComms ;
Menara2022NatComms . On the other hand, the more direct approach of reactive,
or pinning, control, which directly intervenes in the system dynamics
Grigoriev1997PRL ; Wang2002PhysA ; Li2004IEEE ; Skardal2015SciAdv , has been
explored to a lesser degree, leaving an incomplete understanding of precisely
where and how to intervene in self-organizing systems to exert control.
Moreover, the degree to which we may gain insight into a network’s structure
and/or dynamics from control implementation remains largely opaque.

In this Letter we explore reactive control of heterogeneous oscillator
networks. We demonstrate that there are dual control strategies that target
different sets of oscillators that may be conveniently, and interchangeably
used to achieve a controlled, synchronized state. In addition to providing two
different options for controlling the network dynamics, these two strategies
illuminate different roles of oscillators in the networks. The first strategy,
to be called row control, exerts control directly, identifying precisely those
oscillators that tend to not entrain with the rest of the network on their
own. The second strategy, to be called column control, acts more indirectly,
targeting oscillators that do not necessarily need entrainment themselves, but
rather have a strong influence on other oscillators and thus play a key role
in entraining the full system. We also study the properties of the sets of
oscillators that require control via the two different strategies as the
overall network coupling is varied. Interestingly, as the generic properties
of oscillators belonging to the column control set are largely unaffected by
overall coupling, the coupling causes a transition in the properties of
oscillators belonging to the row control set. Specifically, when overall
coupling is small, yielding strongly disordered uncontrolled dynamics, the
oscillators needing direct control are hub-like with many incoming
connections. On the other hand, when overall coupling is large, yielding less
disorder in the uncontrolled dynamics, the oscillators needing direct control
have relatively few incoming connections. Lastly, we illustrate the
effectiveness of both control strategies in an example application of a power
grid where parameter heterogeneity gives rise to effective directness despite
an underlying undirected topology.

In this work we consider network-coupled systems of $N$ Kuramoto oscillators
Kuramoto1984  whose dynamics are governed by

$\displaystyle\dot{\theta}_{i}=\omega_{i}+K\sum_{j=1}^{N}A_{ij}\sin(\theta_{j}-\theta_{i})+f_{i}(t),$
(1)

where $\theta_{i}$ and $\omega_{i}$ are the phase and natural frequency of
oscillator $i$, $K$ is the global coupling strength, and the adjacency matrix
$A$ encodes the structure of the underlying network, which we assume is
directed, and lastly the function $f_{i}(t)$ represents the possible reactive
control exerted onto oscillator $i$. (The choice $f_{i}(t)=0$ corresponds to
no control imposed at all.) Here we focus on the unweighted directed case,
where $A_{ij}=1$ if a link $j\to i$ exists and $A_{ij}=0$ otherwise, but our
results generalize to weighted links. We focus on the (complete)
synchronization of the ensemble of oscillators, i.e., we target the state
where they all process with the same angular velocity,

$\displaystyle\lim_{t\to\infty}|\dot{\theta}_{i}(t)-\dot{\theta}_{j}(t)|=0\hskip
8.61108pt\text{for all}\hskip 8.61108pti,j=1,\dots,N.$ (2)

It should also be noted that a common metric for the degree of synchronization
in a network is Kuramoto’s order parameter, given by
$z=re^{i\psi}=N^{-1}\sum_{j=1}^{N}e^{i\theta_{j}}$, whose amplitude $r$
delineates weakly and strongly clustered states ($|z|\approx 0$ and $|z|\sim
1$, respectively). We note, that the value of the order parameter may not
easily be used to identify complete synchronization, but its asymptotic
behavior may, with a completely synchronized state yielding relaxation to a
fixed value, i.e., $|z(t)|\to r_{\infty}$ as $t\to\infty$.

Our control mechanisms begins by identifying a target, synchronized state.
Specifically, we seek a target state of the form
$\bm{\theta}^{\text{target}}(t)=\bm{\theta}^{*}+\bm{\Omega}t$, where
$\bm{\theta}^{*}\in\mathbb{R}^{N}$ is a static vector of heterogeneous values
and $\bm{\Omega}\in\mathbb{R}^{N}$ is the constant vector whose values
$\Omega$ are given by the collective frequency of the synchronized system. We
proceed by linearizing Eq. (1) to obtain, in vector form,

$\displaystyle\dot{\bm{\theta}}=\bm{\omega}-KL\bm{\theta},$ (3)

where $L$ is the Laplacian matrix whose entries are given by
$L_{ij}=\sum_{l=1}^{N}A_{il}$ if $i=j$ and $L_{ij}=-A_{ij}$ otherwise.
Inserting the target state into Eq. (3) yields

$\displaystyle\bm{\theta}^{*}=K^{-1}L^{\dagger}(\bm{\omega}-\bm{\Omega}),$ (4)

where $L^{\dagger}$ is the pseudoinverse of $L$ BenIsrael1974 . Moreover, it
can be shown that the collective frequency $\Omega$ is, in general, not equal
to the mean natural frequency, but in the general case of a directed network,
equal to a weighted average of the natural frequencies, where the weights come
from the first left singular vector $\bm{u}^{1}$ of $L$, i.e.,
$\Omega=\langle\bm{u}^{1},\bm{\omega}\rangle/\langle\bm{u}^{1},\bm{1}\rangle$
Skardal2016Chaos ; Skardal2016PRE .

With our synchronized target state in hand, we now seek to control the network
dynamics by ensuring its stability. After choosing a control function designed
to entrain oscillator towards its target state, i.e.,
$f_{i}(t)=F_{i}\sin(\theta_{i}^{\text{target}}(t)-\theta_{i}(t))$, where
$F_{i}$ is the control strength used for oscillator $i$, the Jacobian at the
target state is given by

$\displaystyle
DF_{ij}|_{\bm{\theta}=\bm{\theta}^{*}}=\left\\{\begin{array}[]{rl}-K\sum_{j\neq
i}w_{ij}-F_{i}&\text{if }i=j\\\ Kw_{ij}&\text{if }i\neq j\end{array}\right.$
(7)

where $w_{ij}=A_{ij}c_{ij}$ and $c_{ij}=\cos(\theta_{j}^{*}-\theta_{i}^{*})$.
Stability of the target state, and control of the synchronized state, is
achieved by ensuring that the full spectrum of eigenvalues lies in the left-
half complex plane. We note that, in the uncontrolled case (where $F_{i}=0$)
the rows of the Jacobian sum to zero, yielding at least one trivial eigenvalue
$\lambda_{1}=0$, corresponding to a marginal stability induced by rotational
symmetry, so we seek to ensure that the real part of all eigenvalues are non-
positive.

Our two different control strategies stem from the application of the
Gershgorin circle theorem Golub1996 , which can be applied to either the rows
or the columns of $DF$. Following Skardal2015SciAdv , application of the
theorem to the rows ensures that all $N$ eigenvalues lie within the union of
$N$ row discs, $\bigcup D_{i}^{\text{row}}$, where the $i^{\text{th}}$ disc
$D_{i}^{\text{row}}$ is centered at $DF_{ii}$ and has radius $\sum_{j\neq
i}|DF_{ij}|$. Beginning with no control, i.e., $F_{i}=0$, the $i^{\text{th}}$
discs is centered at $DF_{ii}=-K\sum_{j\neq i}w_{ij}$ and has a radius
$r_{i}=K\sum_{j\neq i}|w_{ij}|$. This disc contains some portion in the right
half complex plane, thereby admitting the possibility of an eigenvalue with
positive real part, if any $w_{ij}$ in row $i$ is positive. Thus, by
inspecting the rows of $DF$ we identify all oscillators that require control
and for those oscillators set $F_{i}\geq K\sum_{j\neq i}(|w_{ij}|-w_{ij})$. We
refer to this strategy as row control.

Figure 1: Dual control strategies for complex oscillator networks. (a) A
12-node directed network with average degree $\langle k\rangle=2$. Natural
frequencies are indicated in parentheses, the coupling strength is $K=1.22$,
and row- and column-controlled oscillators are filled blue and red,
respectively. Time series for collection of phases under (b) row control, (c)
column control, and (d) the magnitude of the order parameter $r(t)$ before
($t<0$) and after ($t\geq 0$) control is applied.

Our second strategy, which we refer to as column control, stems from applying
the Gershgorin circle theorem to the columns of $DF$. From this perspective
the eigenvalues lie within the union of column discs, $\bigcup
D_{j}^{\text{column}}$, where $D_{j}^{\text{column}}$ is centered at
$DF_{jj}=-K\sum_{i\neq j}w_{ji}$ and has radius $\sum_{i\neq
j}|DF_{ij}|=K\sum_{i\neq j}|w_{ij}|$. It follows that oscillator $j$ requires
column control if it satisfies $\sum_{i\neq j}|w_{ij}|>\sum_{i\neq j}w_{ji}$,
and for each we set $F_{j}\geq\sum_{i\neq j}(|w_{ij}|-w_{ji})$.

We now demonstrate row and column control using a small network of $N=12$
nodes with average degree $\langle k\rangle=2$, illustrated in Fig. 1(a), with
randomly generated frequencies given in parentheses, and $K=1.22$. For this
set of parameters we identify the sets of row (blue) and column (red)
controlled oscillators, which consist of three and four oscillators,
respectively, and overlap at a single oscillator. (A few practical
considerations for our simulations are summarized in the SM.) In Figs. 1(b)
and (c) we plot the time series for the phases $\theta_{i}(t)$ for when row
and column control are used, respectively, letting the system evolve without
control for $t<0$, then turning control on for $t\geq 0$. Note that, just as
the control sets are different for the two strategies, the dynamics of the
phases differ just after control is turned on as they relax to the
synchronized state. This difference can also be seen in the dynamics of the
order parameter, plotted in Fig. 1(d). We emphasize that, despite the
significant disorder in the phases’ dynamics without control, the row and
column control strategies are both effective even though their sets of
oscillators are very different.

Figure 2: Network properties of row and column control. For an ensemble of
$500$ networks with $N=200$ nodes, power-law exponent $\gamma=3$, minimum
degree $k_{0}=9$, and normally distributed natural frequencies, (a) the mean
control fraction $f_{c}$ for row (blue circles) and column control (red
crosses) as a function of overal coupling, $\langle k\rangle K$, (b) the
overlap fraction (green triangles) compared to independence and subset
approximations (dashed and dot-dashed black curves). For the same ensemble of
networks, the mean control in- and out-degrees $\langle
k^{\text{in/out}}\rangle_{\text{control}}$ as a function of overall coupling
(c) row and (d) column control. Standard deviations are indicated in (a), (c),
and (d) using solid curves.

We now turn to study how row and column control depend on the network
structure, the structural properties of controlled oscillators in each case,
and what row and column control reveal about the roles of the oscillators. We
begin by plotting in Fig. 2(a) the fraction of oscillators that require
control, denoted the control fraction $f_{c}=n_{c}/N$, where $n_{c}$ is the
number of oscillators in the network that require control as a function of the
overall coupling $\langle k\rangle K$. Row and column control are plotted in
blue circles and red crosses, respectively, and results are taken from an
ensemble of $500$ networks of size $N=200$ generated with the configuration
model Bekessy1972  with power-law (uncorrelated) in- and out-degree
distributions with exponent $\gamma=3$ and minimum degree $k_{0}=9$. For each
network realization the natural frequencies are drawn from a standard normal
distribution. Standard deviations are indicated by solid curves.
Interestingly, these results indicate that depending on the coupling, either
row or column control may be less expensive in the number of oscillators that
require control. Specifically, for $\langle k\rangle K$ approximately less
than or greater than $2$ , column and row control require smaller control
fractions, respectively. Next, in Fig. 2(b) we plot the overlap between the
row and column control oscillator sets in green triangles. To better
understand the overlap set, we compare this to the two simplest possible
approximations bases on differing hypotheses: (i) row and column control sets
are largely independent or (ii) one set tends to be nearly contained within
the other. Denoting these as the independence and subset approximations,
respectively, the independence approximation would indicate that the overlap
set is approximately the size of the product of the row and column sets, where
as the subset approximation would indicate that the overlap set is
approximately equal to the minimum size of the row and column sets (note that
this also serves as an upper bound on the overlap set). Plotting the
independence and subset approximations in dashed and dot-dashed black, we
observe that the the independence approximation is the most accurate,
indicating that row and column control largely target different oscillators in
the network.

We also examine the role of the controlled oscillator more closely, plotting
in Figs. 2(c) and (d) the mean in- and out-degrees of the controlled
oscillators, denoted $\langle k^{\text{in/out}}\rangle$ as a function of
overall coupling $\langle k\rangle K$ for row and column control,
respectively. Beginning with row control in panel (c), we observe first that
it is the in-degree of the oscillators that primarily dictate their inclusion
or exclusion from the control set, while the out-degree plays a negligible
role. This is perhaps not surprising due to the application of the Gershgorin
circle theorem along rows, and is further verified by inspecting network
ensembles with correlated in- and out-degrees, included in the Supplemental
Material (SM). More interestingly, the overall coupling causes a transition in
the properties of the oscillators that require control. Namely, when the
coupling is relatively small (say, $\langle k\rangle K\leq 3$) the oscillators
that require control tend to have large in-degrees, whereas the when the
coupling is relatively large (say, $\langle k\rangle K\leq 3$), the
oscillators that require control tend to have small in-degrees. This can be
explained by the degree of disorder imposed by smaller vs larger coupling as
follows. When the disorder in the dynamics is high (from small coupling) the
effect of one oscillator on another via a link is destabilizing, and therefore
those with more incoming links is more likely to require control to become
entrained. On the other hand, when the disorder in the dynamics is low (from
larger coupling) the effect of one oscillator on another via a link is
stabilizing, and an oscillator with many incoming links is more likely to be
entrained spontaneously without intervention. Moving to column control in
panel (d) the role of in- vs out-degrees is much more clear, as column-
controlled oscillators tend to balance larger out-degrees with lower in-
degrees. Mathematically this can be explained: in the limit of strong coupling
the target phases all take small values resulting the approximation
$c_{ij}=\cos(\theta_{j}^{*}-\theta_{i}^{*})\approx 1$, in which case the
application of the Gershgorin circle theorem easily yields control for column
$j$ if $k_{j}^{\text{out}}>k_{j}^{\text{in}}$. Moreover, these local
properties reveal a larger role of column controlled oscillators as those that
have a relatively strong influence on other oscillators within the network.
Thus, while row control achieves control by directly identifying those
oscillators that require control, column control does so via the more indirect
method of stabilizing those oscillators that have a strong influence on others
to entrain the full system.

Figure 3: Dual control of the IEEE 39 New England power grid. (a) The 39-node
IEEE New England power grid network, denoting loads and sources as small
(inner) and large (outer) nodes. Natural frequencies and damping coefficients
are provided in the SM. Row and column controlled oscillators are colored blue
and red, respectively. Time series for collection of (b),(d) phases and
(c),(e) frequencies are plotted before ($t<0$) and after ($t\geq 0$) control
is applied.

Lastly, we present an example application using the IEEE 39 New England power
grid network Athay1979IEEE . We first emphasize that, while a directed network
structure is needed to realize different row and column strategies for an
oscillator network, the presence of heterogeneous system parameters, e.g.,
damping, may give rise to effectively directed network structures even when
the underlying topology is undirected. Noting that Kuramoto oscillator systems
serve as models for a variety of types of power grids Dorfler2012SIAM ;
SimpsonPorco2013Automatica ; Dorfler2013PNAS ; Nishikawa2015NJP  we consider
the IEEE 39 New England power grid network with the following oscillator model

$\displaystyle
D_{i}\dot{\phi}_{i}=p_{i}+K\sum_{j=1}^{N}a_{ij}\sin(\phi_{j}-\phi_{i}),$ (8)

where, even for an undirected topology encoded in the entries $a_{ij}$,
heterogeneity in the damping coefficients $D_{i}$ yield an effectively
directed adjacency matrix entries $A_{ij}=a_{ij}/D_{i}$, as well as effective
natural frequencies given by the ratio of the power and damping,
$\omega_{i}=p_{i}/D_{i}$. In Fig. 3(a) we illustrate the topology of the power
grid, with small inner nodes corresponding to loads and large outer nodes
corresponding to sources. Damping coefficients $D_{i}$ and power $p_{i}$ are
chosen randomly, with power biased positive or negative for sources and loads,
respectively. (Power and damping coefficients are given in the SM.) We then
implement both row and column control, coloring row and column controlled
oscillators blue and red, respectively, then plot the time series for the
phases before ($t<0$) and after ($t\geq 0$) control in panels (b) and (d). We
also plot the time series of actual frequencies $d\theta/dt$ in panels (c) and
(e). We observe that in this particular network structure, column control
converges faster to synchronization, prioritizing column control versus row
control. This observation is in perfect agreement with the rationale we have
explained before.

To conclude, we have contributed to the understanding of reactive control in
systems of heterogeneous phase oscillators’ network, scrutinizing the dual
strategy of row-column control. We have proven that different network
topologies can be controlled optimally depending on its structure, by directly
targeting oscillator that are difficult to entrain (row), or targeting
oscillators with strong influence on others (column). The particular role of
each oscillator in the reactive control process is revealed from its algebraic
contribution on the specific control strategy. These results are proven to be
applicable to real networks, and pave the way for further studies on
controlling power-grid and micro-grid networks, and we speculate can even have
application on neuroscience, targeting specific brain areas to
(de-)synchronize neural activity.

###### Acknowledgements.

P.S.S. acknowledges financial support from NSF grant No. MCB-2126177. A.A.
acknowledges financial support from the Spanish MINECO (Grant No.
PGC2018-094754-B-C2), from Generalitat de Catalunya (grant No. 2017SGR-896),
Universitat Rovira i Virgili (grant No. 2019PFR-URV-B2-41), and the James S.
McDonnell Foundation (grant #220020325).

## References

  * [1] S. H. Strogatz, Sync: the Emerging Science of Spontaneous Order (Hypernion, 2003).
  * [2] A. Pikovsky, M. Rosenblum, and J. Kurths, Synchronization: A Universal Concept in Nonlinear Sciences (Cambridge University Press, 2003).
  * [3] A. Arenas, A. Díaz-Guilera, J. Kurths, Y. Moreno, C. Zhou, Synchronization in complex networks, Phys. Rep. 469, 93 (2008).
  * [4] A. Prindle, P. Samayoa, I. Razinkov, T. Danino, L. S. Tsimring, and J. Hasty, A sensing array of radically coupled genetic ’biopixels’, Nature 481, 39 (2012).
  * [5] L. Glass and M. C. Mackey, From Clocks to Chaos: The Rhythms of Life (Princeton University Press, Princeton, 1988).
  * [6] M. Rohen, A. Sorge, M. Timme, and D. Witthaut, Self-organized synchronization in decentralized power grids, Phys. Rev. Lett. 109, 064101 (2012).
  * [7] S. P. Cornelius, W. L. Kath, and A. E Motter, Realistic control of network dynamics, Nat. Commun. 4, 1942 (2012).
  * [8] G. Yan, J. Ren, Y.-C. Lai, C.-H. Lai, B. Li, Controlling complex networks: How much energy is needed? Phys. Rev. Lett. 108, 218703 (2012).
  * [9] Y.-Y. Liu, J.-J. Slotine, and A.-L. Barabási, Controllability of complex networks, Nature 473, 167 (2011).
  * [10] Z. Yuan, C. Zhao, Z. Di, W.-X. Wang, and Y.-C. Lai, Exact controllability of complex networks, Nat. Commun. 4, 2447 (2013).
  * [11] J. Sun and A. E. Motter, Controllability transition and nonlocality in network control, Phys. Rev. Lett. 110, 208701 (2013).
  * [12] G. Menichetti, L. Dall’Asta, and G. Bianconi, Network controllability is determined by the density of low in-degree and out-degree nodes, Phys. Rev. Lett. 113, 078701 (2014).
  * [13] F. Pasqualetti, S. Zampieri, and F. Bullo, Controllability metrics, limitations and algorithms for complex networks, IEEE Trans. Control Netw. Syst. 1, 40 (2014).
  * [14] T. Menara, D. S. Bassett, and F. Pasqualetti, Structural controllability of symmetric networks, IEEE Trans. Autom. Control, 4, 3740 (2019).
  * [15] A. N. Montanari, C. Duan, L. A. Aguirre, and A. E. Motter, Functional observability and target state estimation in large-scale networks, Proc. Natl. Acad. Sci. U.S.A., 119, e2113750119 (2022).
  * [16] C. Duan, T. Nishikawa, and A. E. Motter, Prevalence and scalable control of localized networks, Proc. Natl. Acad. Sci. U.S.A., 119, e2122566119 (2022).
  * [17] F. C. Hoppensteadt and E. M. Izhikevich, Oscillatory neurocomputers with dynamic connectivity, Phys. Rev. Lett. 82, 2983 (1999).
  * [18] P. S. Skardal, D. Taylor, and J. Sun, Optimal synchronization of complex networks, Phys. Rev. Lett. 113, 144101 (2014).
  * [19] M. Fazlyab, F. Dörfler, and V. M. Preciado, Optimal network design for synchronization of coupled oscillators, Automatica 84, 181 (2017).
  * [20] A. Forrow, F. G. Woodhouse, and J. Dunkel, Functional control of network dynamics using designed Laplacian spectra, Phys. Rev. X 8, 041043 (2018).
  * [21] T. Menara, G. Baggio, D. S. Bassett, and F. A. Pasqualetti, A framework to control functional connectivity in the human brain, In IEEE Conf. on Decision and Control, Nice, France, December 2019, 4697 (IEEE, 2019).
  * [22] G. Baggio, D. S. Bassett, and F. Pasqualetti, Data-driven control of complex networks, Nat. Commun. 12, 1429 (2021).
  * [23] T. Menara, G. Baggio, D. S. Bassett, and F. Pasqualetti, Functional control of oscillator networks, Nat. Commun. 13, 4721 (2022).
  * [24] R. O. Grigoriev, M. C. Cross, and H. G. Schuster, Pinning control of spatiotemporal chaos, Phys. Rev. Lett. 79, 2795 (1997).
  * [25] X. F. Wang and G. Chen, Pinning control of scale-free dynamical networks, Phys. A 310, 521 (2002).
  * [26] X. Li, X. F. Wang, and G. Chen, Pinning a complex dynamical network to its equilibrium, IEEE Trans. Circuits Syst. I: Fundam. Theory Appl. 51, 2074 (2004).
  * [27] P. S. Skardal and A. Arenas, Control of coupled oscillator networks with application to microgrid technologies, Sci. Adv. 1, e1500339 (2015).
  * [28] Y. Kuramoto, Chemical Oscillations, Waves, and Turbulence (Springer, New York, 1984).
  * [29] A. Ben-Israel and T. N. E. Grenville, Generalized Inverses (Springer, New York, 1974).
  * [30] P. S. Skardal, D. Taylor, and J. Sun, Optimal synchronization of directed complex networks, Chaos 26, 094807 (2016).
  * [31] P. S. Skardal, D. Taylor, J. Sun, and A. Arenas, Collective frequency variation in network synchronization and reverse PageRank, Phys. Rev. E 93, 042314.
  * [32] G. H. Golub and C. F. Van Loan, Matrix Computations (Johns Hopkins University Press, Baltimore, 1996).
  * [33] A. Békéssy, P. Bekessy, and J. Komlós, Asymptotic enumeration of regular matrices, Stud. Sci. Math. Hung., 7, 343 (1972).
  * [34] T. Athay, R. Podmore, and S. Virmani, A practical method for the direct analysis of transient stability, IEEE Trans. Power Appar. Syst. 2, 573 (1979)
  * [35] F. Dörfler and F. Bullo, Synchronization and transient stability in power networks and nonuniform Kuramoto oscillators, SIAM J. Control Optim. 50, 1616 (2012).
  * [36] J. W. Simpson-Porco, F. D’orfler, and F. Bullo, Synchronization and power sharing for droop-controlled inverters in islanded microgrids, Automatica 49, 2603 (2013).
  * [37] F. Dörfler, M. Chertkov, and F. Bullo, Synchronization in complex oscillator networks and smart grids, Proc. Natl. Acad. Sci. U.S.A. 110, 2005 (2013).
  * [38] T. Nishikawa and A. E. Motter, Comparative analysis of existing models for power-grid synchronization, New J. Phys. 17, 015012 (2015).

Supplemental Material to “Dual control of coupled oscillator networks”

Here we present addition results for the dual control of coupled oscillator
networks. First, we consider the structural properties of row and column
control in networks with in- and out-degree correlations. Next, we present
numerical details for the model used and presented in Fig. 3 in the main text.
Lastly, we describe some practical considerations used in control simulations
in the main text.

##  I Networks Properties of row and column control: in- and out-degree
correlations

We begin with the network properties of row and column control. We investigate
the control fraction $f_{c}$ for row and column control, the overlap between
the row and column control sets, and the mean control degrees $\langle
k^{\text{in/out}}\rangle$ for the row and column control sets. As in the
results presented in Fig. 2 in the main text, we consider an ensemble of 500
networks of size $N=200$ generated using the configuration model [1] with
power-law in- and out-degree distributions with minimum degree $k_{0}=9$ and
normally distributed natural frequencies. Here, however, rather than leaving
nodal in- and out-degrees uncorrelated, we consider assortatively and
diassortatively mixed networks, i.e., positive and negative correlationg
between in- and out degrees, respectively. To attain these correlations, we
simply match the largest in- degree with the largest or smallest out-degrees
for assortative or disassortative networks, respectively, then to ensure some
randomness, randomly swap the out-degrees of 2% of the assigned nodes.

Figure 1: Network properties of row and column control: assortative and
disassortative networks. For ensembles of $500$ networks with $N=200$ nodes,
power-law exponent $\gamma=3$, minimum degree $k_{0}=9$, and normally
distributed natural frequencies with assortative (top row) and disassortative
(bottom row) in- and out-degrees, (a),(e) the mean control fraction $f_{c}$
for row (blue circles) and column control (red crosses) as a function of
overal coupling, $\langle k\rangle K$, (b),(f) the overlap fraction (green
triangles) compared to independence and subset approximations (dashed and dot-
dashed black curves). For the same ensemble of networks, the mean control in-
and out-degrees $\langle k^{\text{in/out}}\rangle_{\text{control}}$ as a
function of overall coupling (c),(g) row and (d),(h) column control.

In Fig. 1 we plot our results. For assortative networks (top row) we plot the
control fraction $f_{c}$ for row and column control (blue circles and red
crosses, respectively) in panel (a), the overlap fraction (green triangles)
compared to the independence and subset approximations (dashed and dot-dashed
curves, respectively) in panel (b), and the mean in- and out degrees $\langle
k^{\text{in}}\rangle$ and $\langle k^{\text{out}}\rangle$ (blue circles and
red crosses, respectively) for row and column control in panels (c) and (d),
respectively. Similarly, for disassortive networks (bottom row) we plot the
control fraction $f_{c}$ for row and column control (blue circles and red
crosses, respectively) in panel (e), the overlap fraction (green triangles)
compared to the independence and subset approximations (dashed and dot-dashed
curves, respectively) in panel (f), and the mean in- and out degrees $\langle
k^{\text{in}}\rangle$ and $\langle k^{\text{out}}\rangle$ (blue circles and
red crosses, respectively) for row and column control in panels (g) and (h),
respectively.

Importantly, the results in Fig. 1 are qualitatively equivalent to those in
Fig. 2 in the main text, suggesting that our general results are not specific
only to uncorrelated networks. Moreover, in panels (c) and (d) we see in fact
that the out-degree plays little role in shaping the row control set, as
suggested in the main text.

##  II Numerical specifications of the power grid model

Next we provide the numerical parameter choices for the power grid model
presented in Fig. 3 in the main text, namely, the damping coefficient,
$D_{i}$, and power, $p_{i}$, for each oscillator in the network. First, in
Fig. 2 we illustrate the network topology of the IEEE 39 New England power
grid [2] with assigned node indices, $i=1,\dots,39$, where oscillators
$i=1,\dots,29$ (inner, smaller nodes) represent loads and oscillators
$i=30,\dots,39$ (outer, larger nodes) represent sources.

Figure 2: IEEE 39 New England power grid topology. Labeled indices
$i=1,\dots,39$.

Each oscillator $i$ is then assigned a damping coefficient $D_{i}$ and power
$p_{i}$, summarized below. Note that damping coefficients were chosen
uniformly at random from the interval $[0.25,2.0]$, power was chosen randomly
from one or two normal distributions to ensure that power for loads and
sources were biased negative and positive, respectively. Damping and power for
each oscillator are given in Table 1.

oscillator index, $i$ | damping, $D_{i}$ | power, $p_{i}$ | oscillator index, $i$ | damping, $D_{i}$ | power, $p_{i}$
---|---|---|---|---|---
1 | 1.7476 | -1.0697 | 21 | 0.7782 | -0.1882
2 | 1.7524 | -1.1012 | 22 | 0.4248 | -0.1793
3 | 1.2024 | -0.0432 | 23 | 0.4054 | -0.1483
4 | 1.5625 | -0.2034 | 24 | 0.2576 | -0.1725
5 | 0.6620 | -0.2707 | 25 | 0.8430 | -1.0895
6 | 0.8039 | -0.5232 | 26 | 1.7572 | -1.1754
7 | 0.5685 | -0.4292 | 27 | 1.6242 | -0.6843
8 | 1.7742 | -1.4545 | 28 | 1.1599 | -1.1214
9 | 0.2117 | -0.1619 | 29 | 0.8356 | -0.6385
10 | 1.3095 | -0.5943 | 30 | 0.2300 | 0.4905
11 | 0.8068 | -0.3648 | 31 | 1.4356 | 2.3489
12 | 1.3422 | -0.0851 | 32 | 1.3115 | 2.2129
13 | 0.4043 | -0.2099 | 33 | 0.2642 | 0.3284
14 | 0.3241 | -0.1242 | 34 | 1.3747 | 2.2736
15 | 1.1092 | -0.8078 | 35 | 1.4981 | 2.8988
16 | 1.6324 | -0.7955 | 36 | 0.3036 | 0.3549
17 | 1.1775 | -1.0406 | 37 | 0.9786 | 1.5221
18 | 1.4898 | -0.4910 | 38 | 1.7897 | 2.8252
19 | 0.2544 | -0.2414 | 39 | 0.8235 | 1.4619
20 | 1.1897 | -0.5919 | – | – | –
Table 1: Numerical parameters values for the power grid model.

##  III Practical considerations used in control simulations

Lastly, we present some practical considerations that go into control
simulations, specifically those results presented in Figs. 1 and 3 in the main
text. In particular, a main component of the control paradigm presented in the
main text involves the identification of a target state, for which we
linearize the system dynamics, i.e., moving from Eq. (1) to Eq.(3) in the main
text. This linearization is of course an approximation whose accuracy may vary
depending on the network topology, natural frequencies, and coupling strength.
Thus, sufficient loss of accuracy may lead to failure of the control method
unless certain precautions are taken. In particular, we find that two
particular practical steps may be taken to improve the success of the control
mechanism.

The first practical step we take is to adjust the target state to better
represent a target state obtained by solving the nonlinear system (i.e., one
involving arcsines). For this we introduce a parameter $\epsilon_{K}$ which we
use to modify the target state, specifically to use the target state

$\displaystyle\bm{\theta}^{*}=\frac{L^{\dagger}(\bm{\omega}-\bm{\Omega})}{K(1-\epsilon_{K})}.$
(1)

Here we assume that $\epsilon_{K}$ is positive and relatively small, so that
the target state is slightly expanded, i.e., more spread out, than without
$\epsilon_{K}$. In the main text we use $\epsilon_{K}=0.2$.

The second practical step we take is to add a margin of error in our
identification of control oscillators depending on the rows/columns of the
Jacobian. Ultimately, we seek to err on the conservative side and rather add a
handful of addition oscillators to the control sets to overcome inaccuracies
from approximations. For this purpose, we introduce a parameter
$\epsilon_{DF}$ that is applied slightly differently in the row and column
control strategies. For row control, rather than identifying entries of $DF$
where a link $j\to i$ exists and $DF_{ij}<0$, we allow for some margin of
error by controlling oscillator $i$ if row $i$ contains an entry for which
$j\to i$ and $DF_{ij}<\epsilon_{DF}$. For column control, we simply impose
impose control on oscillator $j$ if the $j^{\text{th}}$ Gershgorin disc is
within $\epsilon_{DF}$ of the right-side complex plane. Similar to
$\epsilon_{K}$, we assume that $\epsilon_{DF}$ is positive and relatively
small, so that some additional margin of error is given to ensure that
eigenvalues of the Jacobian are pushed into the left half complex plane. In
the main text we use $\epsilon_{DF}=0.2$.

## References

  * [1] A. Békéssy, P. Bekessy, and J. Komlós, Asymptotic enumeration of regular matrices, Stud. Sci. Math. Hung., 7, 343 (1972).
  * [2] T. Athay, R. Podmore, and S. Virmani, A practical method for the direct analysis of transient stability, IEEE Trans. Power Appar. Syst. 2, 573 (1979)