Replies: 1 comment 5 replies
-
Application Example - Jacobian of Solution 'rates' As a starting point, a import cantera as ct
gas = ct.Solution(`some_mechanism.yaml`)
... # perform some manipulations on gas
jac = gas.jacobian(mole=True, heat_release=True, sparse=True) # placeholders; exact interface tbd This would allow for access that roughly maps to existing properties Anchoring this capacity within The point of this discussion is to ensure that any implementation would provide the most flexible interface for the Cantera community (as well as efficient calculations internally). I'd suggest to keep replies to comments application-specific, i.e. reply below with responses to this application, but start a new comment for the discussion of another application. |
Beta Was this translation helpful? Give feedback.
-
I wanted to start a discussion on Jacobians, as there is ongoing activity (Cantera/cantera#1010), as well as some work-in-progress (#19) and external pertinent code (e.g. pyJac). As an aside, I have coded up analytical Jacobians myself in the past, although that code is not released. Further, there are obvious extensions that go beyond what I want to discuss here (adjoint sensitivity analysis, automatic differentiation), so I mainly want to focus on how to make the exact evaluation of Jacobians most useful to the Cantera community. Per recent comment by @kyleniemeyer, finite difference implementations are often insufficiently accurate, so I believe this would be an important feature.
To me, the main question is whether the evaluation of a Jacobian should be available as a method of
Solution
(i.e. tied intoKinetics.h
, with different options, akin toequilibrate
), or whether it would make sense to provide derivatives that allow users to assemble Jacobians (fyi, there's a plug for a temperature derivatives of reaction rates from my recent work here). One question here is how to ensure that the sparsity is available at various front ends (e.g. via scipy.sparse?). This obviously extends to Jacobians for entire reactor networks, but is likewise relevant to source terms within one-dimensional flames.I'd appreciate if this discussion could take place on a public venue, and I'm tagging people who may want to chime in: @kyleniemeyer, @anthony-walker, @speth, @DavidAkinpelu and @mbkumar (there may be others).
PS: Adding some references:
Beta Was this translation helpful? Give feedback.
All reactions