Train neural network in Simulink

11 次查看(过去 30 天)
Hello everyone, is there a way to train a neural network in Simulink or alternatively import a Modelica/Dymola model into MATLAB and train the network in MATLAB?
I have a Dymola model for which I would like to train a neural network for decision making. Currently, I export my model from Dymola as an FMU and can also load it into Simulink, but I haven't found a function in Simulink to train a network with it. If there is a way to export the network differently from Dymola to solve my problems, that would also help me.
Does anybody know a solution for my problem?

采纳的回答

Pavan Sahith
Pavan Sahith 2024-6-17
Hello Tristan,
I see that you are having a Dymola model and planning to export it as an FMU for use in Simulink. It sounds like your goal is to train your model.
I assume you have the training data, if not, you can prepare the data from your FMU to train the neural network. This involves running simulations with different inputs and collecting the corresponding outputs to create a dataset. Use the 'From Workspace' and 'To Workspace' blocks to handle input and output data between Simulink and MATLAB.
After you have the training data ,you can try the following below steps:
  • MATLAB functions such as trainnet along with trainingOptions can be used to define the training parameters and train the network.
  • Once the neural network is trained, you can use the GENSIM command from the Neural Network Toolbox to export the network to Simulink and simulate it.
  • After integrating the trained network, simulate your Simulink model to validate the performance of the neural network. Adjust the network and retrain as necessary based on the simulation results.
You can refer to the following MathWorks documentation links to know more about
Consider referring to these similar MATLAB answers which might help you
Hope this helps you get started.

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Sequence and Numeric Feature Data Workflows 的更多信息

产品


版本

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by