Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

fgoalattain (Optimization Toolbox)

Status
Not open for further replies.

RoopB

Aerospace
May 24, 2010
6
US
Continuing on with my quest in optimization, I am looking to find a particular solution using a multi-objective optimization function. My design variables would be BDLT, BALPHA, BALPHY, and BPHIP. Fx, Fy, Fz, Mx, My, Mz would be the objective. The function takes the following form:

[Fx, Fy, Fz, Mx, My, Mz] = aFunc(BDLT, BALPHA, BALPY, BPHIP)

%(where BDLT is a 1x4 Matrix)

After reading up on the optimization functions in Matlab, it looks as though the function fgoalattain would be best for a nonlinear, multiobjective function. I set up my solver as such:

XO = [0 0 0 0 0 0 0] % Set initial values to 0; steady state
goal = [0 1 0 0 1 0]; % This is the value that I want to set for [Fx, Fy, Fz, Mx, My, Mz]
weight = abs(goal); % Equal weight to all goal values
options = optimset(‘Display’, ‘iter’); % Set display parameter

[X, fval, attainfactor] = fgoalattain(‘aFunc’, XO, goal, weight, [], [], [], [], [], [], [], options);

I put seven []’s, which should be the seven outputs I want: [BDLT(4), BALPHA, BALPHY, BPHIP]. By my understanding, X should output a vector with the seven values I want, given the defined goal. I receive the following error:

??? Input Argument “BALPHA” is undefined.

Error in ++> fgoalattain at 371
user_f = feval(funfcn(3), x, varargin:)));

When BALPHA is one of the variables I am trying to solve for! I’m sure that I’m just not understanding my input and output vectors correctly, but I can’t see where I’m going wrong. Do I need to change some of my variables to constraints? Thanks in advance for your thoughts.
 
Replies continue below

Recommended for you

I don't have this toolbox, but almost all solvers and optimizers require an initial guess value. To expect these algorithms to select a starting point from an infinite set of possibilities is a bit much, don't you think?


The closer to the actual solution you guess, the better off the solver will be.

TTFN

FAQ731-376
 
The form of the equation supplied by the help function is:

x = fgoalattain(func, xO, goal, weight)

which tries to make the objective functions supplied by func attain the goals specified by goal by varying x, starting at xO. So xO should be the 'initial guess', correct?

I've tried to further simplify the form of my equation by:
[BDLT, BALPHA, BALPHY, BPHIP] = fgoalattain('aFunc', XO, goal, weight)


Where I get the same error message as previously mentioned. I know that I want BALPHY, BPHIP to be 0, and vary BDLT, BALPHA to achieve the goal.

I've been spinning my gears on this one and not making any progress. My next step is to continue reading and maybe I'll get a better understanding of this.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top