Prev: Creating a matrix of strings?
Next: Simulink
From: kay on 16 Apr 2010 04:13 please help me. what is the correct way of writing/supplying the upper and lower bound of my minimization problem? for example i have 4 design variables in which all of them have the bounds of: 10<= x(1)<=15 10<=x(2)<=15 0.1<=x(3)<=0.25 1.0<=x(4)<=2.5 plus the inequality constraint of: c =(P/(x(2)-2*x(4))*x(3)) - Von_misses_stress; ceq = []; where Von_misses_stress = 32500 and P = 10000 i used to write it like this: lb = [10;10;0.1;1]; ub = [15;15;0.25;2.5]; is it the correct way? coz i dint get the correct result for my minimization problem. another thing, what would be the suitable value for the start point? i have tried changing the start point i.e x0=[20 20 1 5] but still the result is ridiculous. my function is to minimize the volume in which the equation is x(1)*x(2)*x(3) -3.142*x(4)^2 please help me..i've modified my code several time but still wrong
From: Yi Cao on 16 Apr 2010 04:30 Hi Kay, I assume you are using fmincon. lb and ub are correct. However, c seems does nothing. Since 10 <= x(2), so P/x(2) <= 1000, and P/x(2) - 2*x(4) <= 998, then (P/x(2) - 2*x(4))*x(3) <= 249.5, therefore, c always negative. Is this the case? Yi "kay " <kfederer.yusof(a)gmail.com> wrote in message <hq966g$f8d$1(a)fred.mathworks.com>... > please help me. > what is the correct way of writing/supplying the upper and lower bound of my minimization problem? for example i have 4 design variables in which all of them have the bounds of: > 10<= x(1)<=15 > 10<=x(2)<=15 > 0.1<=x(3)<=0.25 > 1.0<=x(4)<=2.5 > plus the inequality constraint of: > c =(P/(x(2)-2*x(4))*x(3)) - Von_misses_stress; > ceq = []; > > where Von_misses_stress = 32500 > and P = 10000 > > i used to write it like this: > lb = [10;10;0.1;1]; > ub = [15;15;0.25;2.5]; > > is it the correct way? coz i dint get the correct result for my minimization problem. > another thing, what would be the suitable value for the start point? i have tried changing the start point i.e x0=[20 20 1 5] but still the result is ridiculous. > my function is to minimize the volume in which the equation is > x(1)*x(2)*x(3) -3.142*x(4)^2 > > please help me..i've modified my code several time but still wrong
From: kay on 16 Apr 2010 05:32 "Yi Cao" <y.cao(a)cranfield.ac.uk> wrote in message <hq9774$23d$1(a)fred.mathworks.com>... > Hi Kay, > > I assume you are using fmincon. lb and ub are correct. However, c seems does nothing. > > Since 10 <= x(2), so P/x(2) <= 1000, and P/x(2) - 2*x(4) <= 998, then (P/x(2) - 2*x(4))*x(3) <= 249.5, therefore, c always negative. > > Is this the case? dear Yi, thank u for your reply.. i just realized that i've mistakenly wrote the wrong equation for the volume. now that the result is acceptable but changing the start point gives me different result. so, actually what is the best guess to start my point with? for example since my boundary limitations are as i stated earlier, is it better if i give the start point of [20 20 1 5] which arethe values that are close to my boundary ..or do i just have to give [1 1 1 1] instead?
From: Yi Cao on 16 Apr 2010 07:16 "kay " <kfederer.yusof(a)gmail.com> wrote in message <hq9aql$t40$1(a)fred.mathworks.com>... > "Yi Cao" <y.cao(a)cranfield.ac.uk> wrote in message <hq9774$23d$1(a)fred.mathworks.com>... > > Hi Kay, > > > > I assume you are using fmincon. lb and ub are correct. However, c seems does nothing. > > > > Since 10 <= x(2), so P/x(2) <= 1000, and P/x(2) - 2*x(4) <= 998, then (P/x(2) - 2*x(4))*x(3) <= 249.5, therefore, c always negative. > > > > Is this the case? > > dear Yi, thank u for your reply.. > i just realized that i've mistakenly wrote the wrong equation for the volume. now that the result is acceptable but changing the start point gives me different result. > so, actually what is the best guess to start my point with? for example since my boundary limitations are as i stated earlier, is it better if i give the start point of [20 20 1 5] which arethe values that are close to my boundary ..or do i just have to give [1 1 1 1] instead? None can tell what is the best initial value for a non-convex problem. You have to keep trying different initial values, or link it with another random search method, such as GA. HTH Yi
From: Steven Lord on 16 Apr 2010 09:38
"kay " <kfederer.yusof(a)gmail.com> wrote in message news:hq9aql$t40$1(a)fred.mathworks.com... > "Yi Cao" <y.cao(a)cranfield.ac.uk> wrote in message > <hq9774$23d$1(a)fred.mathworks.com>... >> Hi Kay, >> >> I assume you are using fmincon. lb and ub are correct. However, c seems >> does nothing. >> >> Since 10 <= x(2), so P/x(2) <= 1000, and P/x(2) - 2*x(4) <= 998, then >> (P/x(2) - 2*x(4))*x(3) <= 249.5, therefore, c always negative. >> >> Is this the case? > > dear Yi, thank u for your reply.. > i just realized that i've mistakenly wrote the wrong equation for the > volume. now that the result is acceptable but changing the start point > gives me different result. > so, actually what is the best guess to start my point with? for example > since my boundary limitations are as i stated earlier, is it better if i > give the start point of [20 20 1 5] which arethe values that are close to > my boundary ..or do i just have to give [1 1 1 1] instead? Choosing a "good" starting point can sometimes be difficult, but if you can do so (say by using what you know of the background behind the problem) it can help the optimizer. But looking at your starting point of [20 20 1 5], and the bounds you posted in your first message: > 10<= x(1)<=15 > 10<=x(2)<=15 > 0.1<=x(3)<=0.25 > 1.0<=x(4)<=2.5 _None_ of the elements in your starting point are within the bounds you specified for the problem! A starting point of [1 1 1 1] would put one element (the last) barely within the bounds, but at the very least, I'd choose a point within the bounds as the starting point. For example, let's make the starting point midway between the bounds. lb = [10 10 0.1 1.0]; ub = [15 15 0.25 2.5]; x0 = (lb+ub)/2; -- Steve Lord slord(a)mathworks.com comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ |