File tree Expand file tree Collapse file tree 1 file changed +3
-12
lines changed Expand file tree Collapse file tree 1 file changed +3
-12
lines changed Original file line number Diff line number Diff line change @@ -1727,11 +1727,8 @@ def _compute_equation(self, name: str) -> None:
17271727
17281728 # need to check if equations are zero since we are using
17291729 # symbols
1730-
1731- if (
1732- not smart_is_zero_matrix (self .eq ("stau" )[ie ])
1733- and not xdot_is_zero
1734- ):
1730+ stau_is_zero = smart_is_zero_matrix (self .eq ("stau" )[ie ])
1731+ if not stau_is_zero and not xdot_is_zero :
17351732 tmp_eq += smart_multiply (
17361733 self .sym ("xdot" ) - self .sym ("xdot_old" ),
17371734 self .sym ("stau" ).T ,
@@ -1747,7 +1744,7 @@ def _compute_equation(self, name: str) -> None:
17471744
17481745 # need to check if equations are zero since we are using
17491746 # symbols
1750- if not smart_is_zero_matrix ( self . eq ( "stau" )[ ie ]) :
1747+ if not stau_is_zero :
17511748 # chain rule for the time point
17521749 tmp_eq += smart_multiply (
17531750 self .eq ("ddeltaxdt" )[ie ],
@@ -1766,12 +1763,6 @@ def _compute_equation(self, name: str) -> None:
17661763 + self .eq ("ddeltaxdx_old" )[ie ],
17671764 tmp_dxdp ,
17681765 )
1769-
1770- elif not xdot_is_zero :
1771- tmp_eq = smart_multiply (
1772- self .sym ("xdot" ) - self .sym ("xdot_old" ),
1773- self .eq ("stau" )[ie ],
1774- )
17751766 event_eqs .append (tmp_eq )
17761767
17771768 self ._eqs [name ] = event_eqs
You can’t perform that action at this time.
0 commit comments