Training a data in open loop and testing other data in closed loop

2 次查看(过去 30 天)

Hi, I am working on dynamic modelling of gas turbine using neural network where I need to predict spool speed response using fuel flow as input. Currently I am predicting new speed using measured data Fuel flow and N1) from experimental runs by training a part of data in open loop and then I want to test the same network in closed loop for new data(left out data). but I am not getting proper results. Could anyone suggest that is it possible to train on one data and test on other data. I am attaching the codes below.

if true
  % code
end
 close all;
clear all;
clc;
% load input\output data
load akash_complete.dat
FuelFlowLhr = akash_complete(:,12);
N1RPM = akash_complete(:,15);
T1 = akash_complete(:,2);
P1 = akash_complete(:,7);
x_1 = FuelFlowLhr(150:680,:);
y_1 = T1(150:680,:);
z_1 = P1(150:680,:);
t_1 = N1RPM(150:680,:);
X = [x_1];%, y_1, z_1];
T = [t_1];
x = con2seq(X');
t = con2seq(T');
setdemorandstream(491987381);
inputDelays = 0:1;
a = 2;
feedbackDelays = 1:a;
hiddenLayerSize = 15;
net = narxnet(inputDelays,feedbackDelays,hiddenLayerSize);
view(net);
[xs,xi,ai,ts] = preparets(net,x,{},t);
[net,tr] = train(net,xs,ts,xi,ai);
nntraintool
Y = net(xs,xi,ai);
y0 = cell2mat(Y');
E = gsubtract(ts,Y);
perf = mse(net,ts,Y);
figure(1);
b= 530-(a-1);
plot(x_1(1:b),y0,'linewidth',3)
hold on
plot(x_1(1:b),t_1(1:b),'linewidth',3)
grid on
xlabel('Fuel flow (L/Hr)')
ylabel('N1RPM')
title('experimental versus predicted')
yp = sim(net,xs,xi);
e = cell2mat(yp)-cell2mat(ts);
figure(5);
plot(e)
netc = closeloop(net);
u = FuelFlowLhr(681:850);
y = N1RPM(681:850);
u1 = con2seq(u');
y1 = con2seq(y');
[p1,Pi1,Ai1,t1] = preparets(netc,u1,{},y1);
outputsc = netc(p1,Pi1,Ai1);
errors = gsubtract(t1,outputsc);
perf = perform(netc,t1,outputsc);
view(netc)
y2 = cell2mat(outputsc);
N1 = cell2mat(t1);
figure(3)
plot(u(1:168,:)',y2,'linewidth',2)
hold on
plot(u(1:168,:)',N1,'linewidth',2)
grid on

采纳的回答

Greg Heath
Greg Heath 2017-8-22
编辑:Greg Heath 2017-8-22
1. Design 10 or more OL nets ( neto1, neto2, ..., neto10, ...)
2. Close the loop on the successful designs to obtain initial CL designs ( e.g., netc1, netc3, netc6 and netc9 ).
3. Check the CL net performances on the original data.
4. If performance of a CL net on the original data is unsatisfactory, try to train it further using the original data.
5. Rank all successful CL nets. If none exist, go back to 1.
Don't be surprised if you need 20 or 30 OL nets to obtain 1 good CL net.
6. Once you have one or more successful CL nets, you can try them on new data that have, approximately, the same stationary statistics(i.e., mean, variance and correlation coefficients).
Hope this helps,
Thank you for formally accepting my answer
Greg

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Deep Learning Toolbox 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by