Documentation

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 using the Linear Analysis Tool. See Compute 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 output portwidth.

Examples

collapse all

Open the Simulink model.

sys = 'magball';
open_system(sys)

Create a default operating point specification object for the model.

opspec = operspec(sys)
 Operating point 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 
----------

The default operating point specification object has no output output specifications because there are no root-level outports in the model.

Add an output specification to the outport of the Controller block.

newspec = addoutputspec(opspec,'magball/Controller',1);

Specify a known value of 14 for the output specification.

newspec.Outputs(1).Known = 1;
newspec.Outputs(1).y = 14;

View the updated operating point specification.

newspec
 Operating point 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 = 14           

Introduced before R2006a

Was this topic helpful?