MCPcopy Create free account
hub / github.com/Cantera/cantera / evalJacobian

Method evalJacobian

src/zeroD/ReactorNet.cpp:504–524  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

502}
503
504void ReactorNet::evalJacobian(double t, double* y, double* ydot, double* p, Array2D* j)
505{
506 //evaluate the unperturbed ydot
507 eval(t, y, ydot, p);
508 for (size_t n = 0; n < m_nv; n++) {
509 // perturb x(n)
510 double ysave = y[n];
511 double dy = m_atol[n] + fabs(ysave)*m_rtol;
512 y[n] = ysave + dy;
513 dy = y[n] - ysave;
514
515 // calculate perturbed residual
516 eval(t, y, m_ydot.data(), p);
517
518 // compute nth column of Jacobian
519 for (size_t m = 0; m < m_nv; m++) {
520 j->value(m,n) = (m_ydot[m] - ydot[m])/dy;
521 }
522 y[n] = ysave;
523 }
524}
525
526void ReactorNet::updateState(double* y)
527{

Callers 1

steadyJacobianMethod · 0.45

Calls 7

updateElapsedMethod · 0.80
incrementEvalsMethod · 0.80
setAgeMethod · 0.80
valueMethod · 0.45
resetMethod · 0.45
resizeMethod · 0.45
setValueMethod · 0.45

Tested by

no test coverage detected