Neural Network NARX - too high error

1 view (last 30 days)
gilles Del
gilles Del on 13 May 2020
Hello,
I want a Neural Network which simulate the evolution of a pendulum attached to a cart with external forces. Thus i generate data from ODE (20 samples of 2000 timesteps of 4 elements) and use them to train a NARX neural network (using the nnstart tool). Once the network is trained, i want to use the neural network to predict the evolution of the system. So i use the nets (from the genrated matlab code which allows to evaluate the next step)
nets = removedelay(net);
Then i simulate the evolution with a constant external input
Simtime=2; % Simulation time
Ts=0.01; % Sampling time
X=cell(2,1);
X{1}=[7]'; % Constant external input
X{2}=[0 0 0.2 0]'; % Initial states
states_nn=zeros(Simtime/Ts,4);
states_nn(1,:)=initial_cond;
for i=1:Simtime/Ts
[Y,~,~] = sim(nets,X);
X{1}=[1];
X{2}=Y{1};
states_nn(i+1,:)=Y{1}';
end
But when i compare neural network evolution and the ODE evolution results are bad. I tried to midify number of layer, size of layer, number of epoch, performance function, activation function but nothing leads to significant better results.
I read and tried many things but nothing semmes to work. Do you have any advice ? Thank you

Answers (0)

Categories

Find more on Sequence and Numeric Feature Data Workflows in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!