[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"doc-seo-657268-105":3,"detail-sidebar-cat-0-en-105":81,"doc-detail-657268-en":130},{"code":4,"msg":5,"data":6},0,"ok",{"site_id":7,"language":8,"slug":9,"title":10,"keywords":11,"description":12,"schema_data":13,"social_meta":74,"head_meta":76,"extra_data":78,"updated_unix":80},105,"en","a-categorical-framework-for-modeling-with-stock-and-flow-diagrams","A Categorical Framework for Modeling with Stock and Flow Diagrams","","Stock-and-flow diagrams are widely used in infectious disease epidemiology, yet category theory provides a way to treat them as mathematical objects rather than only visual aids. This chapter presents communicable-disease models built with StockFlow.jl to motivate the categorical framework. It clarifies the separation between diagram syntax and semantics, shows implemented semantic examples (ODEs, causal loop diagrams, and system structure diagrams), and presents modular construction methods via composition and stratiﬁcation, ending with ModelCollab for collaborative diagram-based modeling.",{"@graph":14,"@context":73},[15,34,56],{"@type":16,"itemListElement":17},"BreadcrumbList",[18,23,27,31],{"item":19,"name":20,"@type":21,"position":22},"https://docshare.wps.com","Home","ListItem",1,{"item":24,"name":25,"@type":21,"position":26},"https://docshare.wps.com/document/","Document",2,{"item":28,"name":29,"@type":21,"position":30},"https://docshare.wps.com/document/research-report/","Research & Report",3,{"item":32,"name":10,"@type":21,"position":33},"https://docshare.wps.com/document/a-categorical-framework-for-modeling-with-stock-and-flow-diagrams/657268/",4,{"url":32,"name":10,"@type":35,"image":36,"author":41,"headline":10,"publisher":44,"fileFormat":47,"inLanguage":8,"description":12,"dateModified":48,"datePublished":49,"encodingFormat":47,"isAccessibleForFree":50,"interactionStatistic":51},"DigitalDocument",{"url":37,"@type":38,"width":39,"height":40},"https://docshare.wps.com/thumbnails/a-categorical-framework-for-modeling-with-stock-and-flow-diagrams/657268.png","ImageObject",300,407,{"name":42,"@type":43},"noah","Person",{"url":19,"name":45,"@type":46},"DocShare","Organization","application/pdf","2026-10-29","2026-10-26",true,{"@type":52,"interactionType":53,"userInteractionCount":55},"InteractionCounter",{"@type":54},"ViewAction",7,{"@type":57,"mainEntity":58},"FAQPage",[59,65,69],{"name":60,"@type":61,"acceptedAnswer":62},"What is the main idea of using category theory with stock-and-flow diagrams?","Question",{"text":63,"@type":64},"The chapter argues that category theory lets stock-and-flow diagrams be treated as mathematical entities in their own right, going beyond their usual role as visual tools in epidemiology.","Answer",{"name":66,"@type":61,"acceptedAnswer":67},"How does the chapter distinguish diagram syntax from diagram semantics?",{"text":68,"@type":64},"It emphasizes a clear separation between the syntax of stock-and-flow diagrams and their semantics, then demonstrates semantic interpretations already implemented in the software.",{"name":70,"@type":61,"acceptedAnswer":71},"How are large stock-and-flow diagrams built from smaller ones in this framework?",{"text":72,"@type":64},"It introduces two modular methods for constructing larger diagrams from smaller ones: composition and stratification.","https://schema.org",{"og:url":32,"og:type":75,"og:title":10,"og:site_name":45,"og:description":12},"article",{"robots":77,"canonical":32},"index,follow",{"doc_id":79,"site_id":7},657268,1793074474,{"code":4,"msg":82,"data":83},"success",[84,88,92,96,101,106,110,114,119,122,126],{"id":22,"doc_module":4,"doc_module_name":25,"category_name":85,"show_sort_weight":86,"slug":87},"Story & Novel",90,"story-novel",{"id":26,"doc_module":4,"doc_module_name":25,"category_name":89,"show_sort_weight":90,"slug":91},"Literature",80,"literature",{"id":33,"doc_module":4,"doc_module_name":25,"category_name":93,"show_sort_weight":94,"slug":95},"Exam",70,"exam",{"id":97,"doc_module":4,"doc_module_name":25,"category_name":98,"show_sort_weight":99,"slug":100},5,"Comic",60,"comic",{"id":102,"doc_module":4,"doc_module_name":25,"category_name":103,"show_sort_weight":104,"slug":105},6,"Technology",50,"technology",{"id":55,"doc_module":4,"doc_module_name":25,"category_name":107,"show_sort_weight":108,"slug":109},"Healthcare",40,"healthcare",{"id":111,"doc_module":4,"doc_module_name":25,"category_name":29,"show_sort_weight":112,"slug":113},8,30,"research-report",{"id":115,"doc_module":4,"doc_module_name":25,"category_name":116,"show_sort_weight":117,"slug":118},9,"Religion & Spirituality",20,"religion-spirituality",{"id":117,"doc_module":4,"doc_module_name":25,"category_name":120,"show_sort_weight":117,"slug":121},"World Cup","world-cup",{"id":123,"doc_module":4,"doc_module_name":25,"category_name":124,"show_sort_weight":123,"slug":125},10,"Lifestyle","lifestyle",{"id":127,"doc_module":4,"doc_module_name":25,"category_name":128,"show_sort_weight":97,"slug":129},19,"General","general",{"code":4,"msg":82,"data":131},{"doc_id":79,"user_id":132,"nickname":42,"user_avatar":133,"doc_module":4,"category_id":111,"category_name":29,"doc_title":10,"doc_description":12,"doc_content":134,"file_id":135,"file_url":136,"file_type":137,"file_size":138,"view_count":55,"is_deleted":4,"is_public":22,"is_downloadable":22,"audit_status":22,"page_count":139,"language":140,"language_code":8,"site_id":7,"html_lang":8,"table_of_contents":141,"faqs":142,"seo_title":143,"seo_description":12,"update_tm":144,"read_time":145},1099529839121,"https://ap-avatar.wpscdn.com/davatar_994ba38a5ba835b3df7d355c54d3ed8d","A Categorical Framework for Modeling with Stock and Flow Diagrams  \nJohn C. Baez, Xiaoyan Li, Sophie Libkind, Nathaniel D. Osgood, Eric Redekopp  \nAbstract Stock and ﬂow diagrams are already an important tool in epidemiology, but category theory lets us go further and treat these diagrams as mathematical entities in their own right. In this chapter we use communicable disease models created with our software, StockFlow.jl, to explain the beneﬁts of the categorical approach. We ﬁrst explain the category of stock-ﬂow diagrams and note the clear separation between the syntax of these diagrams and their semantics, demonstrating three examples of semantics already implemented in the software: ODEs, causal loop diagrams, and system structure diagrams. We then turn to two methods for building large stock-ﬂow diagrams from smaller ones in a modular fashion: composition and stratiﬁcation. Finally, we introduce the open-source ModelCollab software for diagram-based collaborative modeling. The graphical user interface of this webbased software lets modelers take advantage of the ideas discussed here without any knowledge of their categorical foundations.  \nJohn C. Baez  \nDepartment of Mathematics, University of California, Riverside CA 92507, USA, e-mail: baez@ [math.ucr.edu](math.ucr.edu)  \nXiaoyan Li  \nDepartment of Computer Science, University of Saskatchewan, Saskatoon, SK, S7N 5C9, Canada, e-mail: [xiaoyan.li@usask.ca](xiaoyan.li@usask.ca)  \nSophie Libkind  \nDepartment of Mathematics, Stanford University, Palo Alto, CA, 94305, USA, e-mail: slibkind@ [stanford.edu](stanford.edu)  \nNathaniel D. Osgood  \nDepartment of Computer Science, University of Saskatchewan, Saskatoon, SK, S7N 5C9, Canada, [e-mail:](e-mail: nathaniel.osgood@usask.ca)[ nathaniel.osgood@usask.ca](e-mail: nathaniel.osgood@usask.ca)  \nEric Redekopp  \nDepartment of Computer Science, University of Saskatchewan, Saskatoon, SK, S7N 5C9, Canada, e-mail: [eric.redekopp@usask.ca](eric.redekopp@usask.ca)  \n2 John C. Baez, Xiaoyan Li, Sophie Libkind, Nathaniel D. Osgood, Eric Redekopp  \n1 Introduction  \nMathematical modeling of infectious disease at scale is important, but challenging. There are many beneﬁts to the modeling process extending from taking diagrams as mathematical formalisms in their own right with the help of category theory. Stock and ﬂow diagrams are widely used in infectious disease modeling, so we illustrate this point using these. However, rather than focusing on the underlying mathematics, we informally use communicable disease examples created with our software, called StockFlow.jl [32], to explain the beneﬁts of the categorical framework. Readers interested in the mathematical details may refer to our earlier paper [7] .  \nMany compartmental modelers regard diagrams o􀀛ering a visual characterization of structure􀀖e.g., susceptible, infective and recovered stocks and transitions between them􀀖as broadly accessible but informal steps towards a mathematically rigorous formulation in terms of ordinary di􀀛erential equations (ODEs) . However, ODEs are typically opaque to non-modelers􀀖including the interdisciplinary members of the teams that typically are required for impactful models. By contrast, the System Dynamics modeling tradition places a premium on engagement with stakeholders [15], and o􀀛ers a modeling approach centered around diagrams. This approach commonly proceeds in a manner that depicts model structure using successively more detailed models. The process starts with a 􀀐causal loop diagram􀀑 illustrating causal connections and feedback loops (Figure 6) . It then often proceeds to a 􀀐system structure diagram􀀑, which distinguishes stocks from ﬂows but still lacks quantitative information. The next step is to construct a stock and ﬂow diagram􀀖or henceforth,􀀐stock-ﬂow diagram􀀑 (Figure 1) . This diagram is visually identical to the system structure diagram, but it also includes formulae, values for parameters, and initial values of stocks.  \nThe stock􀀕ﬂow","cbCaitFMJmXTE9b8","https://ap.wps.com/l/cbCaitFMJmXTE9b8","pdf",18980211,62,"English","# Introduction\n## Limitations of traditional System Dynamics modeling\n## Monolithic models\n## Curse of stratification dimensionality","[{\"question\":\"What is the main idea of using category theory with stock-and-flow diagrams?\",\"answer\":\"The chapter argues that category theory lets stock-and-flow diagrams be treated as mathematical entities in their own right, going beyond their usual role as visual tools in epidemiology.\"},{\"question\":\"How does the chapter distinguish diagram syntax from diagram semantics?\",\"answer\":\"It emphasizes a clear separation between the syntax of stock-and-flow diagrams and their semantics, then demonstrates semantic interpretations already implemented in the software.\"},{\"question\":\"How are large stock-and-flow diagrams built from smaller ones in this framework?\",\"answer\":\"It introduces two modular methods for constructing larger diagrams from smaller ones: composition and stratification.\"}]","A Categorical Framework for Modeling with Stock and Flow Diagrams | PDF",1792976490,156]