Group Abstract Group Abstract

Message Boards Message Boards

0
|
3.7K Views
|
8 Replies
|
1 Total Like
View groups...
Share
Share this post:

Solve Inequalities

Posted 11 years ago

Dear Experts, I'm trying to solve the inequality:

fun2 = Compile[{x, y, a, b, c, d}, (2/3 a + 4/3 b x) (1 - y^2) + (1 - a) (2 c x^2 (1 - y^2)
 + 1/2 (1 - c) (1 - x^2) (1 + y^2) + 4/3 d (1 - x^2) y)]

Reduce[ForAll[{x, y}, -1 < x < 1 && -1 < y < 1 && 0 < a < 1 && -1 < b < 1 && 0 < c < 1 &&
 -3/4 (1 - c) < d < 3/4 (1 - c), fun2[x, y, a, b, c, d] > 0] && 0 < a < 1 && -1 < b < 1 && 0 < c < 1 &&
 -3/4 (1 - c) < d < 3/4 (1 - c), {a, b}, Reals]

Basically I would like to find the conditions on a and b that allow the expression to be always positive for every x and y (within their range, meaning -1 < x < 1 && -1 < y < 1)

(a) I'm not sure whether the Mathematica code that I wrote will do the job

(b) When I run this code it never ends, it's like it goes in an infinite loop

So my question is: is the Mathematica code correct ? If it is, is there a way to speed up the computation ?

Many thanks for your support.

  • Mauro.
POSTED BY: Mauro Dinardo
8 Replies

As I remember, the time taken by Reduce is double exponential in the complexity of the problem.

POSTED BY: Frank Kampas
Posted 11 years ago
POSTED BY: Mauro Dinardo
POSTED BY: Frank Kampas
Posted 11 years ago
POSTED BY: Mauro Dinardo
POSTED BY: Frank Kampas
In[33]:= Reduce[
 ForAll[{x, y}, -1 < x < 1 && -1 < y < 1 && 0 < a < 1 && -1 < b < 1 &&
     0 < c < 1 && -3/4 (1 - c) < d < 3/4 (1 - c), expr > 0] && 
  0 < a < 1 && -1 < b < 1 && 
  0 < c < 1 && -3/4 (1 - c) < d < 3/4 (1 - c), {a, b, c, d, 
  expr}, Reals]

Out[33]= 0 < a < 1 && -1 < b < 1 && 0 < c < 1 && 
 1/4 (-3 + 3 c) < d < 1/4 (3 - 3 c) && expr > 0
POSTED BY: Frank Kampas

Rather than putting a compiled function inside Reduce, put the

expr ==  (2/3 a + 4/3 b x) (1 - y^2) + (1 - a) (2 c x^2 (1 - y^2) +
 1/2 (1 - c) (1 - x^2) (1 + y^2) + 4/3 d (1 - x^2) y)

in and add expr to the list of variables.

POSTED BY: Frank Kampas
Posted 11 years ago

Dear Frank, many thanks for your reply. Since I'm relatively new in using Mathematica, can you please explain more explicitly how shall I write the code?

I understood that is something like:

expr == (2/3 a + 4/3 b x) (1 - y^2) + (1 - a) (2 c x^2 (1 - y^2)
 + 1/2 (1 - c) (1 - x^2) (1 + y^2) + 4/3 d (1 - x^2) y)

Reduce[ForAll[{x, y}, -1 < x < 1 && -1 < y < 1 && 0 < a < 1 && -1 < b < 1 
&& 0 < c < 1 && -3/4 (1 - c) < d < 3/4 (1 - c), expr > 0] && 0 < a < 1 && -1 < b < 1 
&& 0 < c < 1 && -3/4 (1 - c) < d < 3/4 (1 - c), {a, b, expr2}, Reals]

Many thanks, - Mauro.

POSTED BY: Mauro Dinardo
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard