Main Content

addoutputspec

Add output specification to operating point specification

Description

example

newOpspec= addoutputspec(opspec,block,port)adds an output specification for a Simulink®model to an existing operating point specification or array of operating point specifications. The output specification is added for the signal that originates from the specified output portportof blockblock.

To find the width of the specified port, theaddoutputspeccommand recompiles the model.

Examples

collapse all

Open the Simulink model.

sys ='scdspeed'; open_system(sys)

Create a default operating point specification object for the model.

opspec = operspec(sys)
opspec = Operating point specification for the Model scdspeed. (Time-Varying Components Evaluated at time t=0) States: ---------- x Known SteadyState Min Max dxMin dxMax ___________ ___________ ___________ ___________ ___________ ___________ ___________ (1.) scdspeed/Throttle & Manifold/Intake Manifold/p0 = 0.543 bar 0.543 false true -Inf Inf -Inf Inf (2.) scdspeed/Vehicle Dynamics/w = T//J w0 = 209 rad//s 209.48 false true -Inf Inf -Inf Inf Inputs: ---------- u Known Min Max _____ _____ _____ _____ (1.) scdspeed/Throttle perturbation 0 false -Inf Inf Outputs: None ----------

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

Add an output specification to the outport of the rad/s to rpm block.

newspec= addoutputspec(opspec,'scdspeed/rad//s to rpm',1);

Specify a known value of2000rpm for the output specification.

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

View the updated operating point specification.

newspec
newspec= Operating point specification for the Model scdspeed. (Time-Varying Components Evaluated at time t=0) States: ---------- x Known SteadyState Min Max dxMin dxMax ___________ ___________ ___________ ___________ ___________ ___________ ___________ (1.) scdspeed/Throttle & Manifold/Intake Manifold/p0 = 0.543 bar 0.543 false true -Inf Inf -Inf Inf (2.) scdspeed/Vehicle Dynamics/w = T//J w0 = 209 rad//s 209.48 false true -Inf Inf -Inf Inf Inputs: ---------- u Known Min Max _____ _____ _____ _____ (1.) scdspeed/Throttle perturbation 0 false -Inf Inf Outputs: ---------- y Known Min Max _____ _____ _____ _____ (1.) scdspeed/rad//s to rpm 2000 true -Inf Inf

Open the Simulink model.

sys ='scdspeed'; open_system(sys)

Create a 3-by-1 array of default operating point specification objects for the model.

opspec = operspec(sys,[3,1])
opspec = Array of operating point specifications for the model scdspeed. To display an operating point specification, select an element from the array.

Add an output specification to the outport of the rad/s to rpm block.

newspec= addoutputspec(opspec,'scdspeed/rad//s to rpm',1);

这个输出specification is added to all of the operating point specification objects inopspec.

You can specify different output constraints for each specification inopspec. For example, specify different known values for each specification.

newspec(1,1).Outputs(1).Known = 1; newspec(1,1).Outputs(1).y = 1900; newspec(2,1).Outputs(1).Known = 1; newspec(2,1).Outputs(1).y = 2000; newspec(3,1).Outputs(1).Known = 1; newspec(3,1).Outputs(1).y = 2100;

Input Arguments

collapse all

Operating point specification for a Simulink model, specified as one of the following:

  • OperatingSpecobject — Add output specification to a singleOperatingSpecobject.

  • Array ofOperatingSpecobjects — Add the same output specification to allOperatingSpec对象数组中。所有的specification objects must have the sameModelproperty.

To create anOperatingSpecobject for your model, use theoperspecfunction.

Simulink block to which to add the output specification, specified as a character vector or string that contains its block path. Theblockmust be in the Simulink model specified inopspec.Model.

Output port to which to add the output specification, specified as a positive integer in the range [1,N], whereNis the number of output ports on the specifiedblock.

Output Arguments

collapse all

Updated operating point specification, returned as anOperatingSpecobject or an array ofOperatingSpecobjects with the same dimensions asopspec.newOpspecis the same asopspec, except that it contains the new output specification in itsOutputsarray.

You can modify the constraints and specifications for the new output specification using dot notation.

Alternative Functionality

Steady State Manager

You can interactively add output specifications when trimming your model using theSteady State Manager. For more information, seeCompute Operating Points from Specifications Using Steady State Manager.

金宝appModel

You can add output specifications directly in your Simulink model. To do so, right-click the signal to which you want to add the specification, and selectLinear Analysis Points>Trim Output Constraint.

Version History

Introduced before R2006a