At the moment, I’m working on temperature calculation of ground. Ground temperature is affected significantly by the solar irradiance and some other
environment conditions. To solve the problem, Optix seems to be a good choice, because of its parallel characteristics and shadow judgement.
As you know, to get the temperature, a system of nonlinear equations should be solved. However, cuBLAS can only be applied to linear equations, in order to solve nonlinear equations, CMINPACK is a good choice, and I have tested the feasibility with cuda, it works will. Then, CMINPACK is introduced
into Optix, unfortunately, a big problem appeared.
In ray generation program, a shadow ray will be used to determine whether somewhere is in the shadow sun, than I will use CMINPACK to solve the nonlinear equations. The shadow ray tracing is like this:
Shadow_Ray_Load sh_prd;
sh_prd.attenuate=0;//1,shadow.0, out of shadow
optix::Ray shadow_ray=make_Ray(center_vertex,sun_dir,0,1.e-2.f,1.e10.f);//just need 1 type of ray,0,shadow ray
rtTrace(top_object,shadow_ray,sh_prd);
attenuate=sh_prd.attenuate;
rtPrintf("attenate=%d\n",attenuate);
CMINPACK nonlinear equations solver
tol = sqrt(__cminpack_func__(dpmpar)(1));
info = __cminpack_func__(hybrd1)(__cminpack_param_fcn_nn__ &packet, n, Temp, fvec, tol, wa, lwa);
Problem:
I found ray-tracing can not excute normally if cminpack_func(hybrd1) function exists, why can I know the rtTrace don’t give right result? because the statement(rtPrintf) didn’t excute. however if I comment the nonlinear equations solver, rtTrace will works well.
//info = __cminpack_func__(hybrd1)(__cminpack_param_fcn_nn__ &packet, n, Temp, fvec, tol, wa, lwa);
I do not understand what’s wrong with it. Is there anyone have any idea? Or you can give me some suggestion about how to solve nonlinear equations with
other toolkit.
Look forward your answers.
Best regard.