bradcarman / ModelingToolkitDesigner.jl

A helper tool for visualizing and editing a ModelingToolkit.jl system connections
MIT License
95 stars 2 forks source link

Visualisation of GCE economic model and automatic translation to MTK OD(A)E system #13

Open finmod opened 11 months ago

finmod commented 11 months ago

@bradcarman Just discovered ModelingToolkitDesigner, long promised by ChrisRackauckas. Can you you give a look at this previous effort https://github.com/ai4energy/Ai4EComponentLib.jl/blob/main/docs/src/tutorials/EconomyGCDModel_A1.md to convert a diagram of a constrained dynamic economic model into an MTK problem. The original diagram is here: Model A1.pdf

Allthough the Ai4Energy proposal does the job nicely for a first approach, the connectors and the individual stocks and flows could be handled better by your approach. The diagram itself could be further improved toward a direct correspondance between arrows/flows of money, labor and goods between agents (household and firms) and markets (labour, goods and money/assets). The major advantage of ModelingToolkitDesigner is that it is already fully embedded in Julia MTK.

bradcarman commented 11 months ago

Hi @finmod, the model you link to has 2 components with 1 connection. The current realization of this package will then provide simply a diagram with 2 boxes and a line connecting them. It seems you are looking for something more than that?

finmod commented 11 months ago

Thank you @bradcarman . Yes, it is correct: 2 components-agents (household and firms). Instead in the ModelA1.pdf diagram, you can see that there are 4 connections corresponding to flow supply and demand for money, goods and labour. This diagram is the one that I would like ModelingToolkitDesigner to translate accurately into an ODAE system in MTK.

My intuition is that MTD provides much more flexible connectors than what has been available so far from MTKStandardLibrary. Then, there is the issue of accounting laws for stocks and transaction identities for flow to be respected.