# Question:Nelder Mead - Non-negative condition for optimized value

## Question:Nelder Mead - Non-negative condition for optimized value

Maple
Hello, I am currently using Nelder Mead for an optimization problem. I used the following code taken out of the Maple Library (www.maplesoft.com/applications/app_center_view.aspx?CID=1&SCID=18&AID=1198) Concerning this code I have 2 questions: 1. The optimized values I get are sometimes negative. My solution should be limited on positive optimization values. I am not sure how to implement this. 2. The optimization is running quite slowly. Any suggestions how to improve the running time? Here are the most important parts of the code: 1. Enter initial simplex, stopping tolerance y1:= [1.5, 0]; y2:= [2, 0]; y3:=[2,0.5]; #define initial simplex. Need not be ordered y1 := [1.5, 0] y2 := [2, 0] y3 := [2, 0.5] epsilon := 1.0 * 10^(-5); #stopping tolerance (see method summary: Termination) epsilon := 0.00001000000000 2. Create function acting on points ff:=proc(y1) f(y1[1],y1[2]); end: Procedure for ordering points by objective function values order3:=proc(g,y1,y2,y3) #returns list of the 3 points in order of increasing g local x1, x2, x3,f1, f2, f3: f1:=g(y1);f2:=g(y2);f3:=g(y3); if (f1 <><><><><><><><><><><><><>
﻿