Open acoh64 opened 2 years ago
@YingboMa can you take a quick look at this?
Is there a reason you're using ODEForwardSensitivityProblem rather than duals?
Thanks! When I have been solving these equations for large systems, implicit solvers have been much faster, so I thought continuous forward or adjoint sensitivity analysis would be faster. Also, I am generally only optimizing ~10-20 parameters so I believe FSA should be most efficient. I have tried using duals as well and get different errors.
res = zeros(Nx)
that's why you get errors with dual numbers. Make that res = similar(c)
or something so it matches eltypes and you'll be fine.
julia> solve(sense_prob,save_everystep=false)
retcode: Success
Interpolation: 1st order linear
t: 2-element Vector{Float64}:
0.0
1.0
u: 2-element Vector{Vector{Float64}}:
[0.5435269377237694, 0.5150956772555779, 0.501326117349611, 0.5890160312636273, 0.572724604965598, 0.595889016206594, 0.5572862102374384, 0.5665907426421062, 0.5349023180669545, 0.5002292722210575 … 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
[0.1225288248099461, 0.13027393794145153, 0.1546890611139187, 0.1984491465587749, 0.2635202229625326, 0.3487703544745312, 0.4487633159649244, 0.5544124766090672, 0.6552038023623508, 0.7420449312556077 … 0.07085716146817547, 0.10014869004452133, 0.12499537251100165, 0.14417535699731207, 0.1570171914981712, 0.16406148156383946, 0.16699013182361092, 0.16772230320764003, 0.1676638527937975, 0.16756845765983977]
(@v1.7) pkg> st DiffEqSensitivity
Status `~/.julia/environments/v1.7/Project.toml`
[41bf760c] DiffEqSensitivity v6.75.0
it works for me.
I was using Julia v1.6.2 and the problem was fixed after updating to v1.7.2
Hi everyone,
I am trying to solve forward sensitivity equations for the 1D Cahn-Hilliard equation (with the eventual goal of moving to 2D). I am getting a StackOverflowError with the following code:
The error is:
These are my package versions: