Herman Sletmoen

Results 158 comments of Herman Sletmoen

I don't think it's too simplistic. The simplified equations are ``` julia> equations(ns) 2-element Vector{Equation}: 0 ~ (-x + y)*σ 0 ~ x*y - z*β ``` with Jacobian ``` julia>...

But it's still strange that the `solve` that uses the Jacobian fails.

Ah, of course, you're right. I think the correct Jacobian should be ```julia using ModelingToolkit using ModelingToolkit: t_nounits as t, D_nounits as D @parameters σ ρ β @variables x z...

For now I've tried the `remake(sys)` functionality out in a few select places. In particular, I "showcase" how it can be used to implement an `extend()` function that handles all...

`ModelingToolkit.defaults(HINDMARSH_ROSE_SYSTEM)` and `ModelingToolkit.defaults(HINDMARSH_ROSE_SYSTEM_2)` work, though.

1. In the first example, e.g. `@variables u1(t) = -1.31` associates the default with the *variable*. When you create a system with that variable, the default is forwarded to the...

Does it work if you add `use_defaults = true` to `remake()`?

It works if you also pass `u0 = Dict()`: ```julia using Test using ModelingToolkit using ModelingToolkit: t_nounits as t, D_nounits as D using DifferentialEquations @parameters g x0 @variables x(t)=x0 y(t)...

Here is another solution using `pkgdir(MyPackage)`: ```julia using MyPackage # lives in /absolute/path/to/MyPackage/ docsdir = joinpath(pkgdir(MyPackage), "docs") # e.g. /absolute/path/to/MyPackage/docs filepath = joinpath(docsdir, "path/to/file.txt") # e.g. /absolute/path/to/MyPyPackage/docs/path/to/file.txt file = open(filepath)...

This is also a nicer default for [structural simplification after independent variable change](https://docs.sciml.ai/ModelingToolkit/dev/tutorials/change_independent_variable/), provided that `d(old_iv)/d(new_iv)` is nonzero, which it has to be for the transformation to be well-defined.