Simscape™ models require certain blocks to be present in the model
configuration, such as a Solver block, or domain-specific reference blocks. Other
blocks, although not required, are highly likely to be needed, such as
Simulink-PS Converter and
PS-Simulink Converter blocks. An easy way to
start a new Simscape model is by using the
When you type
ssc_new at the MATLAB® Command prompt, the software creates a new model prepopulated with
certain blocks. By default, Simulink® Editor hides the block names in the model diagram. To display hidden
block names, select Display and clear the
Hide Automatic Names check box.
By default, the model name is not specified, the model contains a Solver
Configuration block, a Simulink-PS
Converter block, and a PS-Simulink
Converter block connected to a Scope block. The
default solver is
VariableStepAuto. Double-clicking the
Open Simscape Library block opens the main Simscape
You can use the
ssc_new function arguments to specify the model name and
add domain-specific blocks. See the
ssc_new reference page for
details. For example, typing
creates the following model.
ssc_new, continue developing your model by copying the
blocks, as needed, and adding other blocks from the Simscape libraries.
For electrical models, you can also use the Creating A New Circuit
example as a template for a new model. This example creates a new
electrical model and opens an Electrical Starter Palette, which contains
links to the most often used electrical components. Open the example
the MATLAB Command Window and use File > Save
As to save it under the desired model name. Then delete
the unwanted components and add new ones from the Electrical Starter
Palette and from Simscape libraries.
Using data logging is a best practice for Simscape models because it provides access to important simulation and analysis
tools. Therefore, the
ssc_new function automatically turns on
data logging for the whole model. It uses the default workspace variable name
simlog to store simulation data, and limits the data to the
last 10000 points to avoid slowing down simulation. At the same time, it raises
MaxDataPoints to 10000, so that Simulink data logging history matches Simscape data logging history.
When you create a new model using
ssc_new, the model has the following
data logging configuration:
Log simulation data —
Log simulation statistics — Off.
Record data in Simulation Data Inspector — Off.
Open viewer after simulation — Off.
Workspace variable name —
Limit data points — On.
Data history (last N steps) —
For information on what these settings mean and how to change them, see Data Logging Options.