@@ -946,11 +946,11 @@ def run_critical_speed(self, speed_range=None, num_modes=12, rtol=0.005):
946946 wd = np .zeros_like (_wd )
947947
948948 for i in range (len (wn )):
949- wn_func = lambda s : ( s - self .run_modal (s , num_modes ).wn [i ])
949+ wn_func = lambda s : s - self .run_modal (s , num_modes ).wn [i ]
950950 wn [i ] = newton (func = wn_func , x0 = _wn [i ], rtol = rtol )
951951
952952 for i in range (len (wd )):
953- wd_func = lambda s : ( s - self .run_modal (s , num_modes ).wd [i ])
953+ wd_func = lambda s : s - self .run_modal (s , num_modes ).wd [i ]
954954 wd [i ] = newton (func = wd_func , x0 = _wd [i ], rtol = rtol )
955955
956956 log_dec = np .zeros_like (wn )
@@ -2577,26 +2577,32 @@ def integrate_system(self, speed, F, t, **kwargs):
25772577 add_to_RHS = kwargs .get ("add_to_RHS" )
25782578
25792579 if add_to_RHS is None :
2580- forces = lambda step , ** curr_state : F [step , :] + reduction [1 ](
2581- magnetic_force (
2582- step ,
2583- curr_state .get ("dt" ),
2584- reduction [2 ](curr_state .get ("y" )),
2580+ forces = lambda step , ** curr_state : (
2581+ F [step , :]
2582+ + reduction [1 ](
2583+ magnetic_force (
2584+ step ,
2585+ curr_state .get ("dt" ),
2586+ reduction [2 ](curr_state .get ("y" )),
2587+ )
25852588 )
25862589 )
25872590 else :
2588- forces = lambda step , ** curr_state : F [step , :] + reduction [1 ](
2589- add_to_RHS (
2590- step ,
2591- time_step = curr_state .get ("dt" ),
2592- disp_resp = reduction [2 ](curr_state .get ("y" )),
2593- velc_resp = reduction [2 ](curr_state .get ("ydot" )),
2594- accl_resp = reduction [2 ](curr_state .get ("y2dot" )),
2595- )
2596- + magnetic_force (
2597- step ,
2598- curr_state .get ("dt" ),
2599- reduction [2 ](curr_state .get ("y" )),
2591+ forces = lambda step , ** curr_state : (
2592+ F [step , :]
2593+ + reduction [1 ](
2594+ add_to_RHS (
2595+ step ,
2596+ time_step = curr_state .get ("dt" ),
2597+ disp_resp = reduction [2 ](curr_state .get ("y" )),
2598+ velc_resp = reduction [2 ](curr_state .get ("ydot" )),
2599+ accl_resp = reduction [2 ](curr_state .get ("y2dot" )),
2600+ )
2601+ + magnetic_force (
2602+ step ,
2603+ curr_state .get ("dt" ),
2604+ reduction [2 ](curr_state .get ("y" )),
2605+ )
26002606 )
26012607 )
26022608
@@ -2723,8 +2729,8 @@ def _init_ambs_for_integrate(self, dt, **kwargs):
27232729 rotor = deepcopy (self )
27242730
27252731 if len (magnetic_bearings ):
2726- magnetic_force = (
2727- lambda step , time_step , disp_resp : self .magnetic_bearing_controller (
2732+ magnetic_force = lambda step , time_step , disp_resp : (
2733+ self .magnetic_bearing_controller (
27282734 step , magnetic_bearings , time_step , disp_resp , ** kwargs
27292735 )
27302736 )
0 commit comments