@@ -49,12 +49,9 @@ namespace GridKit
4949 template <typename scalar_type, typename index_type>
5050 void Ieeest<scalar_type, index_type>::setDerivedParameters()
5151 {
52- T2_ = std::max (T2_ , TIME_CONSTANT_MINIMUM );
53- T4_ = std::max (T4_ , TIME_CONSTANT_MINIMUM );
54- T6_ = std::max (T6_ , TIME_CONSTANT_MINIMUM );
55- T2_inv_ = ONE <RealT> / T2_ ;
56- T4_inv_ = ONE <RealT> / T4_ ;
57- T6_inv_ = ONE <RealT> / T6_ ;
52+ T2_ = std::max (T2_ , TIME_CONSTANT_MINIMUM );
53+ T4_ = std::max (T4_ , TIME_CONSTANT_MINIMUM );
54+ T6_ = std::max (T6_ , TIME_CONSTANT_MINIMUM );
5855
5956 a1_ = A1_ + A3_ ;
6057 a2_ = A2_ + A4_ + A1_ * A3_ ;
@@ -352,9 +349,9 @@ namespace GridKit
352349 const ScalarT x2_rhs = (-x1 - a1_ * x2 + u) * a2_inv_;
353350 const ScalarT x3_rhs = (-x1 - a1_ * x2 - a2_ * x3 + u) * a3_inv_;
354351 const ScalarT x4_rhs = (-x1 - a1_ * x2 - a2_ * x3 - a3_ * x4 + u) * a4_inv_;
355- const ScalarT x5_rhs = (v4 - x5) * T2_inv_ ;
356- const ScalarT x6_rhs = (v5 - x6) * T4_inv_ ;
357- const ScalarT x7_rhs = (v6 - x7) * T6_inv_ ;
352+ const ScalarT x5_rhs = (v4 - x5) / T2_ ;
353+ const ScalarT x6_rhs = (v5 - x6) / T4_ ;
354+ const ScalarT x7_rhs = (v6 - x7) / T6_ ;
358355
359356 f[X1 ] = -x1_dot + s1 * x1_rhs + (s2 + s3 + s4) * x2;
360357 f[X2 ] = -x2_dot + s2 * x2_rhs + (s3 + s4) * x3;
0 commit comments