## Level 1 of the system Beaver

The first level of the Beaver model contains the Inport and Outport blocks to and from the non-linear aircraft model, To Workspace blocks to store the input and outputvectors and a time-vector in the Matlab workspace, Mux blocks to combine the scalar signals from the different Inport blocks into vector signals, and Demux blocks to extract scalar output signals from the different output vectors.

The actual model of the 'Beaver' dynamics is contained in the subsystem Beaver dynamics and output equations (shortly denoted as Level 2), whereas the first level (in short: Level 1) was created for input/output handling only.

Please notice that the current model architecture is still influenced visibly by limitations of earlier Simulink versions, which is e.g. reflected by the use of scalar Inports and Outports in Level 1 of the system. In future versions of the toolbox, it is planned to either eliminate this I/O level altogether, or at least simplify this level as far as possible.

### Connection I/O versus Workspace I/O

It is important to notice that the number of outputs which are send to the Matlab workspace by means of To Workspace blocks is considerably larger than the number of Outport blocks in Level 1. The latter make it possible to connect the aircraft model to other systems, such as automatic flight controllers or sensor models, and to access the system Beaver directly from the Matlab workspace, while the results which are sent to the workspace are meant primarily for post-simulation analysis.

For practical reasons, it was decided to connect only the sixteen outputs which were needed to simulate the 'Beaver' autopilot models to Outport blocks; all other outputs are sent to the workspace only. If that list of 'connection outputs' is not sufficient for certain applications, it will be necessary to add more Outport blocks to the first level of the aircraft model. Similarly, if different inputs are required, more Inport blocks may have to be added. For instance: if you want to examine new control laws that use accelerations as reference signals, these signals must be connected to new Outport blocks in the first level of the Beaver model; currently the acceleration outputs are sent to the Matlab workspace only.

However, please be aware that changes in the I/O definitions of Level 1 may affect other systems that make use of the aircraft model, as well as Matlab programs that access this model. For this reason, if I/O changes are really necessary, it is probably a better idea to create an independent copy of the aircraft model first (copy from the model library, then break the library links!) and modify this copy, rather than the original.

### 'Connection inputs'

       deltae, deltaa, deltar, deltaf, n, pz, uw, vw, ww,
       uwdot, vwdot, and wwdot

If you want to access the system Beaver directly from the Matlab command-line, a vector of length twelve must be used as inputvector:

       u = [deltae, deltaa, deltar, deltaf, n, pz, uw, vw, ww,
            uwdot, vwdot, wwdot]'

During simulations, the time-trajectories of these twelve 'connection inputs' will be sent to the matrix In in the Matlab workspace.

### 'Connection outputs'

       V, alpha, beta, p, q, r, psi, theta, phi, xe, ye, H,
       Hdot, pb/2V, qc/V, rb/2V

The first thirteen outputs (i.e. the twelve state variables and the climb velocity Hdot) are needed by the control laws of the 'Beaver' autopilot; the last three outputs (dimensionless rotational velocities) are needed by the linear state-space model of the dynamics of the steering column/steering wheel, cables, control surfaces, and hydraulic actuators, used in the 'Beaver' autopilot. These sixteen 'connection outputs' form a subset of the 89 outputs which are sent to the matrix Out in the Matlab workspace during simulations.

See the lists of input and output variables for the exact definitions of these signals.

### 'Workspace inputs' and 'workspace outputs'

There are three To Workspace blocks in Level 1. The first one is used to send the inputs to the system Beaver to the matrix In in the Matlab workspace, including the wind and turbulence velocity components and their time-derivatives. The second To Workspace block sends all outputs to the matrix Out in the Matlab workspace. In order to be able to plot the results against time, a third To Workspace block is connected to a Clock block, which yields a time-axis in the vector time.

Simulation results can thus be plotted by typing:

        plot(time,Out(:,1))

        plot(time,In(:,6))

and so on. The exact definitions of the matrices In and Out can be found by double-clicking the corresponding Mux blocks in the first level of Beaver, or by viewing the complete lists of inputs and outputs (or by consulting the FDC user-manual).

### The macro RESULTS

Instead of directly using the matrices In and Out for plotting and analyzing simulation results, it is also possible to run the Matlab program RESULTS first. This program will extract the trajectories of individual inputs from the vector In and the trajectories of individual outputs from the vector Out. The plot commands given above can then be replaced by:

        plot(time,V)

        plot(time,pz)

Note: RESULTS can be used only for the default definitions of the matrices In and Out, as used in the current implementations of the Beaver model. If you change these definitions, it will be necessary to adapt the source-file RESULTS.M also.

### More information

See the lists of inputs, outputs, and color definitions for more details about the Beaver model and the other FDC block-diagrams. See the description of Level 2 for more information about the actual structure of the aircraft model.