From: Walter Roberson on
rabbahs wrote:

> can u give me the expression to calculate the positive value of a,b and d ?

Well, as I wrote before:

====
The solution process involved reducing it down to a problem in 3
expressions, with the other 5 reducing to 0 by linear combinations of
the 3 remaining variables. Those expressions (which have to be solved to
equal 0) are:

c11*a*(a + b + 1/2*c15 - d + 94/25*c17 + c18) - b^2,

c12*(c16 + 2*c17 + c18 - 2*a - b)*(a + b + 1/2*c15 - d + 94/25*c17 +
c18) - b*(1/2*c15 - 2*d - c16 - 2*c17 + 2*a+b),

c13*(1/2*c15 - 2*d - c16 - 2*c17 + 2*a + b)^2 - d*(a + b + 1/2*c15 - d +
94/25*c17 + c18)

As before, c18 is what you wrote as the constant c1(8) and so on.

The solution to this trio of equations involves finding the roots of a
quartic.
=====

So substitute your known constants into the three equations above, and
then proceed with traditional elimination. For example, d appears in the
first one multiplied only by a and a constant, so move the -b^2 to the
right hand side, divide by c11*a, and you then have a linear expression
on the left hand side that can be used to isolate d. That d value can
then be substituted into the two remaining equations. The second
expression will then become cubic in b but the third expression will
become quartic in b, so it would probably be easier to solve the second
expression first for a (make sure you consider all three roots), and
then use that to solve the third expression.


After substitution of the constants, the three expressions will be of
the general form

E1*a*(a+b+E2-d)/E3-b^2,

E4*(E5-2*a-b)*(a+b+E2-d)/E6-b*(E7-2*d+2*a+b),

E8*(E9-2*d+2*a+b)/E10-d*(a+b+E2-d)

where the E's are a combination of constants determined by the c1(:)
values. There is a general symbolic solution to this, but the general
solution has a repeated subexpression a quartic polynomial. In Matlab
notation, this quartic can be solved via

P = roots([E10*(E1+4*E3) * (E1*E6*E4+E1*E6^2-E3*E4^2),

E1*(8*E8*E4*E3*E6 - 2*E10*E2*E4^2*E3 - 4*E10*E3*E6*E4*E5 -
E1*E10*E6*E7*E4 - 4*E10*E6*E7*E4*E3 + E1*E8*E4^2 + 3*E1*E10*E2*E6*E4
+ 4*E10*E2*E4*E3*E6 + 2*E1*E8*E4*E6 - E1*E10*E6*E4*E5 +
2*E1*E10*E2*E6^2 + 4*E8*E4^2*E3),

E1*(E1*E10*E6*E7*E4*E5 + 4*E1*E8*E2*E4*E6 - 2*E1*E8*E4*E5*E6 +
E10*E3*E4^2*E5^2 + 2*E1*E10*E2*E6^2*E7 + 4*E1*E8*E6^2*E7 -
E1*E10*E6^2*E7^2 + 2*E1*E8*E6*E7*E4 - 4*E8*E9*E1*E6^2 -
4*E8*E4^2*E3*E5 + 2*E1*E10*E2^2*E6*E4 - E8*E9*E1*E4^2 +
2*E1*E8*E2*E4^2 + 2*E10*E2*E4^2*E3*E5 - 3*E1*E10*E2*E6*E4*E5 -
2*E1*E8*E4^2*E5 - E1*E10*E2*E6*E7*E4 - 4*E8*E9*E1*E4*E6),

E1^2*E4*E5*(-E8*E4*E5 - 2*E4*E8*E9 + 4*E8*E2*E4 + 2*E8*E6*E7 -
4*E8*E9*E6 + 2*E10*E2^2*E6 - E10*E2*E6*E7 + 4*E8*E2*E6),

-E8*E9*E1^2*E4^2*E5^2 + 2*E8*E1^2*E2*E4^2*E5^2 )

where the various E's are copied by inspection of the coefficients of
the three equations above after substitution of the constants.

Once you have the roots of this P value, substitute them each in turn into:

a = -P*E3*((-E4 - 2*E6)*P + E4*E5) /
((E1*E6 - 2*E3*E4)*P - E6*E7*E1 + 2*E6*E1*E2)

b = P

d = (-(E1 + 4*E3)*(E1*E6*E4 + E1*E6^2 - E3*E4^2)*P^3 - E1*(3*E1*E4*E6*E2
- E1*E4*E5*E6 - 2*E2*E4^2*E3 - E1*E4*E6*E7 - 4*E3*E6*E4*E5 +
4*E2*E6*E4*E3 + 2*E1*E6^2*E2 - 4*E6*E7*E4*E3)*P^2 - E1*(E3*E4^2*E5^2 -
E1*E6^2*E7^2 - 3*E1*E4*E5*E6*E2 + 2*E1*E2*E6^2*E7 + 2*E1*E2^2*E4*E6 -
E1*E2*E4*E6*E7 + E1*E4*E5*E6*E7 + 2*E2*E4^2*E5*E3)*P -
E1^2*E2*E4*E5*E6*E7 + 2*E1^2*E2^2*E4*E5*E6) /
(((-E4 - 2*E6)*P + E4*E5)*E1*((E1*E6 - 2*E3*E4)*P - E6*E7*E1 +
2*E6*E1*E2)

and see if you can find a root set of P that makes a, b, and d all
non-negative. If none of the root-sets work, then there is no hope with
that combination of constants. (This set of expressions was found via
the Maple symbolic combination engine -- I don't try to do these things
by hand!)

Once you have an all-positive (a, b, d) tuple, substitute the respective
constants and a, b, d values into

c = 1/2*c15 - 2*d - c16 - 2*c17 + 2*a + b
e = 94/25*c17
f = c16 + 2*c17 + c18 - 2*a - b
g = c14 - a - b - d
p = a + b - d + c15/2 + 94/25*c17 + c18

and see if you get all-positive results. If so, you are done. If not,
then go back and try the next root-set of the output of the roots()
call. If none of the four work, then you cannot solve the problem with
that combination of constants.

I do not recommend trying to solve this system via a minimizer: the
constants either have the right relationship for the exact solution, or
they do not have the right relationship and no amount of minimization
would fix that. The only time I might suggest a minimizer on this is if
the "constants" are actually intervals and you are hoping that somewhere
in the intervals is a solution such that all the variables are positive.


If you explore this system of equations further, you will find that in
general it has singularities. The singularities _tend_ to be in the
negative range, but with some combinations of values, the singularities
can occur in the positive ranges. For example, with the set of random
c1(:) constants I indicated before that I posted with, except with c18
left undetermined, I found that the graph was quite wobbly between 8.1
and 8.4 with multiple roots _and_ a singularity within a range of about
0.102. The singularity itself, Matlab cannot isolate, because a change
in the last bit causes a jump from about -21 to about +7: there might
actually be a zero in there, if you used used much higher precision...
but be off by .1 and the values jump between +/- 10^64 !
From: rabbahs on
Walter Roberson <roberson(a)hushmail.com> wrote in message <ho7ejp$hro$1(a)canopus.cc.umanitoba.ca>...
> rabbahs wrote:
>
> > can u give me the expression to calculate the positive value of a,b and d ?
>
> Well, as I wrote before:
>
> ====
> The solution process involved reducing it down to a problem in 3
> expressions, with the other 5 reducing to 0 by linear combinations of
> the 3 remaining variables. Those expressions (which have to be solved to
> equal 0) are:
>
> c11*a*(a + b + 1/2*c15 - d + 94/25*c17 + c18) - b^2,
>
> c12*(c16 + 2*c17 + c18 - 2*a - b)*(a + b + 1/2*c15 - d + 94/25*c17 +
> c18) - b*(1/2*c15 - 2*d - c16 - 2*c17 + 2*a+b),
>
> c13*(1/2*c15 - 2*d - c16 - 2*c17 + 2*a + b)^2 - d*(a + b + 1/2*c15 - d +
> 94/25*c17 + c18)
>
> As before, c18 is what you wrote as the constant c1(8) and so on.
>
> The solution to this trio of equations involves finding the roots of a
> quartic.
> =====
>
> So substitute your known constants into the three equations above, and
> then proceed with traditional elimination. For example, d appears in the
> first one multiplied only by a and a constant, so move the -b^2 to the
> right hand side, divide by c11*a, and you then have a linear expression
> on the left hand side that can be used to isolate d. That d value can
> then be substituted into the two remaining equations. The second
> expression will then become cubic in b but the third expression will
> become quartic in b, so it would probably be easier to solve the second
> expression first for a (make sure you consider all three roots), and
> then use that to solve the third expression.
>
>
> After substitution of the constants, the three expressions will be of
> the general form
>
> E1*a*(a+b+E2-d)/E3-b^2,
>
> E4*(E5-2*a-b)*(a+b+E2-d)/E6-b*(E7-2*d+2*a+b),
>
> E8*(E9-2*d+2*a+b)/E10-d*(a+b+E2-d)
>
> where the E's are a combination of constants determined by the c1(:)
> values. There is a general symbolic solution to this, but the general
> solution has a repeated subexpression a quartic polynomial. In Matlab
> notation, this quartic can be solved via
>
> P = roots([E10*(E1+4*E3) * (E1*E6*E4+E1*E6^2-E3*E4^2),
>
> E1*(8*E8*E4*E3*E6 - 2*E10*E2*E4^2*E3 - 4*E10*E3*E6*E4*E5 -
> E1*E10*E6*E7*E4 - 4*E10*E6*E7*E4*E3 + E1*E8*E4^2 + 3*E1*E10*E2*E6*E4
> + 4*E10*E2*E4*E3*E6 + 2*E1*E8*E4*E6 - E1*E10*E6*E4*E5 +
> 2*E1*E10*E2*E6^2 + 4*E8*E4^2*E3),
>
> E1*(E1*E10*E6*E7*E4*E5 + 4*E1*E8*E2*E4*E6 - 2*E1*E8*E4*E5*E6 +
> E10*E3*E4^2*E5^2 + 2*E1*E10*E2*E6^2*E7 + 4*E1*E8*E6^2*E7 -
> E1*E10*E6^2*E7^2 + 2*E1*E8*E6*E7*E4 - 4*E8*E9*E1*E6^2 -
> 4*E8*E4^2*E3*E5 + 2*E1*E10*E2^2*E6*E4 - E8*E9*E1*E4^2 +
> 2*E1*E8*E2*E4^2 + 2*E10*E2*E4^2*E3*E5 - 3*E1*E10*E2*E6*E4*E5 -
> 2*E1*E8*E4^2*E5 - E1*E10*E2*E6*E7*E4 - 4*E8*E9*E1*E4*E6),
>
> E1^2*E4*E5*(-E8*E4*E5 - 2*E4*E8*E9 + 4*E8*E2*E4 + 2*E8*E6*E7 -
> 4*E8*E9*E6 + 2*E10*E2^2*E6 - E10*E2*E6*E7 + 4*E8*E2*E6),
>
> -E8*E9*E1^2*E4^2*E5^2 + 2*E8*E1^2*E2*E4^2*E5^2 )
>
> where the various E's are copied by inspection of the coefficients of
> the three equations above after substitution of the constants.
>
> Once you have the roots of this P value, substitute them each in turn into:
>
> a = -P*E3*((-E4 - 2*E6)*P + E4*E5) /
> ((E1*E6 - 2*E3*E4)*P - E6*E7*E1 + 2*E6*E1*E2)
>
> b = P
>
> d = (-(E1 + 4*E3)*(E1*E6*E4 + E1*E6^2 - E3*E4^2)*P^3 - E1*(3*E1*E4*E6*E2
> - E1*E4*E5*E6 - 2*E2*E4^2*E3 - E1*E4*E6*E7 - 4*E3*E6*E4*E5 +
> 4*E2*E6*E4*E3 + 2*E1*E6^2*E2 - 4*E6*E7*E4*E3)*P^2 - E1*(E3*E4^2*E5^2 -
> E1*E6^2*E7^2 - 3*E1*E4*E5*E6*E2 + 2*E1*E2*E6^2*E7 + 2*E1*E2^2*E4*E6 -
> E1*E2*E4*E6*E7 + E1*E4*E5*E6*E7 + 2*E2*E4^2*E5*E3)*P -
> E1^2*E2*E4*E5*E6*E7 + 2*E1^2*E2^2*E4*E5*E6) /
> (((-E4 - 2*E6)*P + E4*E5)*E1*((E1*E6 - 2*E3*E4)*P - E6*E7*E1 +
> 2*E6*E1*E2)
>
> and see if you can find a root set of P that makes a, b, and d all
> non-negative. If none of the root-sets work, then there is no hope with
> that combination of constants. (This set of expressions was found via
> the Maple symbolic combination engine -- I don't try to do these things
> by hand!)
>
> Once you have an all-positive (a, b, d) tuple, substitute the respective
> constants and a, b, d values into
>
> c = 1/2*c15 - 2*d - c16 - 2*c17 + 2*a + b
> e = 94/25*c17
> f = c16 + 2*c17 + c18 - 2*a - b
> g = c14 - a - b - d
> p = a + b - d + c15/2 + 94/25*c17 + c18
>
> and see if you get all-positive results. If so, you are done. If not,
> then go back and try the next root-set of the output of the roots()
> call. If none of the four work, then you cannot solve the problem with
> that combination of constants.
>
> I do not recommend trying to solve this system via a minimizer: the
> constants either have the right relationship for the exact solution, or
> they do not have the right relationship and no amount of minimization
> would fix that. The only time I might suggest a minimizer on this is if
> the "constants" are actually intervals and you are hoping that somewhere
> in the intervals is a solution such that all the variables are positive.
>
>
> If you explore this system of equations further, you will find that in
> general it has singularities. The singularities _tend_ to be in the
> negative range, but with some combinations of values, the singularities
> can occur in the positive ranges. For example, with the set of random
> c1(:) constants I indicated before that I posted with, except with c18
> left undetermined, I found that the graph was quite wobbly between 8.1
> and 8.4 with multiple roots _and_ a singularity within a range of about
> 0.102. The singularity itself, Matlab cannot isolate, because a change
> in the last bit causes a jump from about -21 to about +7: there might
> actually be a zero in there, if you used used much higher precision...
> but be off by .1 and the values jump between +/- 10^64 !

Thanks Mr. Walter,

currently i m using fmincon command to solve this problem. I reduced the equations in to 3 set of equations (with variable a,b and 9, as u advise earlier) and that try to bound my solution with the constrains available with this function.

here are some details,

global c11 c12 c13 c14 c15 c16 c17 c18;
lb=[0 0 0 ];
ub=[10 10 20];
x0=[0 0 0];
H=[2 1 0
-2 -1 2
1 1 1
-1 -1 1];
I=[(y+2*z+k)
(0.5*x-y-2*z)
m
(0.5*x+3.76*z+k)];
options= optimset('MaxIter',5000,'MaxFunEvals',40000);
[XY,fval,exitflag,output] = fmincon('Objfcn',x0,H,I,[],[],lb,ub,'consfcn',options)


where 'Objfcn' is,

function [f]=Objfcn(x)
global c11 c12 c13 c14 c15 c16 c17 c18;
a=x(1);
b=x(2);
d=x(3);
f=sum([c11*a*(a + b + 1/2*c15 - d + 94/25*c17 + c18) - b^2 , c12*(c16 + 2*c17 + c18 - 2*a - b)*(a + b + 1/2*c15 - d + 94/25*c17 + c18) - b*(1/2*c15 - 2*d - c16 - 2*c17 + 2*a+b),c13*(1/2*c15 - 2*d - c16 - 2*c17 + 2*a + b)^2 - d*(a + b + 1/2*c15 - d + 94/25*c17 + c18)].^2);


and 'confscn' is,

function [c,ceq] = consfcn(x)
global c11 c12 c13 c14 c15 c16 c17 c18;
a=x(1);
b=x(2);
d=x(3);
c=[];
ceq=[c11*a*(a + b + 1/2*c15 - d + 94/25*c17 + c18) - b^2 ; c12*(c16 + 2*c17 + c18 - 2*a - b)*(a + b + 1/2*c15 - d + 94/25*c17 + c18) - b*(1/2*c15 - 2*d - c16 - 2*c17 + 2*a+b);c13*(1/2*c15 - 2*d - c16 - 2*c17 + 2*a + b)^2 - d*(a + b + 1/2*c15 - d + 94/25*c17 + c18)];


kindly do some comments. because this code gives good results only with certain values of constant. most of the time 'exit flag' gives '-2', and u know what does it mean :-)

takecare
From: rabbahs on
"rabbahs " <shabbarraza2000(a)yahoo.com> wrote in message <hoik3g$qi0$1(a)fred.mathworks.com>...
> Walter Roberson <roberson(a)hushmail.com> wrote in message <ho7ejp$hro$1(a)canopus.cc.umanitoba.ca>...
> > rabbahs wrote:
> >
> > > can u give me the expression to calculate the positive value of a,b and d ?
> >
> > Well, as I wrote before:
> >
> > ====
> > The solution process involved reducing it down to a problem in 3
> > expressions, with the other 5 reducing to 0 by linear combinations of
> > the 3 remaining variables. Those expressions (which have to be solved to
> > equal 0) are:
> >
> > c11*a*(a + b + 1/2*c15 - d + 94/25*c17 + c18) - b^2,
> >
> > c12*(c16 + 2*c17 + c18 - 2*a - b)*(a + b + 1/2*c15 - d + 94/25*c17 +
> > c18) - b*(1/2*c15 - 2*d - c16 - 2*c17 + 2*a+b),
> >
> > c13*(1/2*c15 - 2*d - c16 - 2*c17 + 2*a + b)^2 - d*(a + b + 1/2*c15 - d +
> > 94/25*c17 + c18)
> >
> > As before, c18 is what you wrote as the constant c1(8) and so on.
> >
> > The solution to this trio of equations involves finding the roots of a
> > quartic.
> > =====
> >
> > So substitute your known constants into the three equations above, and
> > then proceed with traditional elimination. For example, d appears in the
> > first one multiplied only by a and a constant, so move the -b^2 to the
> > right hand side, divide by c11*a, and you then have a linear expression
> > on the left hand side that can be used to isolate d. That d value can
> > then be substituted into the two remaining equations. The second
> > expression will then become cubic in b but the third expression will
> > become quartic in b, so it would probably be easier to solve the second
> > expression first for a (make sure you consider all three roots), and
> > then use that to solve the third expression.
> >
> >
> > After substitution of the constants, the three expressions will be of
> > the general form
> >
> > E1*a*(a+b+E2-d)/E3-b^2,
> >
> > E4*(E5-2*a-b)*(a+b+E2-d)/E6-b*(E7-2*d+2*a+b),
> >
> > E8*(E9-2*d+2*a+b)/E10-d*(a+b+E2-d)
> >
> > where the E's are a combination of constants determined by the c1(:)
> > values. There is a general symbolic solution to this, but the general
> > solution has a repeated subexpression a quartic polynomial. In Matlab
> > notation, this quartic can be solved via
> >
> > P = roots([E10*(E1+4*E3) * (E1*E6*E4+E1*E6^2-E3*E4^2),
> >
> > E1*(8*E8*E4*E3*E6 - 2*E10*E2*E4^2*E3 - 4*E10*E3*E6*E4*E5 -
> > E1*E10*E6*E7*E4 - 4*E10*E6*E7*E4*E3 + E1*E8*E4^2 + 3*E1*E10*E2*E6*E4
> > + 4*E10*E2*E4*E3*E6 + 2*E1*E8*E4*E6 - E1*E10*E6*E4*E5 +
> > 2*E1*E10*E2*E6^2 + 4*E8*E4^2*E3),
> >
> > E1*(E1*E10*E6*E7*E4*E5 + 4*E1*E8*E2*E4*E6 - 2*E1*E8*E4*E5*E6 +
> > E10*E3*E4^2*E5^2 + 2*E1*E10*E2*E6^2*E7 + 4*E1*E8*E6^2*E7 -
> > E1*E10*E6^2*E7^2 + 2*E1*E8*E6*E7*E4 - 4*E8*E9*E1*E6^2 -
> > 4*E8*E4^2*E3*E5 + 2*E1*E10*E2^2*E6*E4 - E8*E9*E1*E4^2 +
> > 2*E1*E8*E2*E4^2 + 2*E10*E2*E4^2*E3*E5 - 3*E1*E10*E2*E6*E4*E5 -
> > 2*E1*E8*E4^2*E5 - E1*E10*E2*E6*E7*E4 - 4*E8*E9*E1*E4*E6),
> >
> > E1^2*E4*E5*(-E8*E4*E5 - 2*E4*E8*E9 + 4*E8*E2*E4 + 2*E8*E6*E7 -
> > 4*E8*E9*E6 + 2*E10*E2^2*E6 - E10*E2*E6*E7 + 4*E8*E2*E6),
> >
> > -E8*E9*E1^2*E4^2*E5^2 + 2*E8*E1^2*E2*E4^2*E5^2 )
> >
> > where the various E's are copied by inspection of the coefficients of
> > the three equations above after substitution of the constants.
> >
> > Once you have the roots of this P value, substitute them each in turn into:
> >
> > a = -P*E3*((-E4 - 2*E6)*P + E4*E5) /
> > ((E1*E6 - 2*E3*E4)*P - E6*E7*E1 + 2*E6*E1*E2)
> >
> > b = P
> >
> > d = (-(E1 + 4*E3)*(E1*E6*E4 + E1*E6^2 - E3*E4^2)*P^3 - E1*(3*E1*E4*E6*E2
> > - E1*E4*E5*E6 - 2*E2*E4^2*E3 - E1*E4*E6*E7 - 4*E3*E6*E4*E5 +
> > 4*E2*E6*E4*E3 + 2*E1*E6^2*E2 - 4*E6*E7*E4*E3)*P^2 - E1*(E3*E4^2*E5^2 -
> > E1*E6^2*E7^2 - 3*E1*E4*E5*E6*E2 + 2*E1*E2*E6^2*E7 + 2*E1*E2^2*E4*E6 -
> > E1*E2*E4*E6*E7 + E1*E4*E5*E6*E7 + 2*E2*E4^2*E5*E3)*P -
> > E1^2*E2*E4*E5*E6*E7 + 2*E1^2*E2^2*E4*E5*E6) /
> > (((-E4 - 2*E6)*P + E4*E5)*E1*((E1*E6 - 2*E3*E4)*P - E6*E7*E1 +
> > 2*E6*E1*E2)
> >
> > and see if you can find a root set of P that makes a, b, and d all
> > non-negative. If none of the root-sets work, then there is no hope with
> > that combination of constants. (This set of expressions was found via
> > the Maple symbolic combination engine -- I don't try to do these things
> > by hand!)
> >
> > Once you have an all-positive (a, b, d) tuple, substitute the respective
> > constants and a, b, d values into
> >
> > c = 1/2*c15 - 2*d - c16 - 2*c17 + 2*a + b
> > e = 94/25*c17
> > f = c16 + 2*c17 + c18 - 2*a - b
> > g = c14 - a - b - d
> > p = a + b - d + c15/2 + 94/25*c17 + c18
> >
> > and see if you get all-positive results. If so, you are done. If not,
> > then go back and try the next root-set of the output of the roots()
> > call. If none of the four work, then you cannot solve the problem with
> > that combination of constants.
> >
> > I do not recommend trying to solve this system via a minimizer: the
> > constants either have the right relationship for the exact solution, or
> > they do not have the right relationship and no amount of minimization
> > would fix that. The only time I might suggest a minimizer on this is if
> > the "constants" are actually intervals and you are hoping that somewhere
> > in the intervals is a solution such that all the variables are positive.
> >
> >
> > If you explore this system of equations further, you will find that in
> > general it has singularities. The singularities _tend_ to be in the
> > negative range, but with some combinations of values, the singularities
> > can occur in the positive ranges. For example, with the set of random
> > c1(:) constants I indicated before that I posted with, except with c18
> > left undetermined, I found that the graph was quite wobbly between 8.1
> > and 8.4 with multiple roots _and_ a singularity within a range of about
> > 0.102. The singularity itself, Matlab cannot isolate, because a change
> > in the last bit causes a jump from about -21 to about +7: there might
> > actually be a zero in there, if you used used much higher precision...
> > but be off by .1 and the values jump between +/- 10^64 !
>
> Thanks Mr. Walter,
>
> currently i m using fmincon command to solve this problem. I reduced the equations in to 3 set of equations (with variable a,b and 9, as u advise earlier) and that try to bound my solution with the constrains available with this function.
>
> here are some details,
>
> global c11 c12 c13 c14 c15 c16 c17 c18;
> lb=[0 0 0 ];
> ub=[10 10 20];
> x0=[0 0 0];
> H=[2 1 0
> -2 -1 2
> 1 1 1
> -1 -1 1];
> I=[(y+2*z+k)
> (0.5*x-y-2*z)
> m
> (0.5*x+3.76*z+k)];
> options= optimset('MaxIter',5000,'MaxFunEvals',40000);
> [XY,fval,exitflag,output] = fmincon('Objfcn',x0,H,I,[],[],lb,ub,'consfcn',options)
>
>
> where 'Objfcn' is,
>
> function [f]=Objfcn(x)
> global c11 c12 c13 c14 c15 c16 c17 c18;
> a=x(1);
> b=x(2);
> d=x(3);
> f=sum([c11*a*(a + b + 1/2*c15 - d + 94/25*c17 + c18) - b^2 , c12*(c16 + 2*c17 + c18 - 2*a - b)*(a + b + 1/2*c15 - d + 94/25*c17 + c18) - b*(1/2*c15 - 2*d - c16 - 2*c17 + 2*a+b),c13*(1/2*c15 - 2*d - c16 - 2*c17 + 2*a + b)^2 - d*(a + b + 1/2*c15 - d + 94/25*c17 + c18)].^2);
>
>
> and 'confscn' is,
>
> function [c,ceq] = consfcn(x)
> global c11 c12 c13 c14 c15 c16 c17 c18;
> a=x(1);
> b=x(2);
> d=x(3);
> c=[];
> ceq=[c11*a*(a + b + 1/2*c15 - d + 94/25*c17 + c18) - b^2 ; c12*(c16 + 2*c17 + c18 - 2*a - b)*(a + b + 1/2*c15 - d + 94/25*c17 + c18) - b*(1/2*c15 - 2*d - c16 - 2*c17 + 2*a+b);c13*(1/2*c15 - 2*d - c16 - 2*c17 + 2*a + b)^2 - d*(a + b + 1/2*c15 - d + 94/25*c17 + c18)];
>
>
> kindly do some comments. because this code gives good results only with certain values of constant. most of the time 'exit flag' gives '-2', and u know what does it mean :-)
>
> takecare



********************************************************************

where,

c14=m;c15=x;
c16=y;c17=z;c18=k

hope it makes sense !
From: Walter Roberson on
rabbahs wrote:

> Thanks Mr. Walter,
>
> currently i m using fmincon command to solve this problem. I reduced the
> equations in to 3 set of equations (with variable a,b and 9, as u advise
> earlier) and that try to bound my solution with the constrains available
> with this function.

> kindly do some comments. because this code gives good results only with
> certain values of constant. most of the time 'exit flag' gives '-2', and
> u know what does it mean :-)

It means what I said before: that I would not recommend trying to solve
the problem with a minimizer. I showed the form of the exact solution of
the problem, and if you have an exact solution, you do not need a
minimizer: you just plug in the numbers, and what comes out either meets
the constraints or it doesn't (implying that searching for a solution
would be useless.)

I could recompute the exact solution (sorry, I deleted it yesterday...
on the other hand I might well be able to recover it from my Time
Machine backups) and email it to you in Maple format, but it was about
12 megabytes. Or I could convert it to an optimized Matlab procedure (or
at least could do so one variable at a time), but that form is even
longer and is totally incomprehensible.

The only point in using a minimizer would be if some of your constants
are not firm values and you are looking for the least change in your
"constants" that would allow the problem to be solved. To take this
approach, you would have to define a penalty function that trades off
the adherence to the original value of the constants against the work
required to find a solution, and which might perhaps weight the
different "constants" differently... different "stiffnesses" for each.
From: rabbahs on
Walter Roberson <roberson(a)hushmail.com> wrote in message <hoinjr$r39$1(a)canopus.cc.umanitoba.ca>...
> rabbahs wrote:
>
> > Thanks Mr. Walter,
> >
> > currently i m using fmincon command to solve this problem. I reduced the
> > equations in to 3 set of equations (with variable a,b and 9, as u advise
> > earlier) and that try to bound my solution with the constrains available
> > with this function.
>
> > kindly do some comments. because this code gives good results only with
> > certain values of constant. most of the time 'exit flag' gives '-2', and
> > u know what does it mean :-)
>
> It means what I said before: that I would not recommend trying to solve
> the problem with a minimizer. I showed the form of the exact solution of
> the problem, and if you have an exact solution, you do not need a
> minimizer: you just plug in the numbers, and what comes out either meets
> the constraints or it doesn't (implying that searching for a solution
> would be useless.)
>
> I could recompute the exact solution (sorry, I deleted it yesterday...
> on the other hand I might well be able to recover it from my Time
> Machine backups) and email it to you in Maple format, but it was about
> 12 megabytes. Or I could convert it to an optimized Matlab procedure (or
> at least could do so one variable at a time), but that form is even
> longer and is totally incomprehensible.
>
> The only point in using a minimizer would be if some of your constants
> are not firm values and you are looking for the least change in your
> "constants" that would allow the problem to be solved. To take this
> approach, you would have to define a penalty function that trades off
> the adherence to the original value of the constants against the work
> required to find a solution, and which might perhaps weight the
> different "constants" differently... different "stiffnesses" for each.

********************************************************************

i am agree with your point that if we have exact solution to the problem then v dont have to use the minimization function.
If u recover the solution then kindly let me know

tc
First  |  Prev  |  Next  |  Last
Pages: 1 2 3 4
Prev: Image Rotation
Next: save 3d images with rotational view