Question: Why does Maple not understand the interval [1,1] as {1} and is there a workaround?

Hey guys, 

I am solving many systems of polynomial equations. Sometimes I get the same solution, just in a diffrent are, so for example the first solution is for y between 0 and 1 and the second solution is for y between 1 and 2. So now I want to take those solutions intervals and combine them so I can make one solution out of two. However I am struggeling with working with intervals in Maple. It is not that easy how I expected it to be.

I wrote an own program which works quite nice unless there is a single solution which would meen an interval like [1,1] meaning y=1working_with_intervals.mw

restart; sets := [{1 < y}, {y <= 1/2, 0 < y}, {1/2 < y, y < 1}]; intervals := [RealRange(Open(1), Open(infinity)), RealRange(Open(0), 1/2), RealRange(Open(1/2), Open(1))]; correct_form := [y::(RealRange(Open(1), Open(infinity))), y::(RealRange(Open(0), 1/2)), y::(RealRange(Open(1/2), Open(1)))]; Sol := solve(`~`[convert](Or(op(correct_form)), relation))

[{1 < y}, {y <= 1/2, 0 < y}, {1/2 < y, y < 1}]

 

[RealRange(Open(1), infinity), RealRange(Open(0), 1/2), RealRange(Open(1/2), Open(1))]

 

[y::(RealRange(Open(1), infinity)), y::(RealRange(Open(0), 1/2)), y::(RealRange(Open(1/2), Open(1)))]

 

RealRange(Open(0), Open(1)), RealRange(Open(1), infinity)

(1)

restart; sets := [{1}, {1 < y}, {y <= 1/2, 0 < y}, {1/2 < y, y < 1}]; intervals := [[1, 1], RealRange(Open(1), Open(infinity)), RealRange(Open(0), 1/2), RealRange(Open(1/2), Open(1))]; correct_form := [y::[1, 1], y::(RealRange(Open(1), Open(infinity))), y::(RealRange(Open(0), 1/2)), y::(RealRange(Open(1/2), Open(1)))]; Sol := solve(`~`[convert](Or(op(correct_form)), relation))

[{1}, {1 < y}, {y <= 1/2, 0 < y}, {1/2 < y, y < 1}]

 

[[1, 1], RealRange(Open(1), infinity), RealRange(Open(0), 1/2), RealRange(Open(1/2), Open(1))]

 

[y::[1, 1], y::(RealRange(Open(1), infinity)), y::(RealRange(Open(0), 1/2)), y::(RealRange(Open(1/2), Open(1)))]

 

RealRange(Open(0), Open(1)), RealRange(Open(1), infinity)

(2)
 

NULL

Download working_with_intervals.mw

In the attached file you can see my problem. When I add the intervall [1,1] the solution should become (0,infty), but it seems like Maple does not understand what I mean by [1,1], so the 1 is not part of the solution "Sol".

FYI: I wrote a program which is able to convert "sets" into "intervals" into "correct_form" using RealRange, but it is not necesarry for my problem. 

So my questions are: Why doesnt Maple recognize [1,1] as an interval containing only the 1? Is there a way I can rewrite the intervall so I can use it for the solve process in "Sol"? I also thought about making two diffrent sets with the same intervals than adding [1,2) to the one set and (1,2) to the other set and than make an intersection but I seems to be very complicated for a seemingly easy problem. Is there a easier way to work with intervals? 

Regards and thank you

Felix

Please Wait...