It is possible to connect systems using the
YopConnection command. The purpose of this is to simplify creating an initial guess for non-convex optimal control problems. By connecting your system to a controller, it is possible to create an initial guess by simulation, even for an unstable system. Despite being the main purpose, connecting the system to a controller is not the only use for connections.
Connections are declared using the following syntax:
c = YopConnection(arg1, arg2);
The input arguments
arg2 can be any symbolic expression that can be formulated using the system variables
y (see YopSystem for a description of them).
arg2 can be vector valued as long as they have the same dimension. The output argument
c is a handle to the connection.
YopConnection is an algebraic constraint stating
This means that the following declarations are equivalent:
c1 = YopConnection(arg1, arg2); c2 = YopConnection(arg1-arg2, zeros(size(arg1-arg2))); c3 = YopConnection(zeros(size(arg1-arg2)), arg1-arg2);