Preparazione del modello in tempo reale
La preparazione di un modello Simscape per il tempo reale comporta un bilanciamento iterativo tra prestazioni e fedeltà, al fine di produrre risultati accurati con un costo e un passo temporale sufficientemente ridotti per la macchina di destinazione. Si inizia ottenendo i risultati di riferimento dal modello. Quando il modello produce risultati accurati rispetto ai risultati di riferimento utilizzando un risolutore a passo fisso, è possibile provare a distribuire il modello sul target in tempo reale. Eseguire questi passaggi secondo necessità per bilanciare prestazioni e fedeltà:
Utilizzare blocchi ideali o a livello di sistema e parametrizzazioni ideali al posto di blocchi e parametrizzazioni più complessi.
Eliminare le sorgenti di dinamica rapida.
Eliminare le sorgenti di rigidità numerica.
Eliminare le sorgenti di passaggio per lo zero.
Utilizzare il risolutore di partizionamento.
Partizionare il modello.
Minimizzare le iterazioni del risolutore.
Per la distribuzione su FPGA, ridurre le sorgenti di modalità.
Per analizzare la prestazione del risolutore in termini di dinamiche rapide e rigidità numeriche, utilizzare lo strumento Solver Profiler. Quando si è pronti a convertire il metodo in un metodo a passo fisso e a costo fisso, utilizzare la funzione simscape.getLocalSolverFixedCostInfo per determinare il numero di iterazioni non lineari da eseguire.
Strumenti
| Solver Profiler | Identify solver performance bottlenecks |
Funzioni
simscape.getLocalSolverFixedCostInfo | Determine iteration requirement when transitioning to fixed cost (Da R2021b) |
Argomenti
Impostazione a passo fisso e costo fisso
- Examine Model Dynamics Using Solver Profiler
Identify factors affecting model simulation using the Solver Profiler. - Solvers for Real-Time Simulation
The fixed-step solver, step size, and number of iterations that you specify affect how your Simscape™ model simulates in real time. - Identify and Resolve System Stiffness in Simscape Models
Analyze the effect of particular block variables on overall system stiffness of a Simscape network. - Define Step Size and Number of Nonlinear Iterations for Simscape Real-Time Simulation
Determine the step size and number of nonlinear iterations for fixed-step, fixed-cost simulation. - Estimate Computation Costs
Determine if your Simscape model is likely to cause an overrun when you simulate it on your real-time target machine by estimating computational costs.
Ottimizzazione delle prestazioni
- Reduce Zero Crossings
Eliminate components that cause zero crossings to increase the minimal step-size for fixed-step simulation and to make your Simscape model real-time capable. - Increase Simulation Speed Using the Partitioning Solver
Improve performance by using the Simscape Partitioning solver to convert a large system of equations into several smaller systems of equations that are easier to solve.
Distribuzione su FPGA
- Get Started with Simscape Hardware-in-the-Loop Workflow (HDL Coder)
Simscape Hardware-in-the-Loop workflow modeling guidelines and restrictions. - Simscape Language Support for FPGA HIL Deployment (HDL Coder)
Simscape language support in Simscape Hardware-in-the-Loop Workflow. - Modeling Guidelines for Simscape Subsystem Replacement (HDL Coder)
Simscape modeling best practices for replacing Simscape subsystem with state-space algorithm. - Replace Piecewise-Constant Resistor with Switched Linear Components (HDL Coder)
Convert a Simscape model with nonlinear component into a switched linear model. - Estimate Achievable Target Frequency Without Running Synthesis (HDL Coder)
Estimate the optimal frequency that you want your Simscape models to achieve on FPGA without running synthesis. - Modeling Techniques for Simscape Converters for FPGA HIL Deployment (HDL Coder)
Model your power electronic converter by using hardware-in-the-loop (HIL) simulation in a real-time target machine.
Piattaforme generiche
- Requirements for Using Alternative Platforms
Follow the recommendations for minimum hardware, software, and compiler specifications to deploy your Simscape model for hardware-in-the-loop (HIL) simulation using a custom standalone application. - Embedded and Generic Real-Time Resources
Simulink® Coder™ and Embedded Coder® use system target files (STFs) to generate code for interfacing with specific real-time operating systems.

