viewof componentType = Inputs.select(
["Motor Bearing", "Electrical Connection", "Gearbox Oil"],
{
label: "Component Type:",
value: "Motor Bearing"
}
)
viewof ambientTemp = Inputs.range([15, 35], {
label: "Ambient Temperature (°C):",
step: 1,
value: 25
})
viewof measuredTemp = Inputs.range([20, 150], {
label: "Measured Temperature (°C):",
step: 1,
value: 75
})
thermalAnalysis = {
const thresholds = {
"Motor Bearing": {
normal: 70,
warning: 85,
critical: 85,
useAbsolute: true
},
"Electrical Connection": {
normal: 40,
warning: 70,
critical: 70,
useAbsolute: false
},
"Gearbox Oil": {
normal: 80,
warning: 95,
critical: 95,
useAbsolute: true
}
};
const config = thresholds[componentType];
const value = config.useAbsolute ? measuredTemp : (measuredTemp - ambientTemp);
let status, color, recommendation;
if (value < config.normal) {
status = "Normal";
color = "#16A085";
recommendation = "Continue routine monitoring";
} else if (value < config.warning) {
status = "Warning";
color = "#E67E22";
recommendation = "Schedule repair within 1-4 weeks during planned downtime";
} else {
status = "Critical";
color = "#E74C3C";
recommendation = "Immediate action required - schedule emergency repair";
}
return {
value,
status,
color,
recommendation,
displayValue: config.useAbsolute ? `${value}°C` : `${value}°C rise above ambient`,
normalThreshold: config.useAbsolute ? config.normal : config.normal,
warningThreshold: config.useAbsolute ? config.warning : config.warning
};
}
html`<div style="background: ${thermalAnalysis.color}15; padding: 20px; border-radius: 8px; border-left: 4px solid ${thermalAnalysis.color}; margin: 20px 0;">
<div style="display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px;">
<h3 style="margin: 0; color: #2C3E50;">${componentType}</h3>
<div style="background: ${thermalAnalysis.color}; color: white; padding: 8px 16px; border-radius: 20px; font-weight: bold;">
${thermalAnalysis.status}
</div>
</div>
<div style="display: grid; gap: 15px;">
<div>
<div style="color: #7F8C8D; font-size: 0.9em;">Current Temperature</div>
<div style="font-size: 2em; font-weight: bold; color: ${thermalAnalysis.color};">
${thermalAnalysis.displayValue}
</div>
</div>
<div style="background: white; padding: 10px; border-radius: 4px;">
<div style="color: #7F8C8D; font-size: 0.85em; margin-bottom: 5px;">Temperature Range</div>
<div style="display: flex; gap: 10px; align-items: center;">
<div style="flex: 1; height: 20px; background: linear-gradient(to right, #16A085 0%, #16A085 ${(thermalAnalysis.normalThreshold / 150 * 100)}%, #E67E22 ${(thermalAnalysis.normalThreshold / 150 * 100)}%, #E67E22 ${(thermalAnalysis.warningThreshold / 150 * 100)}%, #E74C3C ${(thermalAnalysis.warningThreshold / 150 * 100)}%); border-radius: 10px; position: relative;">
<div style="position: absolute; left: ${(thermalAnalysis.value / 150 * 100)}%; top: -5px; width: 3px; height: 30px; background: #2C3E50;"></div>
</div>
</div>
<div style="display: flex; justify-content: space-between; margin-top: 5px; font-size: 0.8em; color: #7F8C8D;">
<span>0°C</span>
<span>${thermalAnalysis.normalThreshold}°C</span>
<span>${thermalAnalysis.warningThreshold}°C</span>
<span>150°C</span>
</div>
</div>
<div style="background: white; padding: 12px; border-radius: 4px;">
<div style="color: #7F8C8D; font-size: 0.85em; margin-bottom: 5px;">Recommended Action</div>
<div style="color: #2C3E50; font-weight: 500;">${thermalAnalysis.recommendation}</div>
</div>
</div>
</div>`Temperature Thresholds
Temperature Thresholds
animation
iiot
maintenance
Try Change Measured Temperature (°C):, then press Calculate temperature.
Observe After Calculate temperature, watch Current Temperature and Recommended Action.
Explain Explain why ambient temperature affects Electrical Connection analysis after Calculate temperature.
Technical boundaries. Motor Bearing and Gearbox Oil use absolute measured temperature. Electrical Connection uses measured temperature minus ambient temperature, with fixed thresholds for each component.
Temperature Thresholds
| Component | Normal | Warning | Critical |
|---|---|---|---|
| Motor bearings | <70°C | 70-85°C | >85°C |
| Electrical connections | <40°C rise | 40-70°C rise | >70°C rise |
| Gearbox oil | <80°C | 80-95°C | >95°C |