Previous Next no_f.m

ckbs_nonlinear: Example of No Constraint

Syntax
[fk    = no_f(kxk)
[fkFk] = no_f(kxk)

Purpose
Implements a constraint that is always satisfies by defining the function  \[
      f_k ( x_k ) \equiv -1
\] 
so that the condition  f_k ( x_k ) \leq 0 is satisfied for all  x_k .

k
is an integer scalar specifying the time index (not used).

xk
The column vector xk specifies the current state vector (only used to determine the size of the state vector at each time point).

fk
The return value fk is a scalar equal to minus one.

Fk
The return value Fk is a row vector equal to the Jacobian of fk w.r.t xk ; i.e. zero.

Source Code
 
function [fk, Fk] = no_f(k, xk)
    % no constraint case: f(x) = -1 for all x
    n  = size(xk, 1);
    fk = -1;
    Fk = zeros(1, n);
    return
end

Input File: example/nonlinear/no_f.m