Closed hurricane007 closed 3 years ago
The only thing working is CVODE_BDF(), but this algorithm doesn't support "save_idxs" that I need for parameter estimation.
can you post the reproducer so i can mess around with it?
That means your code is not ForwardDiff differentiable. You'll need to do Rodas4(autodiff=false)
or KenCarp4(autodiff=false)
to turn off automatic differentiation. See the FAQ for more details: https://diffeq.sciml.ai/stable/basics/faq/#Native-Julia-solvers-compatibility-with-autodifferentiation . Likely you're doing something like Array{Float64}(...)
in your code, which of course will fail with this message.
i suspect chris just enjoys the 1up...
can you post the reproducer so i can mess around with it?
It's a simulation of a fixed bed reactor, so the whole code to make it work is too long so I didn't post it. If you are interested I can post it. But Christ's method helped. Actually, I got this problem quite a lot of times. This time it seems to be due to:
for ii = 1:nGrid
# usg = FA/CA [mo/m²⋅s]/[mol/m³] = Finert/(C_tot - C_CO2 - C_NO)
usg[ii, ii] = Finert/(C_tot - u[ii, 1])
end
That means your code is not ForwardDiff differentiable. You'll need to do
Rodas4(autodiff=false)
orKenCarp4(autodiff=false)
to turn off automatic differentiation. See the FAQ for more details: https://diffeq.sciml.ai/stable/basics/faq/#Native-Julia-solvers-compatibility-with-autodifferentiation . Likely you're doing something likeArray{Float64}(...)
in your code, which of course will fail with this message.
Thanks Chris, this solved the problem.
Hello,
when I solve a PDE (basically dC/dt = -usgdC/dz + Dgd^2C/dz^2 + S) with alg_hints=[:stiff], I learnt the algorithm was Rodas4(), but I have never been able to solve the PDE with Rodas4() (also not possible with other algorithms such as KenCarp*()). anyone know the reason?