How do I format the problem for the Optimization Toolbox?

조회 수: 4 (최근 30일)
Carson
Carson 2013년 12월 7일
댓글: Walter Roberson 2013년 12월 9일
I am trying to optimize the dimensions of a heat exchanger that pertains to the lowest cost. I've written a function file that requires 5 variables, and returns a total cost. The function file contains non-linear equations that describe the heat exchanger model.
I am using the optimization tool in matlab, I've defined my objective function: @HeatExchanger and have entered a start point for each variable: [320,3,0.04,22000,7]
I keep getting the error: Optimization running. Error running optimization. Matrix dimensions must agree.
I've watched the videos and read through the documentation, but i'm unclear on the format that the start point should be entered in.
I've watched the video that teaches you how to setup the problem, but in the video the user defines it's own variable matrix, but in the tool how can I know what variables x(1)...x(10) are being assigned to.
All the variables should be positive but there are really no constraints, though it would be nice to know the format for entering those as well...
Can anyone please help?

채택된 답변

Alan Weiss
Alan Weiss 2013년 12월 9일
Please give us more information, such as
  • The objective function signature (function f = HeatExchanger(x)?)
  • The solver call (x = fminunc(@HeatExchanger,x0,options?) and any place in the function where you have matrices
  • The current definition of x0
If you want to try to read the documentation, I suggest that you look at the syntax for objective functions.
Good luck,
Alan Weiss
MATLAB mathematical toolbox documentation
  댓글 수: 1
Walter Roberson
Walter Roberson 2013년 12월 9일
And along with providing that information, you should restore the text of your previous question, http://www.mathworks.co.uk/matlabcentral/answers/108978-can-i-find-the-minimum-output-of-a-function-file
Volunteers tend to stop assisting people who delete their questions.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Problem-Based Optimization Setup에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by