Main Content

Model Preparation

Prepare and configure your plant model

Moving your model from desktop simulation to real-time simulation is an iterative process that can require extensive model reconfiguration. You can configure your plant model and create an HDL-compatible version of it for HDL code generation.

To configure your plant model for HDL code generation, use the hdlsetup function. The hdlsetup function sets your model configuration parameters to default values recommended for code generation. You can model the Simscape™ converters for hardware-in-the-loop (HIL) simulations by using either Simscape switches or dynamic switches based on the complexity of your network topology. You choose a solver type (Backward Euler, Trapezoidal Rule, or Partitioning) based on the type of blocks in your model. If you have linear and switched linear blocks in your model, choose the Backward Euler solver type. If you have nonlinear blocks in your model, choose the Partitioning solver type. For more information, see Solver Configuration (Simscape).

Functions

sschdl.generateOptimizedModelReplace Simscape switches and converter blocks with dynamic switches optimized for FPGA deployment (Since R2024a)
sschdl.updateRuntimeParametersGenerate updated tunable parameter data file for Simscape model (Since R2024a)
hdlsetupSet up model parameters for HDL code generation

Topics