Drastic Change in "y" After Call to CVNlsNewton()

View: New views
1 Messages — Rating Filter:   Alert me  

Drastic Change in "y" After Call to CVNlsNewton()

by bowens1 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello,

Thank you for the assistance on the previous problem, that issue has been
resolved.

I am trying to make some headway implementing sundials into my FEA code.
However, at the first requested time "tout", the solution is obviously
incorrect. I have implemented this algorithm in MATLAB with success, and am
seeing very different trends in the C++ implementation.

The drastic change in "y" appears to occur at the RHS function call on Line
2668 of covde.c in the CVNlsNewton() function. For example, I should expect
values of y around [.79 .77 .75] but instead CVode is returning something
like [101.78 100.2 100.2]. Definitely, a far cry from the values I expect
from my validated MATLAB code.

If needed, here are my setting and initializations. These are the same
settings I am using in my MATLAB implementation that has worked.

                         t0 = 0.0;
                         //y = N_VMake_Serial(totalNumDof,u_s);
                         y = N_VNew_Serial(totalNumDof);
                         abstol = N_VNew_Serial(totalNumDof);
                         ydot = N_VNew_Serial(totalNumDof);

                         reltol = 1e-4;

                         for (int i=0;i<totalNumDof;i++)
                         {
                                 NV_Ith_S(y,i) = u_s[i];
                                 NV_Ith_S(abstol,i) = reltol*100.0;
                         }

                         cvode_mem =
CVodeCreate(CV_BDF,CV_NEWTON);
                         flag = CVodeInit(cvode_mem,RHSfunction, t0, y);
                         flag = CVodeSVtolerances(cvode_mem, reltol, abstol);
                         flag = CVDense(cvode_mem, totalNumDof);
                         flag = CVodeSetUserData(cvode_mem,this);


Thanks,
Brian


--
View this message in context:
http://*www.*nabble.com/Drastic-Change-in-%22y%22-After-Call-to-CVNlsNewton%28%29-tp25879547p25879547.html
Sent from the Sundials - Users mailing list archive at Nabble.com.