Guy on Simulink

Simulink & Model-Based Design

Simscape and Operating Point Management

Posted by Guy Rouleau,

In MATLAB R2017b, we added capabilities to manage operating points for Simscape models.

In this post, I will show an example of how to use this feature, and describe the possibilities it introduces.

Getting an Example

To highlight this feature, I decided to use an example available on MATLAB Central made by my colleague Steve Miller: Scissor Lift Model in Simscape Multibody.

In case you were not aware, it is now really easy to get MATLAB Central examples. All you have to do is click on the Get Add-ons button in the MATLAB desktop.

Getting Add-Ons

In the Add-Ons Explorer, type what you are looking for, and once you found it, simply click Add To MATLAB.

Getting Add-Ons

Transient Response

As its name implies, this model simulates a scissor lift, where a hydraulic cylinder makes the lift go up and down. Here is an animation made using the Mechanics Explorer.

Scissor Lift Simulation

If you look accurately at the results, you will notice that at the beginning of the simulation, the platform falls slightly before the hydraulic pressure stabilizes to compensate gravity.

Initial transient response

For this model it is not a major issue, but for large models, this type of transient response can take a considerable amount of time because the solver needs to take many small steps to capture it accurately.

Capturing an Operating Point

To avoid losing time with the transient response every time we simulate the model, we will simulate the model for a two seconds once, until the transient is passed, and then create an operating point object using simscape.op.create that will become our starting point for the next simulation.

Programmatically, this looks like:

Creating and using an operating point

Results with operating point

Note that it is also possible to configure Simscape logging and Operating Point from the Simscape section of the model configuration.

What else?

It is important to point out is that the Simscape Operating Point is very flexible. This includes:

  • It is possible to add nodes, remove nodes, and modify nodes programmatically
  • If the model contains blocks without corresponding nodes, the block dialog specification will be used
  • If the operating point contains nodes without corresponding blocks in the model, those are ignored

Let's take for example this simple thermal liquid model.

Pipeline simulation

We can create an operating point from the logged data:

Pipeline operating point

Now, let's say we decide to add one more pipe:

Pipeline simulation

If you try simulating this model with the previously created operating point, it will simulate fine, however, the second pipe will start with the pressure and temperature specified in the block dialog. Instead, we could make a copy of the pipe node already existing in the operating point and add it to the operating point as a new node.

Pipeline operating point

And now the second pipe operating point will also be controlled from the operating point object.

What's Next?

Are you already using the Simscape Operating point feature? If not, get started with those documentation pages:

Let us know what you think of this feature in the comments below.