Body function and systems
# Negative feedback example: Thermoregulation
def thermoregulation(body_temp, set_point=37.0):
"""
Maintain body temperature.
"""
deviation = body_temp - set_point
if deviation > 0.5:
# Too hot: vasodilation, sweating
return {'response': 'cooling', 'mechanisms': ['sweating', 'vasodilation']}
elif deviation < -0.5:
# Too cold: vasoconstriction, shivering
return {'response': 'warming', 'mechanisms': ['shivering', 'vasoconstriction']}
else:
return {'response': 'normal'}
# Feedback types
feedback_types = {
'negative': 'Counteracts change (most common)',
'positive': 'Amplifies change (rare, e.g., childbirth)'
}