Main Content

Simulation and Analysis

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

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

OpenCamera Managerto 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. UseVideo Creatoror thesmwritevideofunction to record an animation in a video format.

Use theKinematicsSolverclass to create a kinematic representation of a model and formulate a kinematic problem to solve.KinematicsSolverobjects 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.

可视化工具

Camera Manager Create, edit, and delete dynamic cameras
Mechanics Explorer Visualize and explore multibody models
Video Creator Configure and create multibody animation videos

Functions

expand all

smwritevideo Configure and create multibody animation videos
smwritevideo Configure and create multibody animation videos

Representing the Assembly

KinematicsSolver Solve kinematics problems for a multibody model

Configuring Options

setVariableUnit Change physical unit of kinematic variable

Listing Variables

frameVariables List kinematic variables associated with frame pairs
initialGuessVariables List all kinematic variables assigned as initial guesses
jointVelocityVariables List all kinematic variables associated with joint velocities
jointPositionVariables List all kinematic variables associated with joint positions
outputVariables List all kinematic variables assigned as outputs
targetVariables List kinematic variables assigned as targets

Adding Variables

addFrameVariables Create kinematic variables from select frame pair inKinematicsSolverobject
addInitialGuessVariables Assign kinematic variables from KinematicsSolver object as guesses
addOutputVariables Assign kinematic variables from the KinematicsSolver object as outputs
addTargetVariables Assign kinematic variables from KinematicsSolver object as targets

Clearing Variables

clearFrameVariables Drop all frame variables from the KinematicsSolver object
clearInitialGuessVariables Drop all guess variables from the KinematicsSolver object
clearOutputVariables Drop all output variables from the KinematicsSolver object
clearTargetVariables Drop all target variables from the KinematicsSolver object

Removing Variables

removeFrameVariables Drop select frame variables from the KinematicsSolver object
removeInitialGuessVariables Drop select guess variables from the KinematicsSolver object
removeOutputVariables Drop select output variables from the KinematicsSolver object
removeTargetVariables Drop select target variables from the KinematicsSolver object

Running the Analysis

generateCode Generate C code to run kinematic analysis on KinematicsSolver object
solve Run kinematic analysis for KinematicsSolver object

Visualize the Solution of Analysis

closeViewer Close the Kinematics Solver Viewer window
viewSolution Open Kinematics Solver Viewer window to visualize KinematicsSolver solution

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 aSimscape™ 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
    使用力学Explorer联邦铁路局me highlights andGraphicblocks 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 thesmwritevideofunction.
  • Visualization Cameras
    动态摄像机和全球之间的区别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