def test_temperature_overstress_harsh_environment(temperature_active, environment_active_id): """overstressed() should return True when hot spot temperature is within 15C of rated temperature in a harsh environment and False otherwise.""" ATTRIBUTES['current_operating'] = 0.18 ATTRIBUTES['current_rated'] = 0.5 ATTRIBUTES['voltage_rated'] = 20.0 ATTRIBUTES['voltage_ac_operating'] = 0.005 ATTRIBUTES['voltage_dc_operating'] = 6.0 ATTRIBUTES['temperature_rated_max'] = 125.0 ATTRIBUTES['temperature_active'] = temperature_active ATTRIBUTES['environment_active_id'] = environment_active_id _attributes = Component.do_calculate_stress_ratios(**ATTRIBUTES) _attributes = Inductor.calculate_hot_spot_temperature(**_attributes) _attributes = Component.do_check_overstress(**_attributes) assert isinstance(_attributes, dict) if temperature_active == 28.7: assert not _attributes['overstress'] assert _attributes['reason'] == '' elif temperature_active == 118.2: assert _attributes['overstress'] assert _attributes['reason'] == ('1. Operating temperature within ' '15.0C of maximum rated ' 'temperature.\n')
def test_voltage_overstress_mild_environment(power_rated, environment_active_id): """overstressed() should return True when voltage ratio > 0.9 in a mild environment and False otherwise.""" ATTRIBUTES['power_operating'] = 0.47 ATTRIBUTES['temperature_rated_max'] = 150.0 ATTRIBUTES['temperature_active'] = 48.7 ATTRIBUTES['power_rated'] = power_rated ATTRIBUTES['environment_active_id'] = environment_active_id _attributes = Component.do_calculate_stress_ratios(**ATTRIBUTES) _attributes = Component.do_check_overstress(**_attributes) assert isinstance(_attributes, dict) if power_rated == 1.0: assert not _attributes['overstress'] assert _attributes['reason'] == '' elif power_rated == 0.5: assert _attributes['overstress'] assert _attributes['reason'] == ('1. Operating power > 90% rated ' 'power in mild environment.\n')
def test_temperature_overstress_harsh_environment(temperature_junction, environment_active_id): """overstressed() should return True when junction temperature is >125C in a harsh environment and False otherwise.""" ATTRIBUTES['power_operating'] = 0.18 ATTRIBUTES['power_rated'] = 0.5 ATTRIBUTES['temperature_rated_max'] = 125.0 ATTRIBUTES['temperature_junction'] = temperature_junction ATTRIBUTES['environment_active_id'] = environment_active_id _attributes = Component.do_calculate_stress_ratios(**ATTRIBUTES) _attributes = Component.do_check_overstress(**_attributes) assert isinstance(_attributes, dict) if temperature_junction == 128.2: assert _attributes['overstress'] assert _attributes['reason'] == ('1. Junction temperature > 125.0C ' 'in harsh environment.\n') elif temperature_junction == 28.7: assert not _attributes['overstress'] assert _attributes['reason'] == ''
def test_voltage_overstress_harsh_environment(voltage_rated, environment_active_id): """overstressed() should return True when voltage ratio > 0.6 in a harsh environment and False otherwise.""" ATTRIBUTES['voltage_ac_operating'] = 0.005 ATTRIBUTES['voltage_dc_operating'] = 15.0 ATTRIBUTES['temperature_rated_max'] = 125.0 ATTRIBUTES['temperature_active'] = 48.7 ATTRIBUTES['voltage_rated'] = voltage_rated ATTRIBUTES['environment_active_id'] = environment_active_id _attributes = Component.do_calculate_stress_ratios(**ATTRIBUTES) _attributes = Component.do_check_overstress(**_attributes) assert isinstance(_attributes, dict) if voltage_rated == 40.0: assert not _attributes['overstress'] assert _attributes['reason'] == '' elif voltage_rated == 20.0: assert _attributes['overstress'] assert _attributes['reason'] == ('1. Operating voltage > 70% rated ' 'voltage in harsh environment.\n')
def test_over_voltage(voltage_rated, environment_active_id): """overstressed() should return True when voltage < 0.95 rated in a harsh environment and False otherwise.""" ATTRIBUTES['current_operating'] = 0.005 ATTRIBUTES['current_rated'] = 0.01 ATTRIBUTES['voltage_ac_operating'] = 0.005 ATTRIBUTES['voltage_dc_operating'] = 4.95 ATTRIBUTES['voltage_rated'] = voltage_rated ATTRIBUTES['environment_active_id'] = environment_active_id ATTRIBUTES['temperature_junction'] = 89.4 _attributes = Component.do_calculate_stress_ratios(**ATTRIBUTES) _attributes = Component.do_check_overstress(**_attributes) assert isinstance(_attributes, dict) if voltage_rated == 5.0: assert not _attributes['overstress'] assert _attributes['reason'] == '' elif voltage_rated == 3.3: assert _attributes['overstress'] assert _attributes['reason'] == ('1. Operating voltage > 105% rated ' 'voltage.\n')
def test_temperature_overstress_harsh_environment(temperature_junction, environment_active_id): """overstressed() should return True when hot spot temperature is within 15C of rated temperature in a harsh environment and False otherwise.""" ATTRIBUTES['current_operating'] = 0.18 ATTRIBUTES['current_rated'] = 0.5 ATTRIBUTES['voltage_rated'] = 5.0 ATTRIBUTES['voltage_ac_operating'] = 0.005 ATTRIBUTES['voltage_dc_operating'] = 4.95 ATTRIBUTES['temperature_rated_max'] = 125.0 ATTRIBUTES['temperature_junction'] = temperature_junction ATTRIBUTES['environment_active_id'] = environment_active_id _attributes = Component.do_calculate_stress_ratios(**ATTRIBUTES) _attributes = Component.do_check_overstress(**_attributes) assert isinstance(_attributes, dict) if temperature_junction == 28.7: assert not _attributes['overstress'] assert _attributes['reason'] == '' elif temperature_junction == 138.0: assert _attributes['overstress'] assert _attributes['reason'] == ('1. Junction temperature > ' '125.000000C.\n')
def test_current_overstress_mild_environment(current_rated, environment_active_id): """overstressed() should return True when current ratio > 0.9 in a mild environment and False otherwise.""" ATTRIBUTES['current_operating'] = 0.48 ATTRIBUTES['current_rated'] = current_rated ATTRIBUTES['voltage_ac_operating'] = 0.02 ATTRIBUTES['voltage_dc_operating'] = 6.0 ATTRIBUTES['temperature_rated_max'] = 150.0 ATTRIBUTES['temperature_active'] = 48.7 ATTRIBUTES['voltage_rated'] = 15.0 ATTRIBUTES['environment_active_id'] = environment_active_id _attributes = Component.do_calculate_stress_ratios(**ATTRIBUTES) _attributes = Inductor.calculate_hot_spot_temperature(**_attributes) _attributes = Component.do_check_overstress(**_attributes) assert isinstance(_attributes, dict) if current_rated == 1.0: assert not _attributes['overstress'] assert _attributes['reason'] == '' elif current_rated == 0.5: assert _attributes['overstress'] assert _attributes['reason'] == ('1. Operating current > 90% rated ' 'current in mild environment.\n')