Christopher Rackauckas
Christopher Rackauckas
It should just be doing an unsafe_wrap, but FFI is not my specialty so it would be good if someone double check this: https://github.com/JuliaDiffEq/Sundials.jl/blob/master/src/common_interface/function_types.jl#L22-L23
Indeed I've been thinking that we need something good for explicit algebraic variables, but making it work nicely with the interpolation is where I got stuck. Maybe just not interpolating...
```julia using DifferentialEquations, StaticArrays function harmonic!(u,p,t) [u[2],-u[1]] end u0 = @MArray [1.0, 0.0] function constantenergymanifold(resid,u,p,t) resid[1] = u[2]^2 + u[1]^2 - 1.0 resid[2] = 0.0 end constantenergy_cb = ManifoldProjection(constantenergymanifold) prob...
It occurs even with the oop interface if ManifoldProjection is there: ```julia using DifferentialEquations, StaticArrays function harmonic!(u,p,t) [u[2],-u[1]] end u0 = @MArray [1.0, 0.0] function constantenergymanifold(resid,u,p,t) resid[1] = u[2]^2 +...
In fact, ```julia using DifferentialEquations, StaticArrays function harmonic!(u,p,t) [u[2],-u[1]] end u0 = @MArray [1.0, 0.0] function constantenergymanifold(resid,u,p,t) resid[1] = u[2]^2 + u[1]^2 - 1.0 resid[2] = 0.0 end constantenergy_cb =...
```julia using NLsolve function f!(F, x) F[1] = (x[1]+3)*(x[2]^3-7)+18 F[2] = sin(x[2]*exp(x[1])-1) end function j!(J, x) J[1, 1] = x[2]^3-7 J[1, 2] = 3*x[2]^2*(x[1]+3) u = exp(x[1])*cos(x[2]*exp(x[1])-1) J[2, 1] =...
It's at least the current design that we don't make a copy unless we specifically need to. The initial condition and the parameters are thus just references. There is a...
Yes, it works. Give it a try!
Are you using positive or negative `solf.dt`?
What happens if you make it negative?