Hi all,
I am trying to solve a DAE system using DifferentialEquations.jl where initial values can be relatively large (order 1e22). The MWE below (algebraic equations omitted) solves fine up to n0[1] = 1e15
but throws an IDAS error when I increase this value further. Therefore I was wondering whether there is any fundamental limitation of usable n0 in this example, and if so, why?
using DifferentialEquations
using Plots
function func(r,dn,n,param,t)
r[1] = -n[1] + n[2] - dn[1]
r[2] = +n[1] - n[2] - dn[2]
end
n0 = [1.0e15, 0]
dn0 = [0.0, 0.0]
diff_var = [true, true]
tspan = [0.0, 1e1]
param = []
prob = DAEProblem(func,dn0,n0,tspan,param,differential_vars=diff_var)
sol = solve(prob)
Plots.plot(sol)
Here the full error message:
[IDAS ERROR] IDACalcIC
The residual routine or the linear setup or solve routine had a recoverable error, but IDACalcIC was unable to recover.
In principle I could probably get around this by using a lower n0 and scaling other parameters accordingly, but with a number of algebraic equations that require scaling this can become a little troublesome.