Hi Ian,
It looks like you’ve run into a snag with the behavior of the Reactor.thermo property, which automatically calls Reactor.syncState. Since you haven’t overridden, syncState, it retains its default implementation and is restoring an initial state that never gets updated. I think the most efficient fix for this would be to store a different reference to the Solution object in your reactor, e.g. as self.gas, and access it through that property rather than as self.thermo.
One other change you’ll probably want to make is to make sure that you unnormalized mass fractions in replace_update_state so the finite difference Jacobian will be computed correctly, e.g.:
def replace_update_state(self, y): self.gas.set_unnormalized_mass_fractions(y[3:]) self.gas.TD = y[1], y[0] self.x = y[2]Regards,
Ray