Neural State-Space Model
Libraries:
System Identification Toolbox /
Models
Description
Simulates neural state-space (idNeuralStateSpace) models.
Ports
Input
Input of the neural state-space model, specified as a vector signal with as many
elements as the number of inputs you specify when creating the corresponding
idNeuralStateSpace object. If the
idNeuralStateSpace object specified in the block dialog box does
not have inputs, this port does not appear.
Initial state of the neural state-space model, specified as a vector signal with
as many elements as the number of states you specify when creating the corresponding
idNeuralStateSpace object.
Dependencies
To enable this input port, select the initial state source
parameter as External. Then, connect the port to an
upstream signal supplying the value of the initial state.
Output
Output of the neural state-space model, returned as a vector signal with as many
elements as the number of outputs you specify when creating the corresponding
idNeuralStateSpace object.
State of the neural state-space model, output as a vector signal with as many
elements as the number of states nx that you
specify when creating the corresponding idNeuralStateSpace object.
These values are identical to the first nx
values in the y output.
Dependencies
To enable this output port, select the Output state parameter.
State derivative or state difference of the neural state-space model, output as a
vector signal with as many elements as the number of states you specify when creating
the corresponding idNeuralStateSpace object.
For continuous-time neural state space models, this value is the derivative of the state with respect to time. For discrete-time neural state space models, this value is the difference between the next state and the current one.
Dependencies
To enable this output port, select the Output state derivative/difference parameter.
Internal (latent) state of the neural state-space model, output as a vector signal
with as many elements as the value of the LatentDim
property that you specify when creating the corresponding
idNeuralStateSpace object.
Dependencies
To enable this output port, specify the value of the
LatentDim property of the idNeuralStateSpace
object as a finite positive scalar and select the Output state
parameter.
Internal (latent) state derivative or latent state difference of the neural
state-space model, output as a vector signal with as many elements as the value of the
LatentDim
property that you specify when creating the corresponding
idNeuralStateSpace object.
For continuous-time neural state space models, this value is the derivative of the latent state with respect to time. For discrete-time neural state space models, this value is the difference between the next latent state and the current one.
Dependencies
To enable this output port, specify the value of the
LatentDim property of the idNeuralStateSpace
object as a finite positive scalar and select the Output state
derivative/difference parameter.
Parameters
Specify an idNeuralStateSpace object that defines a neural state-space system by
entering the name of an idNeuralStateSpace object from the
MATLAB® workspace.
Currently, the Neural State-Space Model block does not support
idNeuralStateSpace objects whose neural network layer activation
functions are elu, swish,
softplus, or scaling.
Note
If you change the input/output configuration of Model in the
workspace, click the ... button next to the
Model edit field in the block dialog box to refresh the
Neural State-Space Model block.
Programmatic Use
Block Parameter:
sys |
| Type: string, character vector |
Default:
"idNeuralStateSpace(1,'NumInputs',1,'NumOutputs',2)" |
Specify whether to enter the initial condition directly on the dialog box or to receive the initial condition from an input port.
If you set Initial state source to
internal, enter the initial condition in the edit field under Initial state.If you set Initial state source to
external, the input portx0is added to the block. You must then connect an upstream signal supplying the value of the initial state to thex0input port.
Programmatic Use
Block Parameter:
x0type |
| Type: character vector |
Values: 'internal' |
'external'
|
Default:
'internal' |
Specify the initial state of the neural state-space object as a vector of
nx entries, where
nx is the number of states in
Model.
Use this parameter make sure that the system states reflect the true plant environment at the start of your simulation, to the best of your knowledge.
Programmatic Use
Block Parameter:
ic |
| Type: string, character vector |
Default:
"0" |
Select this parameter to add the x output port to the block.
During simulation this port outputs the internal state of the idNeuralStateSpace object specified in Model.
Programmatic Use
Block Parameter:
returnx |
| Type: string, character vector |
Values:
"off", "on" |
Default:
"off" |
Select this parameter to add the dx output port to the block.
During simulation this port outputs the time derivative of the internal state of the
idNeuralStateSpace object specified in Model.
Programmatic Use
Block Parameter:
returndx |
| Type: string, character vector |
Values:
"off", "on" |
Default:
"off" |
Extended Capabilities
C/C++ Code Generation
Generate C and C++ code using Simulink® Coder™.
Version History
Introduced in R2022bStarting in 2024b, temporary .m files will no longer be created in
the current folder when updating the Neural State-Space Model Block for
prediction and code generation.
However, if the structure of the dlnetwork object assigned to the state
or output networks of the neural state-space object is not a multi-layer perceptron (MLP)
network, then the implementation of the Neural State-Space Model Block uses
the Predict (Deep Learning Toolbox) Block and
.mat files will still be generated in the current folder. In all other
cases, .mat files will also not be created.
See Also
Objects
Functions
nlssest|createMLPNetwork|setNetwork|nssTrainingOptions|generateMATLABFunction|sim|idNeuralStateSpace/evaluate|idNeuralStateSpace/linearize
Live Editor Tasks
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Website auswählen
Wählen Sie eine Website aus, um übersetzte Inhalte (sofern verfügbar) sowie lokale Veranstaltungen und Angebote anzuzeigen. Auf der Grundlage Ihres Standorts empfehlen wir Ihnen die folgende Auswahl: .
Sie können auch eine Website aus der folgenden Liste auswählen:
So erhalten Sie die bestmögliche Leistung auf der Website
Wählen Sie für die bestmögliche Website-Leistung die Website für China (auf Chinesisch oder Englisch). Andere landesspezifische Websites von MathWorks sind für Besuche von Ihrem Standort aus nicht optimiert.
Amerika
- América Latina (Español)
- Canada (English)
- United States (English)
Europa
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)