Valentin Kaisermayer

Results 138 comments of Valentin Kaisermayer

There is some very verbose output now, e.g. [here](https://mtk.sciml.ai/dev/tutorials/tearing_parallelism/) . It seems the standard output is Latex, which is inconsistent with what a user would see.

Although you can get the problem creation to work with `use_union=true`, it will error in the run-time generated function.

```julia function build_problem(sys; tspan = (0.0, 1.5), param_values = [100e2, 200, 0.5]) u0map = [ (collect(sys.Tgas) .=> fill(100.0, N))... (collect(sys.Tsol) .=> fill(20.0, N))... (collect(sys.cR) .=> fill(3000.0, N))... (sys.mflux => 0.5)...

```julia using ModelingToolkit, OrdinaryDiffEq function build_system(n) @parameters t vars = @variables (Tgas[1:n](t) = fill(100,n)), (Tsol[1:n](t) = fill(20, n)), (cR[1:n](t) = fill(3000, n)), (mflux(t) = 0.5) @parameters params[1:3] D = Differential(t)...

Isn't there such a thing already? https://github.com/JuliaSymbolics/Symbolics.jl/blob/c310aabc7854d64af4461ed64ef42018a63324d9/src/difference.jl#L33

However, I think for `ODESystems`, `DiscreteUpdate` is really a ZOH (updates variables at certain discrete timestamps - as the name suggests): https://github.com/SciML/ModelingToolkit.jl/blob/9cc6f21c1ffb1299d1a2d120c848f036d5f232c9/src/systems/diffeqs/abstractodesystem.jl#L129 And would function as a [Sampler](https://www.maplesoft.com/documentation_center/online_manuals/modelica/Modelica_Blocks_Discrete.html#Modelica.Blocks.Discrete.Sampler) from Modelica....

Maybe @YingboMa can clarify what he indented this operator for?

I think you are right, there needs to be a clear definition (see [ModelicaSpec v3.4](https://modelica.org/documents/ModelicaSpec34.pdf) p. 197 for an example).

I think a discrete variable can be viewed as a continuous, that is piecewise-constant and only changes at `t=n*dt` where `n ={0,1,2,3...}`. This would also make sample time convertions easy....

A few comments > The sample-and-hold circuit is often referred to as an analog to digital converter, exactly matching the semantics of sample and hold used in modelica. A sample-and-hold...