Comments (4)
I would like to be able to put in multiple levels of categorization given information known at compile-time. Could either the subtype be extended to support a named tuple of symbols, or could there be an additional flags which allows a set of Symbol flags (also preferably as a named tuple).
No, why do you want so much compile-time information in there? That would be very bad for performance. We want to leave subtype
strictly typed since it'll be touched in many different ways so it needs to be performant. However, adding an untyped flag
field for some extra pieces might be useful (which are distinct from value
). It just hasn't been added since it hasn't been needed yet. Feel free to add it in a PR where you need it for some functionality.
from modelingtoolkit.jl.
The question is whether you are trying to put in enough flexibility to allow people to experiment with the library without modifying it (and potentially breaking other users). I understand your approach to leave all features until you need them... it is a consistent approach as long as you know how you would design it later.
I am not about to go and design a DSGE model anytime soon, but if the interface doesn't support having a 2nd level of categorization (where totally different code would be generated based on it) then it wouldn't work for that application. The classic example is the categorization of variables into predetermined or not. You organize matrices in very different ways, check different eigenvalues, etc. If you are curious, you can see this in http://www.wouterdenhaan.com/numerical/BKconditionsslides.pdf
For my immediate needs in solving continuous time methods, I am not sure I need it.
Whether that needs to be available at compile-time is a design question for you. I come from a C++ TMP mindset where you almost always want type-safe compile-time information if possible in order to generate specialized algorithms, but maybe that is the wrong approach in Julia.
from modelingtoolkit.jl.
Whether that needs to be available at compile-time is a design question for you. I come from a C++ TMP mindset where you almost always want type-safe compile-time information if possible in order to generate specialized algorithms, but maybe that is the wrong approach in Julia.
Well the issue here is that this isn't really "Julia" proper. If you want to be technical, it's an IR written in Julia, which uses Julia as the compiler. Essentially this is a human-readable compiler language for scientific computing models. I would never write Julia code like this, but the Julia code it produces is type-stable which is what matters for performance. This kind of code pretty much will not be fully inferrable given the transformations it's doing, but it's not the code that any solvers will see since it will have to pass through the compilation process. I hope that explains why this throws out all of the "Julia best practices".
That said,
I am not about to go and design a DSGE model anytime soon, but if the interface doesn't support having a 2nd level of categorization (where totally different code would be generated based on it) then it wouldn't work for that application. The classic example is the categorization of variables into predetermined or not. You organize matrices in very different ways, check different eigenvalues, etc. If you are curious, you can see this in http://www.wouterdenhaan.com/numerical/BKconditionsslides.pdf
If you need it, then we can add it. It would just be an untyped field which by default gets a nothing
, but you can put whatever struct you want in there. I can't think of a better data structure, since forcing an untyped NamedTuple is odd since that won't infer anyways, while a Vector{Pair{Symbol,Any}}
would give weird promotion issues all the time.
from modelingtoolkit.jl.
from modelingtoolkit.jl.
Related Issues (20)
- Load error with @mtkbuild HOT 7
- Solve step fails with array variables
- Support `remake` to update individual variables/species in new MTK version HOT 7
- Erroe when plotting observed variable(s) HOT 3
- ModelingToolkit does not save array as static arrays (for initial conditions and parameter values)
- Model linearization fails when no parameter is used HOT 4
- Wrapping `connector` subcomponents into a `@connector` generates undsired equations
- Internation functions for conversion between various forms of representing states/parameters etc. (e.g. symbolics or indexes) HOT 5
- `initializesystem` needs to handle independent variable HOT 2
- UndefVarError: `issymbollike` not defined HOT 2
- Use SPEX for Bareiss
- ERROR: LinearAlgebra.SingularException(10) with MTK v8.74+ HOT 4
- @mtkmodel gives "LoadError: Could not parse 0 of component..." HOT 2
- Move `@variables` and `@parameters` defaults to the `ODESystem` `defaults` keyword to support defaults that depend on components. Or add a @defaults block to support out of order defaults manually. HOT 1
- `structural_simplify` does not seem to include `dae_index_lowering` anymore HOT 2
- Cannot access observed variables in NonlinearSolution HOT 1
- Events for @mtkmodel components HOT 5
- "Ignore" option for connectors
- Support for simulation of hybrid systems HOT 2
- Inconsistency when passing parameters to sub components
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from modelingtoolkit.jl.