sschdl.generateOptimizedModel
R2026bReplace Simscape switches, converter blocks, and machine blocks with optimized equivalents for FPGA deployment
Since R2024a
Syntax
Description
returns an optimized model for FPGA deployment. The function replaces common Simscape™ switches, converter blocks, and machine blocks with their optimized
equivalents and generates an optimized model. To learn more about dynamic (optimized)
switch replacement, see Generate HDL Code for Simscape Models by Using Dynamic Switch Approximation.generatedModel = sschdl.generateOptimizedModel(input)
replaces Simscape switches or PMSM (Simscape Electrical) block, or machine blocks with
optimized equivalents and tunes the parameter values for the dynamic switches using one or
more name-value arguments.generatedModel = sschdl.generateOptimizedModel(input,Name=Value)
The generated optimized model has the same name as input but
with the suffix _generated. Once the optimized model is generated, open
the model and verify the connection. Connect any gate signal inports of the replaced
blocks to their respective sources and remove additional Simulink-PS Converter (Simscape) blocks.
Examples
Input Arguments
Name-Value Arguments
Output Arguments
Limitations
In the model, if a parameter references any workspace variable or an expression, then the parameter value is replaced by the evaluated value.
To be compatible for replacement with the
ReplaceMachinesoption, the Simscape machine blocks must use the parameter configurations listed in this table:Parameter PMSM (Simscape Electrical) BLDC (Simscape Electrical) FEM-Parameterized PMSM (Simscape Electrical) Hybrid Excitation PMSM (Simscape Electrical) Switched Reluctance Machine (Simscape Electrical) Modeling option No thermal portNo thermal port2-D partial derivative data | No thermal portNo thermal portNo thermal portElectrical connection Expanded three-phase portsExpanded three-phase ports— Expanded three-phase portsExpanded three-phase portsWinding type Wye-woundorDelta-woundWye-woundorDelta-woundWye-woundorDelta-woundWye-woundorDelta-wound— Modeling fidelity Constant Ld, Lq and PMConstant Ld and Lq— Constant Ld, Lq, Lmf, Lf, and PM— Stator parameterization Specify Ld, Lq, and L0Specify Ld, Lq, and L0— Specify Ld, Lq, and L0Specify parametric dataPermanent magnet flux linkage parameterization Specify flux linkage— — — — Zero sequence ExcludeExclude— Exclude— Rotor angle definition Angle between the a-phase magnetic axis and the q-axisAngle between the a-phase magnetic axis and the q-axis— Angle between the a-phase magnetic axis and the q-axis— Model NoneNoneNone— NoneRotor damping '0''0''0''0''0'Ld matrix, Ld(id,iq) Nonzero Nonzero Nonzero Nonzero — Lq matrix, Lq(id,iq) Nonzero Nonzero Nonzero Nonzero — Back EMF profile — All Back EMF profile options supported — — — Interpolation method — — Linear— — The generated optimized machine block operates in either torque-driven or speed-driven mode. Set the External load parameter to
'Torque-driven'or'Speed-driven'based on whether the mechanical network applies a torque or speed load to the motor. In torque-driven mode, model inertia within the motor. In speed-driven mode, model inertia externally in the mechanical network. The optimized machine block does not support modeling external inertia in the mechanical network while in torque-driven mode.
Version History
Introduced in R2024aSee Also
sschdladvisor | sschdl.tuneOptimizedModel
Topics
- Generate HDL Code for Simscape Models by Using Dynamic Switch Approximation
- Synchronous Buck Converter for Real-Time FPGA Deployment
- Tune Parameter Values for Dynamic Switches in Half-Wave Rectifier Model
- Linearize Models with Converters Using Averaged Switching (Simscape Electrical)
- Generate Optimized Simscape Three-Phase PMSM Drive Model for Real-Time FPGA HIL Deployment




