Optimization Code

  • Thread starter physicsCU
  • Start date
  • #1
202
1

Main Question or Discussion Point

OK, here is the situation.

I am supposed to write optimization code in Matlab to determine which of two missions an airplane should perform. There are three total, but one of them has been decided on. So I need to determine which of the other two I should do.

The problem is that I have never written this type of code before, so I have no clue what to do.

Could someone give me a good resource I can use as a starting point to writing this code?
 

Answers and Replies

  • #2
1,356
2
um i think you need to put parameters/variables/criterion that your using so that people can be more descriptive. ie is it a airplane path like TSP/Hcycles problem?
 
  • #3
202
1
ok, I need to minimize the weight as much as i can.

one mission involved flying up to 10 liters of water, and is scored by number of laps completed ^2, ie 5 laps = 25 for score

the other is carry 96 tennis balls for 2 minutes, and this can be any number, as long as all 96 fly. scored by 1/RAC where RAC = airframe + battery weight.

The plane already will carry 48 tennis balls and 4 liters of water.
 
  • #4
1,679
3
There is an optimization function built in.

What you want to do is define a goal function. The matlab function will
minimize that goal function (If you want to maximize it, put a minus sign in front
of it.)

Then there are some number of unknowns. You goal function is a function of the
unknowns and matlab will find particular values for the unknowns so that the
goal function is a minimum.


Try "help fminsearch"
 
  • #5
202
1
thanks!!!

is fminsearch in standard matlab or is it in a toolbox?
 
  • #6
PerennialII
Science Advisor
Gold Member
898
0
... if you have the optimization toolbox then you've a number of great tools available. Fminsearch is for unconstrained nonlinear optimization and is a standard function.
 
  • #7
202
1
ok thanks.

sounds like i may want to consider using the optimization toolbox, especially because i need this code done in two weeks.
 
  • #8
PerennialII
Science Advisor
Gold Member
898
0
... and depending on the degree of nonlinearity and in case you've 'complex' constraints you may have to implement, the optimization toolbox rules.
 

Related Threads on Optimization Code

  • Last Post
Replies
1
Views
2K
  • Last Post
Replies
2
Views
4K
  • Last Post
Replies
0
Views
4K
  • Last Post
Replies
0
Views
2K
Replies
8
Views
2K
  • Last Post
Replies
0
Views
1K
  • Last Post
Replies
20
Views
10K
Replies
1
Views
607
  • Last Post
Replies
3
Views
2K
  • Last Post
Replies
1
Views
667
Top