Prev: Simulation of SPIM
Next: rectangular grid on cylinder
From: kay on 15 Apr 2010 11:39 im using fmincon toolbox GUI to find the minimum value of width to be designed. here is the function file: function f = Design_area(x,sigma) f = x(1)*x(2); function[c,ceq] = beam_constraint(x,sigma) sigma = 200*10^8; c(1) = 1000 - (sigma*x(1)*x(2)); c(2) = 1000 - (sigma*x(1)*x(2)); ceq = []; lb = [10 0]; ub = [20,inf]; where my constraints are 1) 1000/x(1)*x(2)* <= sigma 2) 10<=x(1)<=20 3)10<=x(2)<=20 i want my initial dimension to be x(1)=20 and x(2)=20..how do i write it? for the start point, i entered [20 1]. is it correct?
From: kay on 15 Apr 2010 12:00 some more information for my problem: width=x(1) height=x(2) as u can see in the code, i wrote the upper n lower boundary : lb = [10 0]; ub = [20,inf]; but then how do the function knows it is for which variable? i mean, i have 2 variables x(1) and x(2) but..how do i write the boundary for both of my variables? anyway, is the code for boundary that i wrote is correct? one more thing, when i change my start point to [20 1], this is the output: Max Line search Directional First-order Iter F-count f(x) constraint steplength derivative optimality 0 3 20 0 1 6 0.049751 -0.002494 1 -19.9 0.995 2 9 1.53649e-007 -7.702e-009 1 -0.0498 8.29e-006 3 12 5e-008 -2.506e-009 1 -1.04e-007 1.52e-017 Optimization terminated: first-order optimality measure less than options.TolFun and maximum constraint violation is less than options.TolCon. Active inequalities (to within options.TolCon = 1e-006): lower upper ineqlin ineqnonlin 2 1 -->the final value from the optimtool gives me value of x(1)=19.95 and x(2)=0 and objective function value = 5.00000e-8 (iteration 3) how do interpret the output? i dont understand.please help ..
|
Pages: 1 Prev: Simulation of SPIM Next: rectangular grid on cylinder |