From: Walter Roberson on
ehsan wrote:

> My problem is a set of inequalities like:
>
> (A+xi)/(B-yi) > (C+xi)/(D+yi) , xi^2+yi^2=E , xi > xi+1 , yi <
> yi+1 ; i=1:n

> I tried to use maple -> solve function but it didn't work:
>
>>> maple( 'solve({((A+e1)/(B-ep1))<((C+2*ep2)/(D+2*e2)),
>>> ((C+2*ep2)/(D+2*e2))< ((A+2*e2)/(B-2*ep2)), e1<e2, ep1>ep2 })' )
> Warning: Warning, solutions may have been lost

> (perhaps my problem had no answer)

Which of your symbols are variables and which are constants? Maple's
solve often doesn't do well if you do not tell it which variables to
solve for.
From: ehsan on
in this case they are all variables, but in general how should I tell which one is variable?
From: Walter Roberson on
ehsan wrote:
> in this case they are all variables, but in general how should I tell
> which one is variable?

You have to know something about the problem domain in order to know
which are to be considered variables and which are to be considered
constants.
From: Walter Roberson on
ehsan wrote:

>
> My problem is a set of inequalities like:
>
> (A+xi)/(B-yi) > (C+xi)/(D+yi) , xi^2+yi^2=E , xi > xi+1 , yi <
> yi+1 ; i=1:n

> I tried to use maple -> solve function but it didn't work:
>
>>> maple( 'solve({((A+e1)/(B-ep1))<((C+2*ep2)/(D+2*e2)),
>>> ((C+2*ep2)/(D+2*e2))< ((A+2*e2)/(B-2*ep2)), e1<e2, ep1>ep2 })' )
> Warning: Warning, solutions may have been lost

Maple isn't very good at inequalities. If you transform the equations
into equalities then it can solve it. For example, instead of X<Y, use
X-Y=T and exclude T from the list of variables to solve for.

Using Maple notation,

solve([(A+e1)/(B-ep1)-(C+2*ep2)/(D+2*e2) = T1,
(C+2*ep2)/(D+2*e2)-(A+2*e2)/(B-2*ep2) = T2,
-e2+e1 = T3,
ep1-ep2-T4], [A,B,C,D,e1,e2,ep1,ep2]);


[[A = (B*e2 - B*T3 + T1*B^2 + T2*B^2 + 2*ep2*T3 + 2*T2*ep2^2 +
2*T1*ep2^2 - 2*e2*T4 - 3*B*T2*ep2 - 3*B*T1*ep2 - B*T1*T4 + 2*ep2*T1*T4 -
T2*B*T4 + 2*T2*ep2*T4)/(-ep2+T4),
B = B,
C = (e2*D + 2*e2^2 + 2*ep2^2 - D*T3 - 2*e2*T3 - 2*ep2*T4 + T1*B*D +
2*T1*B*e2 + T2*B*D + 2*T2*B*e2 - 2*T2*ep2*D - 4*T2*ep2*e2 - T1*D*ep2 -
T1*D*T4 - 2*T1*e2*ep2 - 2*T1*e2*T4) / (-ep2+T4),
D = D,
e1 = e2+T3,
e2 = e2,
ep1 = ep2+T4,
ep2 = ep2],

[A = (-C*B - 2*T4*B + 4*T3^2 + 4*B^2*T1^2 + 2*B^2*T2^2 + 8*T2^2*T4^2 +
16*T4^2*T1^2 + 2*D*T3 + 2*C*T4 - 2*T1*B*D - T2*B*D - 8*T3*B*T1 -
6*T3*B*T2 + 12*T3*T2*T4 + 16*T3*T4*T1 + 6*B^2*T1*T2 - 16*B*T1^2*T4 -
8*B*T2^2*T4 + 24*T2*T4^2*T1 + 4*T1*D*T4 - 24*B*T1*T2*T4 + 4*T4^2 +
2*T2*T4*D) / (-D - 2*T3 + 2*B*T1 + 2*B*T2 - 4*T2*T4 - 4*T4*T1),
B = B,
C = C,
D = D,
e1 = 2*T3 - B*T1 - B*T2 + 2*T2*T4 + 2*T4*T1,
e2 = T3 - B*T1 - B*T2 + 2*T2*T4 + 2*T4*T1,
ep1 = 2*T4,
ep2 = T4]]

Here T1, T2, T3, T4 are arbitrary positive differences. As there are no
square roots, T1 through T4 can be set to arbitrary numbers provided
that all of the denominators remain non-zero (e.g., T4 ~= ep2 in the
first set of solutions.)
From: John D'Errico on
"ehsan " <ehsan.safavieh(a)gmail.com> wrote in message <hu5gl4$9gq$1(a)fred.mathworks.com>...
> "ehsan " <ehsan.safavieh(a)gmail.com> wrote in message <hu05ed$k2l$1(a)fred.mathworks.com>...
> > Hi,
> >
> > I have a system of inequality consisting of a lot of inequalities. How can I find if it has any answer or not, or possibly find a solution for it?
> >
> > thanks
>
> Thank you guys,
>
> My problem is a set of inequalities like:
>
> (A+xi)/(B-yi) > (C+xi)/(D+yi) , xi^2+yi^2=E , xi > xi+1 , yi < yi+1 ; i=1:n
>
> The problem with fmincon, lsqlin, ... is that they try to minimize a FUNCTION regarding some equalities and inequalities, but I don't have any function to minimize. I just want a feasible solution or interval for the variables.
>

Sigh.

So is it really that difficult to come up with a function
to minimize? All you need is A (ANY) feasible solution.

So pick the function to minimize as the sum of your
parameters, SUBJECT to the constraints you have chosen.

Fmincon will find a solution, out of the infinitely many
solutions.

John
First  |  Prev  |  Next  |  Last
Pages: 1 2 3
Prev: Filtering a signal
Next: Simultanous move games in Matlab