Friday, 6 December 2024

Temperature Profile of Heating Device using Data Logger and Scilab

Topic: Heating Device Temperature Profiling and Analysis;

Subject: Heat Transfer;

Tool: Temperature Data Logger and Scilab;

By: Gani Comia, Dec. 2024;

Data logger nowadays has a built-in software and computer interface to visualize in real-time as in this case the temperature profile of a device being monitored. However, for data analysis and reporting, a software like Scilab comes into picture.

Presented in this article is an example of visual report of temperature data over time. Data points from the logger can be extracted in the form of .CSV file. Transforming this data may sometimes be needed before an analysis be taken. The Scilab scripting facilitates the analysis and presentation of data for reporting.

Fig.1. Temperature Profile using Scilab

Shown below is the script to generate the graph of the data points.

Scilab Script:

// Copyright (C) 2024 - Gani Comia
// Date of creation: 6 Dec 2024
// Heating Oven Temperature Profile using Data Logger & Scilab
clear;clc;
// data extraction
clear importdata;

function [data]=importdata(filename)
    data = csvRead(filename, ",", ".", "double")
endfunction

[A] = importdata("temp_profile_after_repair_xform.csv");

// data transformation
time = A(2:$,13);
ovenWallTemp = A(2:$,2);
partTemp = A(2:$,9);
// average temperature
avgWallTemp = mean(ovenWallTemp)
avgPartTemp = mean(partTemp)

// data visualization
clf;
f=gcf();
f.figure_size=[900,600];
plot(time,ovenWallTemp,"-b","linewidth",1.75)
plot(time,partTemp,"--r","linewidth",1)
legend(["Oven Wall","Workpiece"],"in_upper_right")
title("Heating Oven Temp Profile from Data Logger")
xlabel("Time [ min ]")
ylabel("Temperature [ deg C ]")

a=gca(); 
// x & y-axis range
a.data_bounds = [0 230;780 250]; 

// additional plot properties
t = 0:60:840;
temp = [230 232 250];

// hourly vertical lines
for i = 2:length(t)
    plot([t(i),t(i)],[temp(1),temp(3)],"--y","linewidth",1)
end

// target temperature horizontal lines
plot([t(1),t($)],[temp(2),temp(2)],"--k","linewidth",1)
xstring(5,232,"Std = 232 C")
xstring(625,232,"https://gani-mech-toolbox.blogspot.com")

// hourly label 
minute = 60;
hour = 1;
for i = 2:length(t)
    note = [string(hour),"hour(s)"]
    xstring(minute,235,note,-90)
    minute = minute + 60;
    hour = hour + 1;
end

// average oven temp lines
plot([t(1),t($)],[avgWallTemp,avgWallTemp],"--b","linewidth",1)
noteWall = ["Avg Wall Temp:",string(round(avgWallTemp)),"C"]
xstring(5,avgWallTemp+0.8,noteWall)

// average part temp lines
plot([t(1),t($)],[avgPartTemp,avgPartTemp],"--r","linewidth",1)
notePart = ["Avg Part Temp:",string(round(avgPartTemp)),"C"]
xstring(5,avgPartTemp+0.5,notePart)

This toolbox of Scilab script can be handy reference to analyze data points and present it in the form of graphs for better understanding of numerical data.

Feel free to comment for inquiry, clarification, or suggestion for improvement. Drop your email to request the softcopy of the file.

No comments:

Post a Comment

C++ and Python for Numerical Solution to Spring-Mass-Damper Model

Topic: SDOF Spring-Mass-Damper System Subject: Numerical Methods & Mechanical Vibration Tools: C++, CodeBlocks, GitHub Copilot, LabP...