Quantcast

Documentation Center

  • Trial Software
  • Product Updates

Contents

addoutputspec

Add output specification to operating point specification

Syntax

opnew=addoutputspec(op,'block',portnumber)

Alternatives

As an alternative to the addoutputspec function, add output specifications with the Simulink® Control Design™ GUI. See Steady-State Operating Point to Meet Output Specification.

Description

opnew=addoutputspec(op,'block',portnumber) adds an output specification for a Simulink model to an existing operating point specification, op, created with operspec. The signal being constrained by the output specification is indicated by the name of the block, 'block', and the port number, portnumber, that it originates from.

You can edit the output specification within the new operating point specification object, opnew, to include the actual constraints or specifications for the signal. Use the new operating point specification object with the function findop to find operating points for the model.

This function automatically compiles the Simulink model, given in the property Model of op, to find the block's output portwidth.

Examples

Create an operating point specification for the model magball.

op=operspec('magball')

This specification returns the object op. Note that there are no outports in this model and no outputs in the object op.

 Operating Specification for the Model magball.
 (Time-Varying Components Evaluated at time t=0)

States: 
----------
(1.) magball/Controller/PID Controller/Filter
      spec:  dx = 0,  initial guess:             0
(2.) magball/Controller/PID Controller/Integrator
      spec:  dx = 0,  initial guess:            14
(3.) magball/Magnetic Ball Plant/Current
      spec:  dx = 0,  initial guess:             7
(4.) magball/Magnetic Ball Plant/dhdt
      spec:  dx = 0,  initial guess:             0
(5.) magball/Magnetic Ball Plant/height
      spec:  dx = 0,  initial guess:          0.05
 
Inputs: None 
----------
 
Outputs: None 
----------

To add an output specification to the signal between the Controller block and the Magnetic Ball Plant block, use the function addoutputspec.

newop=addoutputspec(op,'magball/Controller',1)

This function adds the output specification is added to the operating point specification object.

  Operating Specification for the Model magball.
 (Time-Varying Components Evaluated at time t=0)

States: 
----------
(1.) magball/Controller/PID Controller/Filter
      spec:  dx = 0,  initial guess:             0
(2.) magball/Controller/PID Controller/Integrator
      spec:  dx = 0,  initial guess:            14
(3.) magball/Magnetic Ball Plant/Current
      spec:  dx = 0,  initial guess:             7
(4.) magball/Magnetic Ball Plant/dhdt
      spec:  dx = 0,  initial guess:             0
(5.) magball/Magnetic Ball Plant/height
      spec:  dx = 0,  initial guess:          0.05
 
Inputs: None 
----------
 
Outputs: 
----------
(1.) magball/Controller
      spec:  none

Edit the output specification to constrain this signal to be 14.

newop.Outputs(1).Known=1, newop.Outputs(1).y=14

The final output specification is displayed.

 Operating Specification for the Model magball.
 (Time-Varying Components Evaluated at time t=0)

States: 
----------
(1.) magball/Controller/PID Controller/Filter
      spec:  dx = 0,  initial guess:             0
(2.) magball/Controller/PID Controller/Integrator
      spec:  dx = 0,  initial guess:            14
(3.) magball/Magnetic Ball Plant/Current
      spec:  dx = 0,  initial guess:             7
(4.) magball/Magnetic Ball Plant/dhdt
      spec:  dx = 0,  initial guess:             0
(5.) magball/Magnetic Ball Plant/height
      spec:  dx = 0,  initial guess:          0.05
 
Inputs: None 
----------
 
Outputs: 
----------
(1.) magball/Controller
      spec:  y = 0             

See Also

| |

Was this topic helpful?