Documentation

### This is machine translation

Mouseover text to see original. Click the button below to return to the English version of the page.

To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

## Set Start Points for MultiStart

### Four Ways to Set Start Points

There are four ways you tell `MultiStart` which start points to use for the local solver:

• Pass a positive integer `k`. `MultiStart` generates `k - 1` start points as if using a `RandomStartPointSet` object and the `problem` structure. `MultiStart` also uses the `x0` start point from the `problem` structure, for a total of `k` start points.

• Pass a cell array of `RandomStartPointSet` and `CustomStartPointSet` objects. Pass a cell array if you have some specific points you want to run, but also want `MultiStart` to use other random start points.

### Note

You can control whether `MultiStart` uses all start points, or only those points that satisfy bounds or other inequality constraints. For more information, see Filter Start Points (Optional).

### Positive Integer for Start Points

The syntax for running `MultiStart` for `k` start points is

`[xmin,fmin,flag,outpt,allmins] = run(ms,problem,k);`

The positive integer `k` specifies the number of start points `MultiStart` uses. `MultiStart` generates random start points using the dimension of the problem and bounds from the `problem` structure. `MultiStart` generates `k - 1` random start points, and also uses the `x0` start point from the `problem` structure.

### RandomStartPointSet Object for Start Points

Create a `RandomStartPointSet` object as follows:

`stpoints = RandomStartPointSet;`

By default a `RandomStartPointSet` object generates 10 start points. Control the number of start points with the `NumStartPoints` property. For example, to generate 40 start points:

`stpoints = RandomStartPointSet('NumStartPoints',40);`

You can set an `ArtificialBound` for a `RandomStartPointSet`. This `ArtificialBound` works in conjunction with the bounds from the problem structure:

• If a component has no bounds, `RandomStartPointSet` uses a lower bound of `-ArtificialBound`, and an upper bound of `ArtificialBound`.

• If a component has a lower bound `lb` but no upper bound, `RandomStartPointSet` uses an upper bound of `lb + 2*ArtificialBound`.

• Similarly, if a component has an upper bound `ub` but no lower bound, `RandomStartPointSet` uses a lower bound of `ub - 2*ArtificialBound`.

For example, to generate `100` start points with an `ArtificialBound` of `50`:

```stpoints = RandomStartPointSet('NumStartPoints',100, ... 'ArtificialBound',50);```

A `RandomStartPointSet` object generates start points with the same dimension as the `x0` point in the problem structure; see `list`.

### CustomStartPointSet Object for Start Points

To use a specific set of starting points, package them in a `CustomStartPointSet` as follows:

1. Place the starting points in a matrix. Each row of the matrix represents one starting point. `MultiStart` runs all the rows of the matrix, subject to filtering with the `StartPointsToRun` property. For more information, see MultiStart Algorithm.

2. Create a `CustomStartPointSet` object from the matrix:

`tpoints = CustomStartPointSet(ptmatrix);`

For example, create a set of 40 five-dimensional points, with each component of a point equal to 10 plus an exponentially distributed variable with mean 25:

```pts = -25*log(rand(40,5)) + 10; tpoints = CustomStartPointSet(pts);```

To get the original matrix of points from a `CustomStartPointSet` object, use `list`:

`pts = list(tpoints); % Assumes tpoints is a CustomStartPointSet`

A `CustomStartPointSet` has two properties: `StartPointsDimension` and `NumStartPoints`. You can use these properties to query a `CustomStartPointSet` object. For example, the `tpoints` object in the example has the following properties:

```tpoints.StartPointsDimension ans = 5 tpoints.NumStartPoints ans = 40```

### Cell Array of Objects for Start Points

To use a specific set of starting points along with some randomly generated points, pass a cell array of `RandomStartPointSet` or `CustomStartPointSet` objects.

For example, to use both the 40 specific five-dimensional points of CustomStartPointSet Object for Start Points and 40 additional five-dimensional points from `RandomStartPointSet`:

```pts = -25*log(rand(40,5)) + 10; tpoints = CustomStartPointSet(pts); rpts = RandomStartPointSet('NumStartPoints',40); allpts = {tpoints,rpts};```

Run `MultiStart` with the `allpts` cell array:

```% Assume ms and problem exist [xmin,fmin,flag,outpt,allmins] = run(ms,problem,allpts);```

Watch now