initopspec - Initialize operating point specification values

Syntax

opnew=initopspec(opspec,oppoint)
opnew=initopspec(opspec,x,u)
opnew=initopspec(opspec,xstruct,u)

Graphical Interface

As an alternative to the initopspec function, initialize operating point specification values in the Create Operating Points pane in the Operating Points node within the Simulink® Control Design™ GUI. See Creating Operating Points from Specifications in the Simulink Control Design getting started documentation.

Description

opnew=initopspec(opspec,oppoint) initializes the operating point specification object, opspec, with the values contained in the operating point object, oppoint. The function returns a new operating point specification object, opnew. Create opspec with the function operspec. Create oppoint with the function operpoint or findop.

opnew=initopspec(opspec,x,u) initializes the operating point specification object, opspec, with the values contained in the state vector, x, and the input vector, u. The function returns a new operating point specification object, opnew. Create opspec with the function operspec. You can use the function getxu to create x and u with the correct ordering.

opnew=initopspec(opspec,xstruct,u) initializes the operating point specification object, opspec, with the values contained in the state structure, xstruct, and the input vector, u. The function returns a new operating point specification object, opnew. Create opspec with the function operspec. You can use the function getstatestruct or getxu to create xstruct and the function getxu to create u with the correct ordering. Alternatively, you can save xstruct to the MATLAB® workspace after a simulation of the model. See the Simulink® documentation for more information on these structures.

Example

Create on operating point using findop by simulating the magball model and extracting the operating point after 20 time units.

oppoint=findop('magball',20)

This syntax returns the following operating point:

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

States: 
----------
(1.) magball/Controller/Controller
      x: 5.28e-009    
      x: -2.56e-006   
(2.) magball/Magnetic Ball Plant/Current
      x: 6.99         
(3.) magball/Magnetic Ball Plant/dhdt
      x: -2.62e-005   
(4.) magball/Magnetic Ball Plant/height
      x: 0.05    
 
Inputs: None

Use these operating point values as initial values in an operating point specification object.

opspec=operspec('magball');
newopspec=initopspec(opspec,oppoint)

The new operating point specification object is displayed.

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

States: 
----------
(1.) magball/Controller/Controller
      spec:  dx = 0,  initial guess:     5.28e-009
      spec:  dx = 0,  initial guess:    -2.56e-006
(1.) magball/Magnetic Ball Plant/Current
      spec:  dx = 0,  initial guess:          6.99
(1.) magball/Magnetic Ball Plant/dhdt
      spec:  dx = 0,  initial guess:    -2.62e-005
(1.) magball/Magnetic Ball Plant/height
      spec:  dx = 0,  initial guess:          0.05
 
Inputs: None
 
Outputs: None

You can now use this object to find operating points by optimization.

See Also

findop, getstatestruct, getxu, operpoint, operspec

  


 © 1984-2008- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS