メインコンテンツ

sschdl.tuneOptimizedModel

Tune parameter values for dynamic switches optimized for FPGA deployment

Since R2026a

    Description

    tunedParams = sschdl.tuneOptimizedModel(originalModel) returns the tuned dynamic switch parameter values for the corresponding Simscape™ switches in the original Simscape model.

    tunedParams = sschdl.tuneOptimizedModel(originalModel,Name=Value) specifies options using one or more name-value arguments. For example, to enable fine-tuning of the parameter values for the dynamic switches in the FPGA HIL optimized model, specify FineTune as true.

    Examples

    collapse all

    Open the synchronous buck converter model.

    modelName = "sschdlexSynchronousBuckConverterExample";
    open_system(modelName)
    

    Generate optimized model by running the sschdl.generateOptimizedModel function.

    generatedModel = sschdl.generateOptimizedModel("sschdlexSynchronousBuckConverterExample");
    
    The following blocks have been replaced: 
    'sschdlexSynchronousBuckConverterExample/FPGA Subsystem/Diode'
    'sschdlexSynchronousBuckConverterExample/FPGA Subsystem/Diode1'
    'sschdlexSynchronousBuckConverterExample/FPGA Subsystem/IGBT (Ideal, Switching)1'
    'sschdlexSynchronousBuckConverterExample/FPGA Subsystem/IGBT (Ideal, Switching)2'
    
    Saving sschdlexSynchronousBuckConverterExample as sschdlexSynchronousBuckConverterExample_generated and replacing switch and converter blocks with equivalent FPGA HIL supported blocks.
    

    To tune the parameter values for the dynamic switches in the generated model, use the sschdl.tuneOptimizedModel function.

    optMdl = "sschdlexSynchronousBuckConverterExample_generated";
    tunedParams = sschdl.tuneOptimizedModel("sschdlexSynchronousBuckConverterExample",...
        optimizedModel=optMdl,FineTune=true);
    
     Optimization started 2026-Jan-24, 21:18:44
    
                                              First-order 
     Iter F-count        f(x)      Step-size  optimality
        0      9      24945.5            1
        1     18      5122.03       0.3777     3.91e+04
        2     27       968.52       0.6544     7.09e+03
        3     36      258.803        2.454     8.27e+03
        4     45      258.803        4.946     8.27e+03
        5     54      221.762        1.237     2.35e+03
        6     63      221.762        2.473     2.35e+03
        7     72      221.762       0.6183     2.35e+03
        8     81      221.762       0.1546     2.35e+03
        9     90      221.762      0.03864     2.35e+03
       10     99      214.371     0.009661     4.35e+03
       11    108      213.828     0.009661     1.78e+03
       12    117      213.007     0.002415     1.82e+03
       13    126      212.653    0.0006038     1.83e+03
    Local minimum possible.
    lsqnonlin stopped because the size of the current step is less than
    the value of the step size tolerance.
    
    <stopping criteria details>
    

    The tunedParams variable stores the tuned parameter values after the optimization.

    Simulate the baseline (Simscape) model and the generated optimized model to observe the performance after tuning.

    You can see the output waveform and compare the Simscape model and the generated optimized model. To see the waveform, double-click the Data Logger on top of the output signals and open the Simulation Data Inspector.

    Input Arguments

    collapse all

    Simscape plant model name, specified as a character vector or string scalar.

    Data Types: char | string

    Name-Value Arguments

    collapse all

    Specify optional pairs of arguments as Name1=Value1,...,NameN=ValueN, where Name is the argument name and Value is the corresponding value. Name-value arguments must appear after other arguments, but the order of the pairs does not matter.

    Example: tunedParams = sschdl.tuneOptimizedModel("sschdlexPMSMDriveOptimizedMotor",optimizedModel=optMdl,FineTune=true);

    Name of the optimized model containing dynamic switches, specified as a character vector or string scalar. When you tune parameter values of the dynamic switches, the tuned values are stored in the base workspace variables and referenced in the optimized model.

    For details on how to generate optimized model by using dynamic switches, see Generate HDL Code for Simscape Models by Using Dynamic Switch Approximation.

    Data Types: char | string

    Option to enable fine-tuning of the parameter values for the dynamic switches in the generated FPGA HIL optimized model, specified as numeric or logical 1 (true) or 0 (false).

    Dependencies

    To fine-tune the parameter values for the dynamic switches, you require a Simulink® Design Optimization™ toolbox license.

    Data Types: logical

    Output Arguments

    collapse all

    Tuned parameter values for the dynamic switches in the generated optimized model, returned as a structure array.

    Version History

    Introduced in R2026a