Training a data in open loop and testing other data in closed loop
Mostrar comentarios más antiguos
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 onRespuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Deep Learning Toolbox en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!