smnew

Open new model with common SimMechanics blocks

Syntax

smnew
smnew(modelname)
smnew(modelname,solver)

Description

smnew creates a new SimMechanics™ 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 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 SimMechanics 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 SimMechanics 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 SimMechanics 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

expand all

New SimMechanics Model with Defaults

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

smnew

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

Named New SimMechanics Model with custom Solver

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

sm_new('simple_body','ode23t')

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

See Also

|

Was this topic helpful?