Herman Sletmoen

Results 131 comments of Herman Sletmoen

I think this happens because [this `val`](https://github.com/SciML/ModelingToolkit.jl/blob/a8ed1c866e4fb85128ccc44bf032a0469e0391a3/src/systems/problem_utils.jl#L164) is a ``` ModelingToolkit.StructuralTransformations.change_origin(CartesianIndex(0,), SymbolicUtils.BasicSymbolic{Real}[(x(t))[0], (x(t))[1]]) ``` This wraps the 0-based array inside [a registered 1-indexed array symbolic function](https://github.com/SciML/ModelingToolkit.jl/blob/a8ed1c866e4fb85128ccc44bf032a0469e0391a3/src/structural_transformation/symbolics_tearing.jl#L976). So indexing it at...

Is [this hack](https://github.com/SciML/ModelingToolkit.jl/blob/a8ed1c866e4fb85128ccc44bf032a0469e0391a3/src/systems/nonlinear/initializesystem.jl#L759) what is supposed to handle the `change_origin` wrapping?

> 1. We want to truncate namespaces in compressed printing mode I am open to suggestions on how to handle namespacing in this PR. Now it applies any custom Latex...

For example, consider a simplified example of the [big RC circuit tutorial](https://docs.sciml.ai/ModelingToolkit/dev/examples/tearing_parallelism/): ```julia using ModelingToolkit using ModelingToolkit: t_nounits as t, D_nounits as D # Basic electrical components @connector function Pin(;...

@wang890 That's nice! Maybe too much for the default `show()` method, though. I noticed `AbstractSystem` already implements most of the [AbstractTrees interface](https://github.com/JuliaCollections/AbstractTrees.jl/). I have tried to make this easier to...

Question: what are "extra" equations? Before this PR (and still, I haven't changed this), `show()` counts ```julia neqs = count(eq -> !(eq.lhs isa Connection), eqs) next = n_extra_equations(sys) ``` and...

I am, yes. That just comes on top. I left them out of my question, since there are `0` (since it is before structural simplification). To be complete, I would...

My best guess is that `n_extra_equations()` counts how many equations all the connector equations *expands to*; i.e. equivalent to ```julia function n_extra_equations(sys) nexpand = length(equations(expand_connections(sys))) # number of equations after...

> Why is the description cached? Maybe that could be avoided. What would be a good and simple way to do it? Compute it on-demand with a function?

Hmm, in that case, wouldn't also the user need to pass the function? For example: ```julia function Planet(; name) @parameters m description(sys) = "A planet with mass $m" return ODESystem(Equation[],...