John Tinnerholm
John Tinnerholm
@baggepinnen Hi Fredrik, thanks! Yea, I should clarify which version I used. Latest MTK and Julia 1.7.2. That is Julia >= v1.7 but I also tried now using the if-else...
@baggepinnen correct 💯 , thanks! Like so then: ``` #= An attempt to model Modelica if-equations =# using DifferentialEquations using ModelingToolkit using Plots import IfElse @variables t vars = @variables...
Thanks, Still no luck:( ``` #Same preamble @variables t vars = @variables y(t) pars = @parameters uMax uMin u @parameters ifCond1 = false @parameters ifCond2 = false D = Differential(t)...
That works to create the system, but for some reason the problem errors with the same message as before ``` julia> @time include("IfEqModelingToolkit.jl") ERROR: LoadError: ArgumentError: Equations (1), states (1),...
Thanks again @baggepinnen 😅 I started out with that, but then I got into the `ifelse `trouble, so I switched to how I would try to represent it using DifferentialEquations.jl...
> The following runs, but please check that it does what you expect :) > > I had to make the conditions `@variables` instead of parameters and treat them as...
> Accept symbol as first argument in IfElse.ifelse (currently requires Equation) I looked into this briefly, It seems that there might be an issue with the IfElse package, not sure...
> Figure out why it didn't work with ifCond1 as a parameter rather than @variable I think this was something we both encountered as a "false positive". I tried to...
Some more context, For now, I have managed to resolve the issue, but not in a "pretty" way: ``` function makeODESystem(deqs, iv, vars, pars, idxReduction; name) # Equation is not...
@ChrisRackauckas Thanks, I did some testing for Julia 1.9-DEV this is the numbers I got. A small little script below, what this does is to compile the MTK model to...