Datenprotokollierung
Sie können Simulationsdaten im Workspace oder in einer temporären Datei auf der Festplatte protokollieren, um sie zu debuggen und zu verifizieren. Mithilfe der Datenprotokollierung können Sie analysieren, wie sich interne Blockvariablen während der Simulation im Laufe der Zeit verändern. Wenn Sie Simulationsdaten protokollieren, können Sie diese später abfragen, darstellen und analysieren, ohne die Simulation erneut auszuführen. Mithilfe der Simscape™-Datenprotokollierung und der Instrumentierung für die selektive Protokollierung können Sie Blockvariablendaten protokollieren.
Bei der Simscape-Datenprotokollierung werden alle Variablen für ausgewählte Blöcke oder für alle Blöcke im Modell protokolliert und die Daten werden an die Variable im Simulationsprotokoll-Workspace ausgegeben. Mit dem Tool Simscape Results Explorer können Sie die Simscape-Datenprotokollierungsergebnisse interaktiv visualisieren und darin navigieren. Anstatt Ihrem Modell Sensoren und Scopes hinzuzufügen, können Sie zur Anzeige der Simulationsergebnisse die Datenprotokollierung und den Simscape Results Explorer verwenden. Weitere Informationen dazu finden Sie unter Log, Navigate, and Plot Simulation Data.
Bei der selektiven Protokollierung werden nur die ausgewählten Variablen der Blöcke mit aktivierter Protokollierung protokolliert. Simscape protokolliert die Variablen zusammen mit Simulink®-Signalen in einem Simulink.SimulationData.Dataset
-Objekt. Sie können die selektive Protokollierung für Simscape-Blöcke über die Benutzeroberfläche aktivieren. Sie können Blockvariablen für die Protokollierung in der Instrumentierungstabelle anzeigen und auswählen, ohne das Modell zu kompilieren. Zur Visualisierung von Ergebnissen der selektiven Protokollierung verwenden Sie den Simulation Data Inspector. Weitere Informationen dazu finden Sie unter Log Selected Block Variables.
Sie können die Instrumentierung für die selektive Protokollierung auch programmgesteuert verwalten. Weitere Informationen dazu finden Sie unter Log Selected Variables Programmatically.
Tools
Simscape Results Explorer | Navigate and plot simulation data logging results |
Funktionen
Modelleinstellungen
Log simulation data | Option to specify whether to log Simscape simulation data to workspace |
Log simulation statistics | Option to specify whether to log simulation statistics as part of simulation data |
Record data in Simulation Data Inspector | Option to specify whether to stream Simscape data to Simulation Data Inspector |
Open viewer after simulation | Option to specify whether to open Simscape Results Explorer at the end of simulation run |
Workspace variable name | Name of workspace variable for Simscape simulation data logging |
Decimation | Option to reduce logged data points by skipping time steps |
Limit data points | Option to limit number of logged data points |
Data history (last N steps) | Number of data points to log |
Themen
Simscape-Datenprotokollierung
- About Simscape Data Logging
You can log Simscape simulation data to the workspace, or to a temporary file on disk, for debugging and verification. - Enable Simscape Data Logging for the Whole Model
Using data logging for the whole model is a best practice. - Log Data for Selected Blocks Only
Instead of logging Simscape simulation data for the whole model, you can log data just for the selected blocks. - Data Logging Options
Additional options for logging and displaying the simulation data. - Stream Logging Data to Disk
When you log simulation data, you can stream the data to a temporary file on disk and have the workspace variable point to that temporary file. - Saving and Retrieving Logged Simulation Data
Methods of storing logged simulation data for future use and retrieving it at a later time. - Log, Navigate, and Plot Simulation Data
This example shows the basic workflow for logging simulation data for the whole model and then navigating and plotting the logged data using Simscape Results Explorer. - Log and Plot Simulation Data
This example shows how you can log and plot simulation data instead of adding sensors to your model. - Log Simulation Statistics
This example shows how you can access and analyze information on zero crossings during simulation. - Log and View Simulation Data for Selected Blocks
This example shows how you can set your model to log simulation data for selected blocks only and how to view simulation data using Simscape Results Explorer. - Plot Simulation Data in Different Units
When you display logged simulation data in Simscape Results Explorer, you can change they
-axis units directly on the plot. - Use Custom Units to Plot Simulation Data
This example shows how you can change to a custom unit display of logged simulation data. - Indexing into Component Arrays
You can use command-line interface to index into an array of components, for example, to get or set operating point targets for a particular array member, or to plot simulation data.
Selektive Protokollierung
- About Selective Logging
You can output data for selected Simscape block variables along with Simulink variables and signals. - Log Selected Block Variables
Log data for an individual block variable. - Log Selected Variables Programmatically
Programmatically configure selective logging.