how to train a RBF neural network in simulink?

8 ビュー (過去 30 日間)
Saurabh Bishnoi
Saurabh Bishnoi 2016 年 11 月 3 日
回答済み: Purvaja 2025 年 6 月 13 日
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.

回答 (1 件)

Purvaja
Purvaja 2025 年 6 月 13 日
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

カテゴリ

Help Center および File ExchangeDeep Learning Toolbox についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by