Skip to main content
. 2025 Apr 26;16(5):504. doi: 10.3390/mi16050504
Algorithm 1. Proposed method’s algorithm for thermal conductivity estimation (for each hybrid nanofluid)
Input: T, TC1, TC2, ρ, and hybrid1_datas
Output: pTC, MAE, MSE, MAPE, R2
1 size ← Load(hybrid1_datas)
2 i ← 0
3 if i < 30 then
3.1    wi1=ρ1ρ1+ρ2, wi2=ρ2ρ1+ρ2, hTCi = wi1TCi1+wi2TCi2
3.2    inputDatas(Ti, TCi1, TCi2)
3.3    outputDatas(hTCi)
3.4    i = i + 1, go to step 3
4 trainRatio = 0.8
trainIndex = randperm(size, round(trainRatio * size))
XTrain = inputDatas(trainIndex, :)’, YTrain = outputDatas(trainIndex, :)’
testIndex = setdiff(1:size, trainIndex)
XTest = inputDatas(testIndex, :)’, YTest = outputDatas(testIndex, :)’
net = feedforwardnet([10 10])
net.trainFcn = ‘trainbr’
net.layers{1}.transferFcn = ‘tansig’
net.layers{2}.transferFcn = ‘tansig’
net.layers{3}.transferFcn = ‘purelin’
net.trainParam.epochs = 1000
net.trainParam.goal = 10−1000
5 net = train(net, XTrain, YTrain)
6 pTC = net(XTest)
7 MAE = mean(abs(pTC − YTest))
MSE = mean((pTC − YTest).^2);
MAPE = mean(abs((pTC − YTest)/YTest)) * 100
R2 = 1 − mean(((pTC-YTest).^2)/(YTest.^2))
8 returnpTC, MAE, MSE, MAPE, R2