sundials
sundials copied to clipboard
Need of clarification about CVodeQuadSensInit
Hello, In the documentation of cvodes about CVodeQuadSensInit (5.4.1), it is said that If rhsQS is input as NULL, then cvodes uses an internal function that computes difference quotient approximations to the functions \bar q_i = q_ys_i+q{p_i}..._ But in the workflow of steps 1..24 there is nothing to define the integrand q itself. From what it is said above, I may understand that when rhsQS =NULL the quadrature variable is implicitely defined as the derivative w.r.t. parameter p of the "regular" quadrature variable not depending on sensitivity (is it the case ?). However, I still do not understand where to define the integrand rhs when rhsQS =NULL. Maybe CVodeQuadInit has to be called, but it is mentionned nowhere in the doc.
Thanks for your explanations !
Yes, CVodeQuadInit
should be called. See Step 16 in the usage skeleton:
- Initialize quadrature problem or problems for forward problems, using CVodeQuadInit and/or CVodeQuadSensInit.
Thanks, then is my affirmation
when rhsQS =NULL the quadrature variable is implicitely defined as the derivative w.r.t. parameter p of the "regular" quadrature variable not depending on sensitivity (hence defined by CVodeQuadInit)
also true ?
Yes, that is right (see 5.2.6.4).
OK I have read 5.2.6.4 already. However, I do not want to start a dialectic discussion (not being a native english speaker), but it seemed (to me) the only possible explanation, altghouh the sentence about the nullity of rhsQS does not clearly stated it.
However, I still do not understand where to define the integrand rhs when rhsQS =NULL. Maybe CVodeQuadInit has to be called, but it is mentionned nowhere in the doc.
Yes, CVodeQuadInit
must be called to provide the quadrature function. See step 16 in the user skeleton. We will update the the skeleton and add a note to the documentation for CVodeQuadSensInit
to make this requirement clearer.
This was fixed at some point. See https://sundials.readthedocs.io/en/latest/cvodes/Usage/FSA.html#c.CVodeQuadSensInit.
Thanks !