• No results found

This appendix furnishes what is eectvely a user's manual for the simulation code devel-oped in conjunction with this research project. The codes are written in MATLAB [60].

The simulation code for the 2-D potential channel ow extensively employs the freely avail-able MATLAB package for manipulation of Schwarz-Christoel mappings, the SC Toolbox, written by Trefethen and Driscoll. The package is documented extensively in the book by Trefethen and Driscoll, [24], and also in the online documentation for the toolbox [23].

The toolbox is available on Driscoll's website at http://www.math.udel.edu/~driscoll/SC/

(accessed at the time of writing).

The rst section of this appendix furnishes a brief description of the SC toolbox, with a specic example of its use for generating an innite polygonal region. The second sec-tion describes the scripts and funcsec-tions of the implementasec-tion of the two-mass bar-plate dynamical model of the vocal folds together with the 1-D aerodynamic loadind model of glottal ow which provides the forcing of the dynamical model. The third section describes the scripts and functions of the fully 2-D unsteady ideal potential ow simulation code.

Descriptions of functions, including preconditions and postconditions, are provided.

It must be strongly emphasized that, because MATLAB is a weakly typed language, in many cases it is essential that the parameters which are passed to functions be tested by the function to ensure that they conform to the expectations of the function. This is not always done, consequently, prior to runtime, the user is expected exercise extreme caution in ensuring that the variables passed are of the correct type. Especially when this verication is not performed by the function, the user must be aware of the types and ranges of values the function expects, the order of arguments the function expects, and the types and ranges of values the function produces as return values.

C.1 SC Toolbox

The SC tooblox for manipulation of Schwarz-Christoel mappings in MATLAB is freely available at http://www.math.udel.edu/~driscoll/SC/ (accessed at the time of writing).

The book [24] and package documentation [23] are tremendous resources and enable one to take full advantage of the package in a variety of polygonal congurations. Nevertheless,

a description of how to achieve various desirable outcomes with vertices at innity are described below, including some pitfalls.

C.1.1 Functions

Overall, the SC package for MATLAB is employed in the following sequence 1. create a polygon with a call to polygon

2. create a map by calling the function which numerically solves for the required pa-rameters (specic functions for dierent pre-images are enumerated in Table C.1 below)

3. parameters may be extracted by accessing the map object produced in 2. The map object may be used to visualize, compute forward transforms, inverse transforms, and derivatives of the transform.

polygon takes a pair of arguments, the rst one is a vector of vertices, the second is a vector of interior angles. The various SC maps listed in table C.1 obtain the required parameters for diering pre-image regions and whether the range is the interior or exterior of some specied polygonal region.

Table C.1: Available SC mappings with dierent domains.

SC map domain of pre-image image

diskmap D(0, 1), the unit disk about the origin interior of polygon hplmap H+, the upper half plane interior of polygon stripmap innite horizontal strip interior of polygon

extermap disk exterior of polygon

Functions such as plot and evalf have been overridden to provide the functionality re-quired in item 3.

C.1.2 An Example

In this example, a polygonal region in the physical plane will be specied and its pre-image will be determined. In order to specify an unbounded polygon, i.e., one with vertices at innity, the interior angles must also be specied. Function polygon requires two parameters in this case, a list of vertices in the complex plane and a corresponding list of interior angles. For the polygon to fold back on itself at innity, the interior angles there are zero. In particular, the polygon generated by the snippet of code

VERT = [ -1 - 1i, -1 - 0.5i, 1 - 0.3237i, 1 - 1i, Inf, ...

1 + 1i, 1 + 0.3237i, -1 + 0.5i, -1 + 1i, Inf ];

alpha = Arg(VERT(2)-VERT(3));

ALPHA =[ 1/2, 3/2+alpha/pi, 3/2-alpha/pi, 1/2, 0, ...

1/2, 3/2-alpha/pi, 3/2+alpha/pi, 1/2, 0];

p = polygon(VERT,ALPHA) plot(p)

is shown in Figure C.1.

−1 −0.5 0 0.5 1

−1

−0.5 0 0.5

1 −1+i

−1+i 1+0.3237i

1+i

1−i 1−0.3237i

−1−0.5i

−1−i

Figure C.1: Desired polygonal region.

Subsequently, the map object corresponding to the Schwarz-Christoel map from the strip to this polygonal region may be obtained with a call to stripmap. Because the polygon has innite vertices, the indices of the innite vertices in the specication must be provided. The vertex at −∞ as the vertex at index 10 in both vertex list VERT and corresponding list of interior angles ALPHA. The vertex at ∞ is the vertex at index 5. A call to stripmap determines the parameters corresponding to the SC mapping from the horizontal strip to the desired region. The following snippet of code,

ENDPOINTS = [10, 5];

f1 = stripmap(p,ENDPOINTS);

plot(f1)

generates the map object which may be plotted, and is shown in Figure C.2 (b). Figure C.2 (a), generaged by plot(prevertex(f1),'.k'), shows the pre-image of the SC mapping, (a) displays the horizontal strip together with the pre-images of the nite vertices.

−1 −0.5 0 0.5 1

−1

−0.5 0 0.5

1

0.5 1 1.5 2 2.5 3 3.5

0 0.5 1 1.5

(a)

(b) Figure C.2: Visualization of resulting SC map.