Main Content

Simscape Block Libraries

Library Structure Overview

Simscape block library contains two libraries that belong to the Simscape™ product:

  • Foundation library — Contains basic physical elements and building blocks, as well as sources and sensors, organized into sublibraries according to technical discipline and function performed.

  • Utilities library — Contains essential environment blocks for creating Physical Networks models.

In addition, if you have installed any of the add-on products, you will see the corresponding libraries under the main Simscape library. Add-on products are products in the Physical Modeling family that use Simscape platform and, as a result, share common functionality, such as physical units management or editing modes.

Simscape Foundation libraries contain a comprehensive set of basic elements and building blocks organized by physical domain: electrical, mechanical rotational and translational, isothermal liquid, gas, and so on. Within each domain, the blocks are grouped into elements, sources, and sensors. In each of the fluid domains, the Utilities sublibrary contains blocks that specify fluid properties. For more information, see Fluid System Modeling. The Physical Signals block library lets you perform math operations on physical signals.

Using the basic building blocks in the Foundation libraries, you can create more complex components that span different physical domains. You can then group this assembly of blocks into a subsystem and parameterize it to reuse and share these components.

In addition to Foundation libraries, there is also a Simscape Utilities library, which contains utility blocks, such as:

  • Solver Configuration block, which contains parameters relevant to numerical algorithms for Simscape simulations. Each Simscape diagram (or each topologically distinct physical network in a diagram) must contain a Solver Configuration block.

  • Simulink-PS Converter block and PS-Simulink Converter block, to connect Simscape and Simulink® blocks. Use the Simulink-PS Converter block to connect Simulink outports to Physical Signal inports. Use the PS-Simulink Converter block to connect Physical Signal outports to Simulink inports.

  • Probe block, which lets you select variables from another Simscape block in the model and output them as Simulink signals.

For examples of using these blocks in a Simscape model, see the tutorial Creating and Simulating a Simple Model and the Circuit Breaker with Probe Block example.

You can combine all these blocks in your Simscape diagrams to model physical systems. You can also use the basic Simulink blocks in your diagrams, such as sources or scopes. See Connecting Simscape Diagrams to Simulink Sources and Scopes for more information on how to do this.

Simscape block libraries contain a comprehensive selection of blocks that represent engineering components such as valves, resistors, springs, and so on. These prebuilt blocks, however, may not be sufficient to address your particular engineering needs. When you need to extend the existing block libraries, use the Simscape language to define customized components, or even new physical domains, as textual files. Then convert your textual components into libraries of additional Simscape blocks that you can use in your model diagrams. For more information on how to do this, see Typical Simscape Language Tasks.

Accessing the Block Libraries

You can access the blocks through the Simulink Library Browser. To display the Library Browser, type slLibraryBrowser in the MATLAB® Command Window. Then expand the Simscape entry in the contents tree.

When you type simscape in the MATLAB Command Window, the main Simscape library opens in a separate window.

The Simscape library consists of two top-level libraries, Foundation and Utilities. In addition, if you have installed any of the add-on products of the Physical Modeling family, you can see the corresponding libraries under Simscape library, as shown in the following illustration. Some of these libraries contain second-level and third-level sublibraries. You can expand each library by double-clicking its icon.