Documentation

smnew

Open new model with common Simscape Multibody blocks

Syntax

smnew
smnew(modelname)
smnew(modelname,solver)

Description

smnew creates a new Simscape™ Multibody™ model, with required and commonly used blocks already on the model canvas, and opens the sim_lib library. The default model name is untitled and the default solver is ode45 (the recommended solver). The new model has Simscape data logging enabled by default, with logging limited to the last 10,000 time steps.

The new model contains the following blocks:

  • World Frame

  • Solid

  • Rigid Transform

  • Solver Configuration

  • Mechanism Configuration

  • PS-Simulink Converter

  • Simulink-PS Converter

  • Scope

smnew(modelname) creates a new Simscape Multibody model with the specified name. If you specify an invalid model name, the model name is untitled. The default solver is ode45, which is the recommended solver.

smnew(modelname,solver) creates a new Simscape Multibody model with the specified name and Simulink® solver type. If you do not specify a model name, then the model name is untitled.

Input Arguments

modelname

String specifying the name for the new model. Do not include a file extension.

Default: untitled

solver

String specifying the name of a Simulink solver. If you choose not to use the default ode45 solver, other recommended solver types for Simscape Multibody models are ode15s, ode23t, and ode14x. You can use other Simulink solvers, but, depending on the particular model, they may be less suitable. For more information, see Improving Performance and Setting Up Solvers for Physical Models.

Default: ode45.

Examples

collapse all

New Simscape Multibody Model with Defaults

Create a new Simscape Multibody model, using the default model name (untitled) and the default solver (ode45).

smnew

The command opens the sm_lib library, as well as a Simscape Multibody model called untitled, with several commonly used blocks.

Named New Simscape Multibody Model with custom Solver

Create a new Simscape Multibody model, named simple_body. Use the ode23t solver.

sm_new('simple_body','ode23t')

The command opens the sm_lib library, as well as a Simscape Multibody model called simple_body, with several commonly used blocks. The model uses the ode23t solver.

See Also

|

Was this topic helpful?