Main Content

findop

Compute operating condition from specifications

Since R2023b

    Description

    example

    op = findop(sys,Name=Value) computes the operating condition op for the state-space model sys. Use the name-value arguments to specify known target values for the state x, input u, output y, and state derivative dx. Set unknown or free entries of x, u, y, and dx to NaN.

    For mechss models, use q, dq, and d2q instead of x and dx to constrain degrees of freedom (DOFs) and their first and second derivatives.

    op = findop(sys,t,Name=Value) computes the operating conditions for ltvss models at time t.

    example

    op = findop(sys,t,p,Name=Value) computes the operating conditions for lpvss models at time t and parameter values p.

    Examples

    collapse all

    This example shows how to compute operating condition at various specifications for a state-space model.

    Create a state-space model using these multi-input multi-output state matrices.

    A=[-700-10]B=[5002]C=[1-4-40.5]D=[0-220]

    Specify the state-space matrices and create the MIMO state-space model.

    A = [-7,0;0,-10];
    B = [5,0;0,2];
    C = [1,-4;-4,0.5];
    D = [0,-2;2,0];
    sys = ss(A,B,C,D);

    Compute steady-state condition with fixed output y = [–1;1].

     op1 = findop(sys,y=[-1;1])
    op1 = 
      OperatingPoint with properties:
    
                x: [2x1 double]
                u: [2x1 double]
                w: [0x1 double]
               dx: [2x1 double]
                y: [2x1 double]
               rx: [2x1 double]
               ry: [2x1 double]
        Equations: 4
         Unknowns: 4
           Status: 'Well-posed problem. Successfully computed the unique solution.'
    
    

    Compute steady-state condition for constant input u = [1;2].

     op2 = findop(sys,u=[1;2])
    op2 = 
      OperatingPoint with properties:
    
                x: [2x1 double]
                u: [2x1 double]
                w: [0x1 double]
               dx: [2x1 double]
                y: [2x1 double]
               rx: [2x1 double]
               ry: [2x1 double]
        Equations: 4
         Unknowns: 4
           Status: 'Well-posed problem. Successfully computed the unique solution.'
    
    

    Compute steady-state condition with x(1) = 0 and x(2) unspecified.

    op3 = findop(sys,x=[0;NaN])
    op3 = 
      OperatingPoint with properties:
    
                x: [2x1 double]
                u: [2x1 double]
                w: [0x1 double]
               dx: [2x1 double]
                y: [2x1 double]
               rx: [2x1 double]
               ry: [2x1 double]
        Equations: 4
         Unknowns: 5
           Status: 'Underdetermined problem. Returned solution with minimum norm.'
    
    

    Compute unsteady initial condition with dx = [1;0] and y = [-1;1].

    op4 = findop(sys,y=[-1;1],dx=[1;0])
    op4 = 
      OperatingPoint with properties:
    
                x: [2x1 double]
                u: [2x1 double]
                w: [0x1 double]
               dx: [2x1 double]
                y: [2x1 double]
               rx: [2x1 double]
               ry: [2x1 double]
        Equations: 4
         Unknowns: 4
           Status: 'Well-posed problem. Successfully computed the unique solution.'
    
    

    Use dot notation to access the values in these structures. For example, op4.u gives the input values for which the system achieved the unsteady initial condition in the previous specification.

    op4.u
    ans = 2×1
    
       -0.4785
        0.1840
    
    

    For this example, consider the sparse matrices for the 3-D beam model subjected to an impulsive point load at its tip.

    Extract the sparse matrices from sparseBeam.mat.

    load('sparseBeam.mat','M','K','B','F','G','D');

    Create the mechss model object by specifying [] for matrix C, since there is no damping.

    sys = mechss(M,[],K,B,F,G,D)
    Sparse continuous-time second-order model with 3 outputs, 1 inputs, and 3408 degrees of freedom.
    
    Use "spy" and "showStateInfo" to inspect model structure. 
    Type "help mechssOptions" for available solver options for this model.
    

    Compute the operating point at the fixed input u = 2.

    op = findop(sys,u=2)
    op = 
      OperatingPoint2 with properties:
    
                q: [3408x1 double]
                u: 2
                w: [0x1 double]
               dq: [3408x1 double]
              d2q: [3408x1 double]
                y: [3x1 double]
               rq: [3408x1 double]
               ry: [3x1 double]
        Equations: 3411
         Unknowns: 3411
           Status: 'Well-posed problem. Successfully computed the unique solution.'
    
    

    The function returns a steady-state condition at this input value. For this problem, the solution is unique.

    The problem becomes overconstrained if you specify additional specifications.

    q = NaN(3408,1);
    q(1:100) = randn(100,1);
    op1 = findop(sys,q=q,u=2,y=[NaN,1,NaN])
    op1 = 
      OperatingPoint2 with properties:
    
                q: [3408x1 double]
                u: 2
                w: [0x1 double]
               dq: [3408x1 double]
              d2q: [3408x1 double]
                y: [3x1 double]
               rq: [3408x1 double]
               ry: [3x1 double]
        Equations: 3411
         Unknowns: 3310
           Status: 'Overconstrained problem, residuals may exist. Returned least-squares solution.'
    
    

    In this case, the function returns the least-squares solution.

    Create a discrete-time linear-parameter varying model.

    The matrices and offsets are given by:

    A=sin(0.1p), B=1, C=1, D=0

    y0=0.1sin(k).

    These matrices and offsets are defined in the lpvFcnDiscrete.m data function provided with this example.

    Specify the properties and create the LPV model.

    Ts = 0.01;
    ParamNames = 'p';
    DataFcn = @lpvFcnDiscrete;
    lpvSys = lpvss(ParamNames,DataFcn,Ts)
    Discrete-time state-space LPV model with 1 outputs, 1 inputs, 1 states, and 1 parameters.
    

    View the data function.

    type lpvFcnDiscrete.m
    function [A,B,C,D,E,dx0,x0,u0,y0,Delays] = lpvFcnDiscrete(k,p)
    A = sin(0.1*p);
    B = 1;
    C = 1;
    D = 0;
    E = [];
    dx0 = [];
    x0 = [];
    u0 = [];
    y0 = 0.1*sin(k);
    Delays = [];
    

    Compute the operating condition for the LPV model at t = 0.05 and p = 10. For discrete-time models, specify time as the integer sample index.

    op = findop(lpvSys,5,10,x=0.5)
    op = 
      OperatingPoint with properties:
    
                x: 0.5000
                u: 0.0793
                w: [0x1 double]
               dx: 0.5000
                y: 0.4041
               rx: 0
               ry: 0
        Equations: 2
         Unknowns: 2
           Status: 'Well-posed problem. Successfully computed the unique solution.'
    
    

    Input Arguments

    collapse all

    Dynamic system, specified as a SISO or MIMO state-space model. Dynamic systems that you can use include:

    • Continuous-time or discrete-time numeric state-space models, such as ss models.

    • Generalized or uncertain LTI models such as genss or uss models. (Using uncertain models requires Robust Control Toolbox™ software.)

    • Sparse state-space models such as sparss and mechss models.

    • Identified LTI models, such as idss, or idgrey models. (Using identified models requires System Identification Toolbox™ software.)

    • Linear time-varying (ltvss) and linear parameter-varying (lpvss) models.

    findop does not support non state-space models such as tf, zpk, pid, and frd models.

    Time value for evaluating operating point condition for linear time-varying and linear-parameter varying models, specified as a scalar.

    For discrete-time systems, t is the integer sample index k.

    Parameter values for evaluating operating point condition for linear parameter-varying models, specified as a vector of length equal to the number of parameters in the model.

    Name-Value Arguments

    Specify optional pairs of arguments as Name1=Value1,...,NameN=ValueN, where Name is the argument name and Value is the corresponding value. Name-value arguments must appear after other arguments, but the order of the pairs does not matter.

    Example: op = findop(sys, y=[1;NaN], u=[NaN;0]) computes a steady-state operating condition with u(2)=0 and y(1)=1.

    First-Order Models Only

    collapse all

    State derivative values for computing the operating point, specified as a vector of length equal to the number of states in sys.

    In discrete time, dx specifies the state incremental change x[k+1]x[k].

    The algorithm uses the specified numeric values as fixed values. To set entries as unspecified or free, use NaN.

    State values for computing the operating point, specified as a vector of length equal to the number of states in sys.

    The algorithm uses the specified numeric values as fixed values. To set entries as unspecified or free, use NaN.

    mechss Models Only

    collapse all

    Displacement values for computing the operating point, specified as a vector of length equal to the number of degrees of freedom in the mechss model sys.

    The algorithm uses the specified numeric values as fixed values. To set entries as unspecified or free, use NaN.

    Displacement first derivative values for computing the operating point, specified as a vector of length equal to the number of degrees of freedom in the mechss model sys.

    In discrete time, dq specifies the incremental change q[k+1]q[k].

    The algorithm uses the specified numeric values as fixed values. To set entries as unspecified or free, use NaN.

    Displacement second derivative values for computing the operating point, specified as a vector of length equal to the number of degrees of freedom in the mechss model sys.

    In discrete time, d2q specifies the incremental change q[k+2] + q[k]2q[k+1].

    The algorithm uses the specified numeric values as fixed values. To set entries as unspecified or free, use NaN.

    All Models

    collapse all

    Input values for computing the operating point, specified as a vector of length equal to the number of inputs in sys.

    The algorithm uses the specified numeric values as fixed values. To set entries as unspecified or free, use NaN.

    Output values for computing the operating point, specified as a vector of length equal to the number of outputs in sys.

    The algorithm uses the specified numeric values as fixed values. To set entries as unspecified or free, use NaN.

    Internal signal specification, specified as a vector of length equal to the number of internal delays in the model. Use this input only when the model has internal delays.

    The algorithm uses the specified numeric values as fixed values. To set entries as unspecified or free, use NaN.

    Output Arguments

    collapse all

    Computed operating condition, returned as an OperatingPoint object or an OperatingPoint2 objects.

    • The function returns an OperatingPoint object for all models except mechss. The object has following properties:

      PropertyDescription
      xComputed value for state vector, returned as a column vector of length equal to the number of states.
      uComputed value for input vector, returned as a column vector of length equal to the number of inputs.
      wComputed value for internal delay signals (if any), returned as a column vector of length equal to the number of internal delays in the model.
      dx

      Computed value for state derivative vector, returned as a column vector of length equal to the number of states.

      In discrete-time, this value is equal to x[k+1]. (since R2024a)

      yComputed value for output vector, returned as a column vector of length equal to the number of outputs.
      rxResiduals for state equations, returned as a column vector of length equal to the number of states.
      ryResiduals for output equations, returned as a column vector of length equal to the number of outputs.
      EquationsNumber of equations to solve to compute operating conditions.
      UnknownsNumber of unknowns in the equations.
      StatusStatus report.
    • The function returns an OperatingPoint2 object for mechss models. The object has following properties:

      PropertyDescription
      qComputed value for displacement vector, returned as a column vector of length equal to the number of degrees of freedom.
      uComputed value for input vector, returned as a column vector of length equal to the number of inputs.
      wComputed value for internal delay signals (if any), returned as a column vector of length equal to the number of internal delays in the model.
      dq

      Computed value for first derivative of displacement vector, returned as a column vector of length equal to the number of degrees of freedom.

      In discrete-time, this value is equal to q[k+1]. (since R2024a)

      d2q

      Computed value for second derivative of displacement vector, returned as a column vector of length equal to the number of degrees of freedom.

      In discrete-time, this value is equal to q[k+2]. (since R2024a)

      yComputed value for output vector, returned as a column vector of length equal to the number of outputs.
      rqResiduals for displacement equations, returned as a column vector of length equal to the number of degrees of freedom.
      ryResiduals for output equations, returned as a column vector of length equal to the number of outputs.
      EquationsNumber of equations to solve to compute operating conditions.
      UnknownsNumber of unknowns in the equations.
      StatusStatus report.

    Additionally,

    • For overconstrained problems, findop returns the least-squares solution.

    • For underdetermined problems, findop returns the solution with smallest norm.

    Version History

    Introduced in R2023b

    expand all

    See Also

    | | | |