12.07.2015 Views

What Is Optimization Toolbox?

What Is Optimization Toolbox?

What Is Optimization Toolbox?

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Examples That Use Standard Algorithms(2-6)where A(f) isthe magnitude of the frequency response. One solution is toapply a goal attainment method to the magnitude of the frequency response.Given a function that computes the magnitude, the function fgoalattainwill attempt to varythemagnitudecoefficientsa(n) until the magnituderesponse matches the desired response within some tolerance. The functionthat computes the magnitude response is given in filtmin.m. This functiontakes a, themagnitude function coefficients, and w, the discretization of thefrequency domain we are interested in.To set up a goal attainment problem, you must specify the goal and weightsfor the problem. For frequencies between 0 and 0.1, the goal is one. Forfrequencies between 0.15 and 0.5, the goal is zero. Frequencies between 0.1and 0.15 are not specified, so no goals or weights are needed in this range.This information is stored in the variable goal passed to fgoalattain.The length of goal is the same as the length returned by the functionfiltmin. So that the goals are equally satisfied, usually weight wouldbe set to abs(goal). However, since some of the goals are zero, the effectof using weight=abs(goal) will force the objectives with weight 0tobesatisfied as hard constraints, and the objectives with weight 1 possibly to beunderattained (see “Goal Attainment Method” on page 3-49). Because all thegoals are close in magnitude, using a weight of unity for all goals will givethem equal priority. (Using abs(goal) for the weights is more importantwhen the magnitude of goal differs more significantly.) Also, settingoptions = optimset('GoalsExactAchieve',length(goal));specifies that each objective should be as nearaspossibletoitsgoalvalue(neither greater nor less than).2-37

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!