cvode crashes scilab under Windows because of uncaught exception
Bug Description
Running a cvode with odefun below cause scilab to crash. Same code with ode causes no problems. system: Windows 10, Scilab 2024.1.0
Steps to reproduce
Run code below
clc
clear
n = 20
tfinal = 35
L = 6
dz = L/n
u = .2
Cf = 500
function dCdt = odefun(t,C)
dCdt = zeros(n,1)
dCdz = zeros(n,1)
ksi = 0.001*C.**2.01
dCdz(1) = ( C(1)-Cf ) / dz
dCdz(2:n) = ( C(2:n)-C(1:(n-1)) ) ./ dz
dCdt = -u*dCdz - ksi
endfunction
ic = zeros(n,1)
time = linspace(0, tfinal)
sol = ode("stiff", ic, 0, time, odefun)
[t,y] = cvode(odefun, time, ic)
What is the expected correct behavior?
No crash
Error log
No error message, just crash of scilab
Changing exponent in odefun to 2 (from 2.01) avoids crash