def temperature_fast(self, un, uc, up, phien, phiep, phisn, phisp, Tn, Tc,
                      Tp, j, eta, cs_1, gamma_c, cmax, Told):
     hx = self.hx
     cs = cs_1 - gamma_c * j / coeffs.solidDiffCoeff(self.Ds, self.ED, Tc)
     ans = (Tc - Told) -  (delta_t/(self.rho*self.Cp))*( self.lam*( Tn - 2*Tc + Tp)/hx**2 + \
     self.Qohm(phisn, phisp, phien, phiep, un, up, uc, Tc) + self.Qrxn(j,eta) + self.Qrev_fast(j,Tc,cs,cmax) )
     return ans.reshape()
 def ionic_flux_fast(self, j, u, T, eta, cs1, gamma_c, cmax):
     cs = cs1 - gamma_c * j / coeffs.solidDiffCoeff(self.Ds, self.ED, T)
     keff = self.k * np.exp((-self.Ek / R) * ((1 / T) - (1 / Tref)))
     var = ((0.5 * F) / (R * T)) * eta
     term2 = (np.exp(var) - np.exp(-var)) / 2
     ans = j - 2 * keff * np.sqrt(u * (cmax - cs) * cs) * term2
     #        ans = j - 2*keff*np.sqrt(u*(cmax - cs)*cs)*np.sinh( (0.5*F/(R*T))*(eta) )
     return ans.reshape()
 def over_poten_fast(self, eta, phis, phie, T, j, cs1, gamma_c, cmax):
     cs = cs1 - gamma_c * j / coeffs.solidDiffCoeff(self.Ds, self.ED, T)
     ans = eta - phis + phie + self.open_circuit_poten_fast(cs, T, cmax)
     return ans.reshape()
 def cstar(self, cM, cMp, j, T):
     cs = -self.hy * j / (coeffs.solidDiffCoeff(self.Ds, self.ED,
                                                T)) + (2 * cM - cMp) / 2
     return cs
 def bc_neumann_c(self, c0, c1, jvec, T):
     hy = self.hy
     Deff = coeffs.solidDiffCoeff(self.Ds, self.ED, T)
     bc = (c1 - c0) / hy + jvec / Deff
     #        bc = (c1-c0) + jvec*hy/Deff
     return bc.reshape()