how to train a RBF neural network in simulink?

8 visualizaciones (últimos 30 días)
Saurabh Bishnoi
Saurabh Bishnoi el 3 de Nov. de 2016
Respondida: Purvaja el 13 de Jun. de 2025
I want to design a controller which takes in input and produces the same output and the RBFNN layer will fit a model of inverse of the plant. The inputs are continuous and I a way to implement the radial basis neural network in simulink.

Respuestas (1)

Purvaja
Purvaja el 13 de Jun. de 2025
To design a controller in Simulink using an RBFNN as an inverse model, first train the RBFNN in MATLAB to approximate the inverse of the plant (e.g., for y = sin(u), learn u = asin(y)), then generate a function using genFunction. Load this generate function in Simulink using “Matlab Function Block”. Go through following steps to perform the same:
  1. Create RBFNN in Matlab:
u = linspace(-pi/2, pi/2, 100);
y = sin(u);
% Inverse modeling: input = sin(u), target = u
inputs = y;
targets = u;
% RBFNN training
spread = 0.1;
goalMSE = 1e-6;
maxNeurons = 20;
net = newrb(inputs, targets, goalMSE, spread, maxNeurons, 1);
% Test data
% Performance
% Plot
% Save
save('inverseRBF_data.mat', 'inputs', 'targets');
save('inverseRBF_net.mat', 'net');
genFunction(net, 'inverseRBF_net', 'MatrixOnly', 'yes');
2. Load the model and data:
>> load("inverseRBF_data.mat")
>> load("inverseRBF_net.mat")
3. Build Simulink model: Provide the desired plant output using a signal generator or input data. Feed this to the RBFNN, which predicts the corresponding plant input. Pass this predicted input to the plant, then compare the plant’s output with the original desired output to evaluate performance.
4. Load the RBFNN in Simulink:
  • Use the “MATLAB Function block to load the RBFNN and implement the inverse model.
  • Inside the MATLAB Function block, use the following code:
function output = rbf_inverse_model(input)
load('rbf_network.mat', 'net');
output = net(input);
end
5. Simulate the Model:
For more information on the methods and concepts used, find the following official MathWorks documentations:
  1. Radial Basis Function: https://www.mathworks.com/help/deeplearning/ref/newrb.html
  2. Radial Basis neural networks: https://www.mathworks.com/help/deeplearning/ug/radial-basis-neural-networks.html
  3. GenFunction: https://www.mathworks.com/help/deeplearning/ref/network.genfunction.html
  4. Load: https://www.mathworks.com/help/matlab/ref/load.html
  5. Save: https://www.mathworks.com/help/matlab/ref/save.html

Categorías

Más información sobre Deep Learning Toolbox en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by