Question: Maple crashes when trying this loop with this nested integral loop (not thread safe?)

so I'm trying this:

restart;

sigma := 0.143e-18;

l_0 := 1.87;

l0 := 1.87;

roll := rand(0 .. 25.0);

f_gauss := proc (x) options operator, arrow; exp(-(1/2)*x^2/`σ_x`^2)/sqrt(2*Pi*`σ_x`^2) end proc;

f_norm := proc (dx) options operator, arrow; int(f_gauss(x), x = -(1/2)*dx .. (1/2)*dx) end proc;

sol_gauss := proc (mix) options operator, arrow; evalf(eval(-ln((int(f_gauss(x)*exp(-2*sigma*N2O*sqrt((1/4)*l_0^2-x^2)), x = -(1/2)*dx .. (1/2)*dx))/f_norm(dx))/(sigma*N2O), [N2O = 0.25e20*mix/100])) end proc;

for ii to 10 do

a := roll();

eval(sol_gauss(a), [dx = l_0, `σ_x` = l0])

end do

Please Wait...