9 PKG =
'phm_hazard_rate_calculation' 10 NAME =
'test_class_mechanical_equipment' 19 result = self.m_eq.get_sp_lambda()
22 self.assertAlmostEqual(result, test_result, 5)
25 result = self.m_eq.get_gr_lambda()
28 self.assertAlmostEqual(result, test_result, 5)
31 result = self.m_eq.get_be_lambda()
34 self.assertAlmostEqual(result, test_result, 5)
38 result = self.m_eq.get_ac_lambda()
41 self.assertAlmostEqual(result, test_result, 5)
45 result = self.m_eq.get_sh_lambda()
48 self.assertAlmostEqual(result, test_result, 5)
52 result = self.m_eq.get_em_lambda()
55 self.assertAlmostEqual(result, test_result, 5)
59 result = self.m_eq.get_cp_lambda()
62 self.assertAlmostEqual(result, test_result, 5)
66 result = self.m_eq.get_bat_lambda()
69 self.assertAlmostEqual(result, test_result, 5)
77 self.m_eq.sp_c_dw_func(0.5)
78 result = self.m_eq.get_sp_c_dw()
79 test_result = 203.54162426216158
83 self.assertAlmostEqual(result, test_result, 5)
87 self.m_eq.sp_c_dc_func(0.5)
88 result = self.m_eq.get_sp_c_dc()
89 test_result = 2.436396322815999
93 self.assertAlmostEqual(result, test_result, 5)
97 self.m_eq.sp_c_n_func(5)
98 result = self.m_eq.get_sp_c_n()
99 test_result = 21.951999999999995
103 self.assertAlmostEqual(result, test_result, 5)
107 self.m_eq.sp_c_l_func(7, 5)
108 result = self.m_eq.get_sp_c_l()
109 test_result = 6.530383015126816
113 self.assertAlmostEqual(result, test_result, 5)
117 self.m_eq.sp_c_k_func(9, 5)
118 result = self.m_eq.get_sp_c_k()
119 test_result = 0.7314342657282276
125 self.assertAlmostEqual(result, test_result, 5)
129 self.m_eq.sp_c_cs_func(25)
130 result = self.m_eq.get_sp_c_cs()
133 self.assertAlmostEqual(result, test_result, 2)
137 self.m_eq.sp_c_cs_func(250)
138 result = self.m_eq.get_sp_c_cs()
139 test_result = 0.8333333333333334
143 self.assertAlmostEqual(result, test_result, 5)
147 self.m_eq.sp_c_cs_func(350)
148 result = self.m_eq.get_sp_c_cs()
149 test_result = 1.5879629629629632
153 self.assertAlmostEqual(result, test_result, 5)
160 result = self.m_eq.bearing_l_10_func(2, 30, 6, 5)
161 test_result = 83333.33333333334
165 self.assertAlmostEqual(result, test_result, 5)
169 self.m_eq.be_lambda_be_b_func(2, 30, 6, 5, 10)
170 result = self.m_eq.get_be_lambda_be_b()
171 test_result = 1.1999999999999997e-06
176 self.assertAlmostEqual(result, test_result, 5)
180 self.m_eq.be_lambda_be_b_func(2, 30, 6,
None, 10)
181 result = self.m_eq.get_be_lambda_be_b()
184 self.assertAlmostEqual(result, test_result, 5)
188 self.m_eq.be_c_y_func(2, 30, 6)
189 result = self.m_eq.get_be_c_y()
194 self.assertAlmostEqual(result, test_result, 5)
198 self.m_eq.be_c_r_func(5,
True)
199 result = self.m_eq.get_be_c_r()
200 test_result = 0.10730901231734431
204 self.assertAlmostEqual(result, test_result, 5)
208 self.m_eq.be_c_r_func(5,
False)
209 result = self.m_eq.get_be_c_r()
212 self.assertAlmostEqual(result, test_result, 2)
216 self.m_eq.be_c_v_func(30, 5,
True)
217 result = self.m_eq.get_be_c_v()
218 test_result = 2.6314897044644194
222 self.assertAlmostEqual(result, test_result, 5)
226 self.m_eq.be_c_v_func(30, 5,
False)
227 result = self.m_eq.get_be_c_v()
230 self.assertAlmostEqual(result, test_result, 2)
234 self.m_eq.be_c_cw_func(0.9,
True)
235 result = self.m_eq.get_be_c_cw()
238 self.assertAlmostEqual(result, test_result, 2)
242 self.m_eq.be_c_cw_func(0.5,
True)
243 result = self.m_eq.get_be_c_cw()
248 self.assertAlmostEqual(result, test_result, 5)
252 self.m_eq.be_c_cw_func(0.9,
False)
253 result = self.m_eq.get_be_c_cw()
256 self.assertAlmostEqual(result, test_result, 2)
260 self.m_eq.be_c_t_func(150)
261 result = self.m_eq.get_be_c_t()
264 self.assertAlmostEqual(result, test_result, 2)
268 self.m_eq.be_c_t_func(200)
269 result = self.m_eq.get_be_c_t()
270 test_result = 1.3053792885584978
274 self.assertAlmostEqual(result, test_result, 5)
281 self.m_eq.gr_lambda_gr_b_func(100, 10,
True)
282 result = self.m_eq.get_gr_lambda_gr_b()
287 self.assertAlmostEqual(result, test_result, 5)
291 self.m_eq.gr_lambda_gr_b_func(1, 1,
False)
292 result = self.m_eq.get_gr_lambda_gr_b()
295 self.assertAlmostEqual(result, test_result, 5)
299 self.m_eq.c_gs_func(100, 10,
True)
300 result = self.m_eq.get_gr_c_gs()
301 test_result = 6.011872336272722
305 self.assertAlmostEqual(result, test_result, 5)
309 self.m_eq.c_gs_func(100, 10,
False)
310 result = self.m_eq.get_gr_c_gs()
313 self.assertAlmostEqual(result, test_result, 5)
317 self.m_eq.c_gp_func(100, 10,
True)
318 result = self.m_eq.get_gr_c_gp()
319 test_result = 1264243.85515232
323 self.assertAlmostEqual(result, test_result, 5)
327 self.m_eq.c_gp_func(100, 10,
False)
328 result = self.m_eq.get_gr_c_gp()
331 self.assertAlmostEqual(result, test_result, 5)
335 self.m_eq.c_ga_func(1,
True)
336 result = self.m_eq.get_gr_c_ga()
337 test_result = 175211.67808855648
341 self.assertAlmostEqual(result, test_result, 5)
345 self.m_eq.c_ga_func(1,
False)
346 result = self.m_eq.get_gr_c_ga()
349 self.assertAlmostEqual(result, test_result, 5)
353 self.m_eq.c_gl_func(100, 10,
True)
354 result = self.m_eq.get_gr_c_gl()
355 test_result = 4.467368504525316
359 self.assertAlmostEqual(result, test_result, 5)
363 self.m_eq.c_gl_func(100, 10,
False)
364 result = self.m_eq.get_gr_c_gl()
367 self.assertAlmostEqual(result, test_result, 5)
371 self.m_eq.c_gt_func(150)
372 result = self.m_eq.get_gr_c_gt()
375 self.assertAlmostEqual(result, test_result, 5)
379 self.m_eq.c_gt_func(200)
380 result = self.m_eq.get_gr_c_gt()
381 test_result = 1.064516129032258
385 self.assertAlmostEqual(result, test_result, 5)
392 self.m_eq.ac_n_o_func(0.5, 0.1, 0.5, 0.1, 0.5, 0.4, 0.2)
393 result = self.m_eq.ac_n_o
394 test_result = 2.320515320283925
396 self.assertAlmostEqual(result, test_result, 5)
401 self.m_eq.ac_lambda_ac_b_func()
402 result = self.m_eq.get_ac_lambda_ac_b()
403 test_result = 500000.0
405 self.assertAlmostEqual(result, test_result, 5)
409 self.m_eq.ac_c_h_func(10, 5,
True)
410 result = self.m_eq.get_ac_c_h()
415 self.assertAlmostEqual(result, test_result, 5)
419 self.m_eq.ac_c_h_func(10, 5,
False)
420 result = self.m_eq.get_ac_c_h()
423 self.assertAlmostEqual(result, test_result, 5)
427 self.m_eq.ac_c_s_func(150)
428 result = self.m_eq.ac_c_s
433 self.assertAlmostEqual(result, test_result, 5)
440 self.m_eq.ac_c_cp_func(
True)
441 result = self.m_eq.get_ac_c_cp()
446 self.assertAlmostEqual(result, test_result, 5)
450 self.m_eq.ac_c_cp_func(
False)
451 result = self.m_eq.get_ac_c_cp()
454 self.assertAlmostEqual(result, test_result, 5)
462 self.m_eq.elec_mot_lambda_wi_b_func(150)
463 result = self.m_eq.get_em_lambda_wi_b()
464 test_result = 6666.666666666667
468 self.assertAlmostEqual(result, test_result, 5)
472 self.m_eq.elec_mot_c_t_func(80)
473 result = self.m_eq.get_em_c_t()
478 self.assertAlmostEqual(result, test_result, 5)
482 self.m_eq.elec_mot_c_t_func(
None)
483 result = self.m_eq.get_em_c_t()
486 self.assertAlmostEqual(result, test_result, 5)
490 self.m_eq.em_motor_phase = 1
491 self.m_eq.elec_mot_c_v_func(25, 5, 5,
True)
492 result = self.m_eq.get_em_c_v()
493 test_result = 1125899906842624.0
497 self.assertAlmostEqual(result, test_result, 5)
501 self.m_eq.em_motor_phase = 3
502 self.m_eq.elec_mot_c_v_func(25, 5, 5,
True)
503 result = self.m_eq.get_em_c_v()
504 test_result = 6.656854249492381
508 self.assertAlmostEqual(result, test_result, 5)
512 self.m_eq.em_motor_phase = 0
513 self.m_eq.elec_mot_c_v_func(25, 5, 5,
True)
514 result = self.m_eq.get_em_c_v()
517 self.assertAlmostEqual(result, test_result, 5)
521 self.m_eq.elec_mot_c_v_func(25, 5, 5,
False)
522 result = self.m_eq.get_em_c_v()
525 self.assertAlmostEqual(result, test_result, 5)
529 self.m_eq.elec_mot_v_u_func(25, 5,
True)
530 result = self.m_eq.get_em_v_u()
535 self.assertAlmostEqual(result, test_result, 5)
539 self.m_eq.elec_mot_v_u_func(25, 5,
False)
540 result = self.m_eq.get_em_v_u()
543 self.assertAlmostEqual(result, test_result, 5)
547 self.m_eq.elec_mot_alt_func(3000)
548 result = self.m_eq.get_em_c_alt()
551 self.assertAlmostEqual(result, test_result, 5)
555 self.m_eq.elec_mot_alt_func(3750)
556 result = self.m_eq.get_em_c_alt()
561 self.assertAlmostEqual(result, test_result, 5)
565 self.m_eq.elec_mot_lambda_c_func(35)
566 result = self.m_eq.get_em_lambda_c()
569 self.assertAlmostEqual(result, test_result, 5)
576 self.m_eq.sh_lambda_sh_b_func(35)
577 result = self.m_eq.get_sh_lambda_sh_b()
578 test_result = 0.02857142857142857
582 self.assertAlmostEqual(result, test_result, 5)
586 self.m_eq.sh_c_f_func(35, 0)
587 result = self.m_eq.get_sh_c_f()
590 self.assertAlmostEqual(result, test_result, 5)
594 self.m_eq.sh_c_f_func(35, 1)
595 result = self.m_eq.get_sh_c_f()
596 test_result = 0.7892532499999999
600 self.assertAlmostEqual(result, test_result, 5)
604 self.m_eq.sh_c_f_func(35, 2)
605 result = self.m_eq.get_sh_c_f()
606 test_result = 0.9170418625000001
610 self.assertAlmostEqual(result, test_result, 5)
614 self.m_eq.sh_c_f_func(35, 3)
615 result = self.m_eq.get_sh_c_f()
616 test_result = 0.6171854999999999
620 self.assertAlmostEqual(result, test_result, 5)
624 self.m_eq.sh_c_f_func(35, 4)
625 result = self.m_eq.get_sh_c_f()
628 self.assertAlmostEqual(result, test_result, 5)
632 result = self.m_eq.sh_c_f_hot_rolled(35)
633 test_result = 0.7892532499999999
637 self.assertAlmostEqual(result, test_result, 5)
641 result = self.m_eq.sh_c_f_macined(35)
642 test_result = 0.9170418625000001
646 self.assertAlmostEqual(result, test_result, 5)
650 result = self.m_eq.sh_c_f_forged(35)
651 test_result = 0.6171854999999999
655 self.assertAlmostEqual(result, test_result, 5)
659 self.m_eq.sh_c_t_func(150)
660 result = self.m_eq.get_sh_c_t()
663 self.assertAlmostEqual(result, test_result, 5)
667 self.m_eq.sh_c_t_func(200)
668 result = self.m_eq.get_sh_c_t()
669 test_result = 1.064516129032258
673 self.assertAlmostEqual(result, test_result, 5)
677 section_dict = {
"X": {
'length': 3,
'I': 5},
"Y": {
'length': 4,
'I': 3}}
678 self.m_eq.sh_c_dy_func(3, 4, 5, section_dict)
679 result = self.m_eq.get_sh_c_dy()
680 test_result = 0.030654222222222225
682 self.assertAlmostEqual(result, test_result, 5)
686 result = self.m_eq.shaft_moment_of_inertia_func(3)
687 test_result = 0.5890486225480862
691 self.assertAlmostEqual(result, test_result, 5)
695 self.m_eq.sh_c_sc_r_func(10, 5, 2,
True)
696 result = self.m_eq.get_sh_c_sc_r()
697 test_result = 0.014583783731925789
701 self.assertAlmostEqual(result, test_result, 5)
705 self.m_eq.sh_c_sc_r_func(10, 5, 2,
False)
706 result = self.m_eq.get_sh_c_sc_r()
709 self.assertAlmostEqual(result, test_result, 5)
713 self.m_eq.sh_c_sc_r_func(10, 5, 2,
True)
714 self.m_eq.sh_c_sc_g = 5
715 self.m_eq.sh_c_sc_func()
716 result = self.m_eq.get_sh_c_sc()
717 test_result = 5.014583783731925789
719 self.assertAlmostEqual(result, test_result, 5)
726 self.m_eq.cp_lambda_cp_b = 5
727 self.m_eq.cp_c_sf = 4
728 self.m_eq.cp_lambda_h = 3
729 self.m_eq.lambda_cp_func()
730 result = self.m_eq.get_cp_lambda()
731 test_result = 2.3e-05
733 self.assertAlmostEqual(result, test_result, 5)
740 self.m_eq.bat_lambda_0 = 5
741 self.m_eq.lambda_bat_func()
742 result = self.m_eq.get_bat_lambda()
747 self.assertAlmostEqual(result, test_result, 5)
752 if __name__ ==
'__main__':
753 rosunit.unitrun(PKG, NAME, TestMechanicalEquipment, sysargs =
"--cov", coverage_packages=[str(PKG)])
def test_get_function_1(self)
def test_sp_c_dc_func(self)
def test_elec_mot_v_u_func_2(self)
def test_be_lambda_be_b_func_1(self)
def test_sh_c_f_hot_rolled(self)
def test_sh_c_f_func_2(self)
def test_elec_mot_c_v_func_3(self)
def test_get_function_8(self)
def test_be_c_y_func(self)
def test_sh_c_t_func_2(self)
def test_sh_c_sc_func(self)
def test_be_c_r_func_1(self)
def test_elec_mot_c_t_func_2(self)
def test_sp_c_cs_func_2(self)
def test_sh_c_f_func_3(self)
def test_be_c_v_func_2(self)
def test_ac_c_h_func_1(self)
def test_lambda_bat_func(self)
def test_c_gl_func_2(self)
def test_lambda_cp_func(self)
def test_get_function_4(self)
def test_get_function_2(self)
def test_ac_c_h_func_2(self)
def test_ac_c_cp_func_2(self)
def test_be_c_t_func_1(self)
def test_get_function_7(self)
def test_be_lambda_be_b_func_2(self)
def test_elec_mot_v_u_func_1(self)
def test_elec_mot_c_v_func_4(self)
def test_ac_c_s_func(self)
def test_elec_mot_c_t_func_1(self)
def test_be_c_cw_func_3(self)
def test_ac_n_o_func(self)
def test_sh_c_f_func_1(self)
def test_be_c_r_func_2(self)
def test_sp_c_cs_func_1(self)
def test_elec_mot_c_v_func_1(self)
def test_be_c_t_func_2(self)
def test_sp_c_dw_func(self)
def test_be_c_v_func_1(self)
def test_c_ga_func_1(self)
def test_sh_c_sc_r_func_1(self)
def test_sp_c_n_func(self)
def test_sp_c_l_func(self)
def test_elec_mot_alt_func_1(self)
def test_c_gl_func_1(self)
def test_sh_c_f_func_5(self)
def test_gr_lambda_gr_b_func_1(self)
def test_sh_c_sc_r_func_2(self)
def test_elec_mot_alt_func_2(self)
def test_sh_c_t_func_1(self)
def test_get_function_5(self)
def test_bearing_l_10_func(self)
def test_shaft_moment_of_inertia_func(self)
def test_c_gp_func_1(self)
def test_sp_c_k_func(self)
def test_c_gp_func_2(self)
def test_c_ga_func_2(self)
def test_be_c_cw_func_1(self)
def test_c_gs_func_2(self)
def test_elec_mot_lambda_c_func(self)
def test_sh_lambda_sh_b_func(self)
def test_c_gt_func_2(self)
def test_c_gt_func_1(self)
def test_elec_mot_c_v_func_2(self)
def test_ac_lambda_ac_b_func(self)
def test_elec_mot_lambda_wi_b_func(self)
def test_c_gs_func_1(self)
def test_sh_c_dy_func(self)
def test_be_c_cw_func_2(self)
def test_sh_c_f_forged(self)
def test_ac_c_cp_func_1(self)
def test_get_function_6(self)
def test_gr_lambda_gr_b_func_2(self)
def test_get_function_3(self)
def test_sp_c_cs_func_3(self)
def test_sh_c_f_macined(self)
def test_sh_c_f_func_4(self)