Quantcast

Documentation Center

  • Trial Software
  • Product Updates

Working with Restricted and Full Modes

Set the Model Loading Preference

By default, when you load an existing model, the license manager checks whether it has been saved in Full or Restricted mode and tries to open it in this mode. However, you can set your preferences so that the models are always open in Restricted mode, regardless of the way they have been saved.

  1. On the MATLAB® Toolstrip, click Preferences. The Preferences dialog box opens.

  2. In the left pane of the Preferences dialog box, select Simscape. The right pane displays the Editing Mode group box. By default, the Load models using option is set to Editing mode specified in models.

  3. Select Restricted mode always from the drop-down list, as shown, and click OK.

Now, when you open a model, the license manager does not attempt to check out add-on product licenses and always opens the model in Restricted mode.

Save a Model in Restricted Mode

Rather that setting your preferences so that all the models always open in Restricted mode, you can switch an individual model to Restricted mode before saving it. Such a model will then, by default, open in Restricted mode.

  1. From the top menu bar in the model window, select Simulation > Model Configuration Parameters. The Configuration Parameters dialog box opens.

  2. In the left pane of the Configuration Parameters dialog box, select Simscape. The right pane displays the Editing Mode option, which is by default set to Full.

  3. Select Restricted from the drop-down list, as shown, and click OK.

  4. Save the model.

    Note   The Simscape entry does not appear in the left pane of the Configuration Parameters dialog box until you add at least one Physical Modeling block to your model. If you create an additional configuration set for a model, the Simscape entry does not appear in it until you either activate it or perform a Physical Modeling operation, such as adding or deleting a Physical Modeling block or connection, opening a Physical Modeling block dialog box, and so on.

Once you have switched a model to Restricted mode, working with it follows the rules described in Work with a Model in Restricted Mode. Note, however, that the add-on product licenses for this model stay checked out until you quit the MATLAB session.

When you open a model that has been saved in Restricted mode, the license manager opens it in Restricted mode and does not check out the add-on product licenses.

Example of Saving a Model in Restricted Mode

In this example, you switch a model to Restricted mode and save it.

  1. Open the Simple Mechanical System example model (ssc_simple_mechanical_systemssc_simple_mechanical_system).

  2. From the top menu bar in the model window, select Simulation > Model Configuration Parameters. The Configuration Parameters dialog box opens.

  3. In the left pane of the Configuration Parameters dialog box, select Simscape. The right pane displays the Editing Mode option, which is set to Full by default.

  4. Select Restricted from the drop-down list and click OK.

  5. Save the model as model_test_edit_mode.

Work with a Model in Restricted Mode

When you open a model in Restricted mode, you can perform a variety of tasks: simulate the model, inspect and fine-tune block parameters, add and delete basic Simulink® blocks, and so on. For a complete list of allowed operations, see What You Can Do in Restricted Mode.

When you open a block dialog box in Restricted mode, some of the block parameters may be grayed out. These are the so-called restricted parameters that can be modified only in Full mode. In general, you can change numerical parameter values in Restricted mode, but you cannot change the block parameterization options. See the block reference pages for specifics. Note also that when a restricted parameter defines the block parameterization schema, nonrestricted parameters available for fine-tuning in Restricted mode depend on the value of this restricted parameter. For example, in a Constant Volume Chamber block, the Chamber specification parameter is restricted. If, at the time the model entered Restricted mode, this parameter was set to By volume, then the nonrestricted parameters available for fine-tuning would be Chamber volume, Specific heat ratio, and Initial pressure. If, however, it was set to By length and diameter, you will have a different set of parameters available in Restricted mode.

You cannot change physical units in Restricted mode. When you open a block dialog box in Restricted mode, the drop-down lists of units next to a parameter name and value are grayed out. When you open a PS-Simulink Converter or Simulink-PS Converter block dialog box, the Unit parameter is grayed out.

The following examples illustrate operations allowed and disallowed in Restricted mode:

How to Simulate and Fine-Tune a Model in Restricted Mode

This example shows how you can work with a model in Restricted mode by changing certain parameter values and observing the simulation results.

  1. Open the model_test_edit_mode model, which you saved in Restricted mode in Example of Saving a Model in Restricted Mode. The model opens in Restricted mode.

  2. Open the Joint C Position scope and simulate the model. The models runs and simulates in Restricted mode.

  3. Double-click the Wheel and Axle block to open its dialog box. Notice that the Mechanism orientation parameter is grayed out, because you cannot modify the block driving direction in Restricted mode.

  4. Change the Wheel radius parameter value to 0.1.

  5. Simulate the model again. Notice that the motion amplitude of node C became smaller as a result of the wheel radius change.

  6. Double-click the Mass block and change the Mass parameter value to 24.

  7. Simulate the model. Notice that doubling the mass resulted in increased vibrations.

How to Add and Delete Simulink Blocks in Restricted Mode

This example shows how you can change the model input signal in Restricted mode by adding and deleting basic Simulink blocks.

  1. Open the model_test_edit_mode model, which you saved in Restricted mode in Example of Saving a Model in Restricted Mode. The model opens in Restricted mode.

  2. Open the Joint C Position scope and simulate the model.

  3. Delete the Signal Builder block named Force Input. Replace it with a Sine Wave block from the Simulink Sources library, as shown below.

  4. Simulate the model again. The model successfully compiles and simulates in Restricted mode.

Performing an Operation Disallowed in Restricted Mode

This example shows what happens when you perform an operation that is disallowed in Restricted mode.

  1. Open the model_test_edit_mode model, which you saved in Restricted mode in Example of Saving a Model in Restricted Mode. The model opens in Restricted mode.

  2. Double-click the MotionSensor2 block to open the subsystem.

  3. Delete the connection line between port P of the Ideal Translational Motion Sensor block and the PS-Simulink Converter block. Instead, connect port V of the Ideal Translational Motion Sensor block to the input port of the PS-Simulink Converter block, to measure the velocity on node C of the lever.

  4. Try to simulate the model. An error message appears saying that the model cannot be compiled because its topology has been changed while in Restricted mode. You can either undo the changes, or switch to Full mode, as described in Switch from Restricted to Full Mode.

Switch from Restricted to Full Mode

If you need to perform a task that is disallowed in Restricted mode, you can try to switch the model to Full mode.

  1. From the top menu bar in the model window, select Simulation > Model Configuration Parameters. The Configuration Parameters dialog box opens.

  2. In the left pane of the Configuration Parameters dialog box, select Simscape. The right pane displays the Editing Mode option.

  3. Select Full from the drop-down list, as shown, and click OK.

    The license manager checks whether all the add-on product licenses for this model are available. If yes, it checks out the add-on product licenses and switches the model to Full mode. If a add-on product license is not available, the license manager issues an error message and the model stays in Restricted mode.

    Note   If the switch to Full mode fails but some of the add-on product licenses have already been checked out, they stay checked out until you quit the MATLAB session. For more information, see Example with Multiple Add-On Products.

Once the model is switched to Full mode, you can perform the needed design and simulation tasks, and then either save it in Full mode, or switch back to Restricted mode and save it in Restricted mode.

Was this topic helpful?