Main Content

Simulation and Analysis

Run a simulation, visualize a model, and run a kinematic analysis

Update the block diagram to assemble the multibody model and visualize its initial configuration. The visualization opens in Mechanics Explorer. Simulate the model to play an interactive animation. Be sure to pick a solver suited for physical models, such as daessc, and to specify a maximum time step small enough to capture the fastest meaningful change expected during simulation.

Open Camera Manager to add a moving, dynamic camera with which to capture the animation. Dynamic cameras can be of two types: keyframed or tracking. Keyframed cameras move between view points created interactively in Mechanics Explorer. Tracking cameras attach to and aim at frames in the model. Use Video Creator or the smwritevideo function to record an animation in a video format.

Use the KinematicsSolver class to create a kinematic representation of a model and formulate a kinematic problem to solve. KinematicsSolver objects contain all the joint variables available in a model. Complement them with frame variables and assign both joint and frame variables as targets, guesses, and outputs for analysis.

Apps

Camera ManagerCreate, edit, and delete dynamic cameras
Mechanics ExplorerVisualize and explore multibody models
Video CreatorConfigure and create multibody animation videos

Functions

expand all

simscape.multibody.tirreadRead TIR file (Since R2021b)
smwritevideoConfigure and create multibody animation videos
smwritevideoConfigure and create multibody animation videos

Representing the Assembly

KinematicsSolverSolve kinematics problems for a multibody model (Since R2019a)

Configuring Options

setVariableUnitChange physical unit of kinematic variable (Since R2019a)

Listing Variables

frameVariablesList kinematic variables associated with frame pairs (Since R2019a)
initialGuessVariablesList all kinematic variables assigned as initial guesses (Since R2019a)
jointVelocityVariablesList all kinematic variables associated with joint velocities (Since R2020a)
jointPositionVariablesList all kinematic variables associated with joint positions (Since R2019a)
outputVariablesList all kinematic variables assigned as outputs (Since R2019a)
targetVariablesList kinematic variables assigned as targets (Since R2019a)

Adding Variables

addFrameVariablesCreate kinematic variables from select frame pair in KinematicsSolver object (Since R2019a)
addInitialGuessVariablesAssign kinematic variables from KinematicsSolver object as guesses (Since R2019a)
addOutputVariablesAssign kinematic variables from the KinematicsSolver object as outputs (Since R2019a)
addTargetVariablesAssign kinematic variables from KinematicsSolver object as targets (Since R2019a)

Clearing Variables

clearFrameVariablesDrop all frame variables from the KinematicsSolver object (Since R2019a)
clearInitialGuessVariablesDrop all guess variables from the KinematicsSolver object (Since R2019a)
clearOutputVariablesDrop all output variables from the KinematicsSolver object (Since R2019a)
clearTargetVariablesDrop all target variables from the KinematicsSolver object (Since R2019a)

Removing Variables

removeFrameVariablesDrop select frame variables from the KinematicsSolver object (Since R2019a)
removeInitialGuessVariablesDrop select guess variables from the KinematicsSolver object (Since R2019a)
removeOutputVariablesDrop select output variables from the KinematicsSolver object (Since R2019a)
removeTargetVariablesDrop select target variables from the KinematicsSolver object (Since R2019a)

Running the Analysis

generateCodeGenerate C code to run kinematic analysis on KinematicsSolver object (Since R2019a)
solveRun kinematic analysis for KinematicsSolver object (Since R2019a)

Visualize the Solution of Analysis

closeViewerClose the Kinematics Solver Viewer window (Since R2020a)
viewSolutionOpen Kinematics Solver Viewer window to visualize KinematicsSolver solution (Since R2020a)

Topics

Basic Visualization

  • Enable Mechanics Explorer
    Set the model configuration parameters to ensure that Mechanics Explorer opens automatically on model update or simulation.
  • Manipulate the Visualization Viewpoint
    Select a standard view, set the up-axis convention, and use mouse shortcuts to rotate, roll, pan, or zoom a model.
  • Update and Simulate a Model
    Workflow steps for updating and simulating a Simscape™ Multibody™ model.
  • Visualize a Model and Its Components
    Visualization is not only a central part of a multibody simulation, but also an essential tool in modeling bodies and verifying their shapes, sizes, frame placements, and colors. Here is an overview of the visualization utilities available in the Simscape Multibody environment and the roles they play in your modeling workflow.
  • Visualize Simscape Multibody Frames
    Use Mechanics Explorer frame highlights and Graphic blocks to visualize frames.

Advanced Visualization

Cameras and Video Creation

  • Create a Dynamic Camera
    Use Camera Manager to create or edit a model visualization camera with a moving viewpoint.
  • Create a Model Animation Video
    Save an animation in video format using Video Creator or the smwritevideo function.
  • Visualization Cameras
    Distinction between dynamic cameras and the global camera. Camera Manager as a tool for creating dynamic cameras. Dynamic camera keyframe and tracking modes.
  • Working with Animation
    Review how model animations work and explore the basic controls available for animations.

Troubleshooting