Main Content

sscnew

Create new Simscape model populated by required and commonly used blocks

Since R2024b

Description

sscnew creates a new Simscape™ model, with required and commonly used blocks already on the model canvas. The model uses the recommended solver VariableStepAuto with the absolute tolerance, AbsTol, set to 1e-3.

The function also turns on simulation data logging for the whole model, using the default workspace variable name simlog and limiting the logged simulation data to 10000 points. For more information, see Data Logging.

By default, the function uses the Simulink® default new model name untitled and the recommended solver VariableStepAuto.

Using sscnew to create a model is equivalent to opening the corresponding Simscape template from the Simulink Start Page.

example

sscnew(modelname) creates a new Simscape model with the specified name.

sscnew(modelnamedomain) creates a new Simscape model with the specified name and with domain-specific blocks added to the model canvas.

example

Examples

collapse all

To create a generic Simscape model, type:

sscnew

The software creates a new untitled model, with the default solver set to VariableStepAuto. The model contains a Solver Configuration block, a Simulink-PS Converter block, and a PS-Simulink Converter block connected to a Scope block.

After using sscnew, continue developing your model by copying the blocks, as needed, and adding other blocks from the Simscape libraries. Use the resources links at the bottom of the model window to open the main Simscape library and access documentation topics that help you get started.

To create a gas model, called pneumatic_actuator, type:

sscnew('pneumatic_actuator','gas')

The software creates the following model.

After using sscnew, continue developing your model by copying the blocks, as needed, and adding other blocks from the Simscape libraries. Use the resources links at the bottom of the model window to open the relevant block libraries and access documentation topics that help you get started.

Input Arguments

collapse all

Name of the new model, specified as a character vector or string scalar.

Example: 'HydraulicActuator'

Domain type for the new model, specified as a character vector or string scalar. This argument lets you automatically add domain-specific blocks to the model canvas when creating the model. The model can have blocks that belong to more than one domain and you can add more domain-specific blocks manually, as needed. For example, if you specify the domain type as 'isothermal_liquid', the function automatically adds the Isothermal Liquid Properties (IL) block to the model canvas. If your model also contains a thermal liquid circuit, you must add the Thermal Liquid Settings (TL) block to it manually.

Example: 'two_phase_fluid'

Version History

Introduced in R2024b