ChrisRackauckas on individual
tabbit (compare)
ChrisRackauckas on individual
Allow individualized work-preci… (compare)
kanav99 on gh-pages
build based on 4cdcd9d (compare)
ChrisRackauckas on master
Typo with Modelingtoolkitize Merge pull request #753 from Gl… (compare)
[slack] <briochemc> What's the correct way to check if a function is inplace? I.e., in
```julia> foo(du, u, p, t) = "in place"
foo (generic function with 1 method)
julia> ODEFunction(foo)
(::ODEFunction{true,typeof(foo),LinearAlgebra.UniformScaling{Bool},Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing,Nothing}) (generic function with 7 methods)``
how does ODEFunction assign
iip = true`? Not sure where to look for the code that does that 😅
nargs
, but I want to be sure how it's supposed to be done 🙂
nargs
search on DiffEqBase gave me no results 🤔)
A\b
works, but I am benchmarking different methods.
A\b
does something perhaps overly smart and switches the solver depending on the dimensions i believe
A
matrix comprises derivative operators, so I'm also looking at DiffEqOperators.
SecondOrderODEProblem
still supported? I had a hard time understand what inputs the dynamics function should take. Unfortunately reading https://github.com/SciML/DiffEqBase.jl/blob/864c379ead274243acdd965bd8942d1da1deb3bb/test/problem_creation_tests.jl#L51 didn't shed a lot of light for me. I'm not sure what the relationship between u
and v
are, and the docstring args from the SecondOrderODEProblem
constructor seems flipped compared to its implementation. Thanks for any information!
[slack] <jonas.isensee> Thanks you, that seems to work.
Not sure that is much better for my particular usecase though.
I want to work with the matrix directly andu.x[2]
is probably not much better than`@view u[:,2:4]`
at the cost of introducing another abstraction layer.
(relevant since this is for teaching...)
[slack] <David Millard> Hi, I'm sure I'm misusing VectorContinuousCallback
, but I can't seem to figure out why. I effectively have a slightly fancier version of the bouncing ball example, where the bottom points of a mesh make inelastic contact with a floor plane at z = 0.
The multi-wall bouncing ball works fine for me. However, I can't seem to convince the affect!
function to trigger in my program. Relevant bits:
```z(u) = view(u, 3, :, 1)
dz(u) = view(u, 3, :, 2)
floor_cond(out, u, t, int) = out .= ifelse.(z(u) .> 0, z(u), 0)
function floor_affect!(int, idx)
z(int.u)[idx] = 0
dz(int.u)[idx] = 0
end
floor_cb = VectorContinuousCallback(floor_cond, floor_affect!, nothing, size(state, 2); rootfind=false)
prob = ODEProblem{true}(elastic_dynamics!, state, (0, 1 / 60), params)
sol = solve(prob, callback=floor_cb; dt=1e-4)``
Setting
zand
dzto 0 yields the behavior I want in my own dinky homemade Euler solver, where I just check the z-coord and apply the affect with an
if` block.
Secondary meta question: is this the right venue for questions like this?