Ask Your Question
0

How can I get solutions to this inequalities in sage?Or how I have to interpret the outcome

asked 2022-12-11 16:47:37 +0200

Keyvan gravatar image

updated 2022-12-11 21:28:43 +0200

FrédéricC gravatar image

These inequalities

a,a_1,a_2,b,b_1,b_2=var('a,a_1,a_2,b,b_1,b_2')
solve([b_2<a_2,a<b,0<a<a_1<a_2,0<b<b_1<b_2,a_1^2+b_1^2-2*a_1*b_1+(a_2-b_2)*(a-b)<0],a,a_1,a_2,b,b_1,b_2,solution_dict=True)
edit retag flag offensive close merge delete

Comments

This is the outcome: [{0: b, a: b, b_2: a_2, -a_1^2 - aa_2 + a_2b + 2a_1b_1 - b_1^2 + ab_2 - bb_2: 0}]

Keyvan gravatar imageKeyvan ( 2022-12-11 16:49:04 +0200 )edit

1 Answer

Sort by » oldest newest most voted
0

answered 2022-12-13 12:10:53 +0200

Juanjo gravatar image

updated 2022-12-13 12:17:27 +0200

Just compare the solutions returned with solution_dict=True and solution_dict=False (which is the default):

sage: solve([b_2<a_2,a<b,0<a<a_1<a_2,0<b<b_1<b_2,a_1^2+b_1^2-2*a_1*b_1
....: +(a_2-b_2)*(a-b)<0],a,a_1,a_2,b,b_1,b_2,solution_dict=True)
[{0: b,
  a: b,
  b_2: a_2,
  -a_1^2 - a*a_2 + a_2*b + 2*a_1*b_1 - b_1^2 + a*b_2 - b*b_2: 0}]
sage: solve([b_2<a_2,a<b,0<a<a_1<a_2,0<b<b_1<b_2,a_1^2+b_1^2-2*a_1*b_1
....: +(a_2-b_2)*(a-b)<0],a,a_1,a_2,b,b_1,b_2,solution_dict=False)
[[0 < a, a < b, b_2 < a_2, 0 < b, -a_1^2 - a*a_2 + a_2*b + 2*a_1*b_1 - b_1^2 + a*b_2 - b*b_2 > 0]]

Hence, the : between keys and values means < in the first three elements of the dictionary and > in the last one. By the way, I think that your inequalities can be compressed to $$\begin{gather} 0\lt a\lt a_1\lt a_2 \\ a\lt b\lt b_1\lt b_2\lt a_2 \\ (a_1-b_1)^2\lt (b-a)(b_2-a_2) \end{gather}$$

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2022-12-11 16:47:37 +0200

Seen: 96 times

Last updated: Dec 13 '22