Saalehorizontale

MaplePrimes Activity


These are questions asked by Saalehorizontale

Hey guys, 

 

I try to solve big systems of polynomial equations and inequalities. Therefore I use the command SemiAlgebraic. In the moment I take those result and want to go on calculating with them. Sadly it turns out, that solve has some problems with RootOf expressions. It doesnt find a solution (althoug the graph shows that there is one) and gives the warning solution may have been lost. So now I though I might just aks SemiAlgebraic to give me solutions without RootOf expressions. For example you can write {x = RootOf(_Z^2 - y)+1, 1 < y, y < 2} as {x=t+1, y=t^2,1<t<2^0.5 . This might be easier to work with for solve. 

So my question is: Is there any way I can tell SemiAlgebraic precisely in what form the solution should be? 
Since the websites are down Im not able to do a first own research on this problem. So thank you in advance. 

Regards

Felix

Hey guys, 

From a former calculation I got a set of points as a implicit RootOf function for an intervall. Now I want to check, if these points are in a certain area. So i thougt I take the RootOf function, the intervall and the inequalities (which describe the target area) and use the solve command. But then I get the warning, solutions may have been lost and no solution. When you draw the implicit function you can see thats in the right area (above y=1 and below y=x). So there should be a clear anwer, giving me back the whole RootOf function in the intervall.

Download QUESTI~2.MW

Since there was an error uploading the picture here the code 

restart;
Sol := {x = RootOf(_Z^2 - y, index = real[2]) + 1, 1 < y, y < 2};
area := {1 < y, y < x};
Sol_area := solve(Sol union area);
print(Sol_area);

So why do I get this warning, the calculation seems quite easy? And is there a workaround? Or a diffrent kind of solve function? SemiAlgebraic is as far as i know only for polynomials. So I got an error as well. Since the websites are down I could start an own reasearch before. So thank you in advance. 

Regards

Felix

Hey guys, 

I have a problem with the solve command. And since the websites are down, I cant help myself. I have a function x(y) and an intervall for y. This function or the set of points described by the function should now be transformed to another area of the plane. So now I can get a(x,y)=1/y and b(x,y)=x/(x+y-1) with just plugging in, then everything depeends from the y Invtervall. But I want to get the form b(a) and an intervall for a. So that I can see the function directly. So i thought I just put everything into the solve command and than ask for a solution for {a,b} and expected to get what I want. (Uploading the script here gives an error)
 

restart;
Sol := solve({a = 1/y, b = x/(x + y - 1), x = (y - 1)^2, 1 < y, y < 5/4});
Sol_ab := solve({a = 1/y, b = x/(x + y - 1), x = (y - 1)^2, 1 < y, y < 5/4}, {a, b});

#expected (or wanted) solution
#with y = 1/a and the inequalities we get 4/5 < a and a < 1 with y
#with y = we get x(a)/a and y(a) and reach b = 1/a - 1
#all together: Sol={b=1/a - 1, 4/4<a, a<1};

THe problem is, that I get an empty set which is obviously wrong. So I somehow make an error when making the variables I want concrete with adding {a,b}. What do I do wrong? Or is there a better command for what I want to achieve? In this case I can solve the problem via hand, but I have more complex tranformations and mor ecomplex functions x(y), so thats why I ask for general help with my problem. 

Thank ypu in advance

Felix

Download QUESTI~1.MW

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

Hey guys,

I have to solve a bunch of systems of polynomial equations und dome restrictions given by inequalitites. I have 8 variables, 8 equations and and 13 inequalitites. Since the simple solve or SemiAlgebraic command are not able to solve every system I tryd some other ways. Right now I try to bring the set of equations and ineqaulities in a better from or structure using RealTriangulize from the RegularChains library. Later on I want to take those results and use solve or SemiAlgebraic again, hoping, that Maple than finds the solutions and is not calculating for houres without a result. I already know, that you can have diffrent outputs for RealTriangularize (I know list, record, piecewise and zerodimensional, althought the last one is not really helpful). Since I want to go on wirking with the results I need to have them in a form, that I can read of the new equations and inequalities to put them into solve. Often that works totaly fine, but sometimes I get an output I dont understand. I understand what It means but I dont understand why Maple uses that type of output. If you have a look in the attached file you can see what I mean:

restart; with(RegularChains); eq_5334 := {y*(m*x-m-n+1)+(-x+1)*n-x = 0, (-p+t)*k+p*y-t = 0, (k-x-y)*t-k*p+y = 0, (-x-y+1)*t+(-k+y)*n+x*s = 0, (-x-y+1)*p+m*y^2+x-y = 0, (x^2-x)*m+y*(t-1)-n+1 = 0, -k*n+s*x = 0, m*x*y-p = 0, 0 < k, 0 < m, 0 < s, 0 < x, 0 < y, 0 < n+(t-1)*p, 0 < (m*y-1)*n+(1-p)*(m*x-m+1), 0 < (m*x-m-t+1)*p+m*y*(t-n), 1 < x+y, k < 1, m < 1, s < t, t < 1}; eq_5380 := {(-x-y+1)*p+m*x*y = 0, (-p+t)*k+p*y-t = 0, (k-x-y)*t-k*p+y = 0, (-x-y+1)*t+(-k+y)*n+x*s = 0, (m-1)*y^2+(-x+1)*y-p+x = 0, (x-1)*(m-1)*y-x^2-n+x = 0, m*x^2+(-m-n+1)*x+(-y+1)*n+t*y-1 = 0, -k*n+s*x = 0, 0 < k, 0 < m, 0 < s, 0 < x, 0 < y, 0 < n+(t-1)*p, 0 < (m*y-1)*n+(1-p)*(m*x-m+1), 0 < (m*x-m-t+1)*p+m*y*(t-n), 1 < x+y, k < 1, m < 1, s < t, t < 1}; eq_5382 := {(-x-y+1)*p+m*x*y = 0, y*(m*x-m-n+1)+(-x+1)*n-x = 0, (-p+t)*k+p*y-t = 0, (k-x-y)*t-k*p+y = 0, (-x-y+1)*t+(-k+y)*n+x*s = 0, (-x-y+1)*p+m*y^2+x-y = 0, m*x^2+(-m-n+1)*x+(-y+1)*n+t*y-1 = 0, -k*n+s*x = 0, 0 < k, 0 < m, 0 < s, 0 < x, 0 < y, 0 < n+(t-1)*p, 0 < (m*y-1)*n+(1-p)*(m*x-m+1), 0 < (m*x-m-t+1)*p+m*y*(t-n), 1 < x+y, k < 1, m < 1, s < t, t < 1}; sys := eq_5334; SuggestVariableOrder(sys); R := PolynomialRing(%); dec_5334 := RealTriangularize(sys, R, output = piecewise); sys := eq_5380; SuggestVariableOrder(sys); R := PolynomialRing(%); dec_5380 := RealTriangularize(sys, R, output = piecewise); sys := eq_5382; SuggestVariableOrder(sys); R := PolynomialRing(%); dec_5382 := RealTriangularize(sys, R, output = piecewise); sys := eq_5382; SuggestVariableOrder(sys); R := PolynomialRing(%); dec_5382_record := RealTriangularize(sys, R, output = record)

[AlgebraicGeometryTools, ChainTools, ConstructibleSetTools, Display, DisplayPolynomialRing, Equations, ExtendedRegularGcd, FastArithmeticTools, Inequations, Info, Initial, Intersect, Inverse, IsRegular, LazyRealTriangularize, MainDegree, MainVariable, MatrixCombine, MatrixTools, NormalForm, ParametricSystemTools, PolynomialRing, Rank, RealTriangularize, RegularGcd, RegularizeInitial, SamplePoints, SemiAlgebraicSetTools, Separant, SparsePseudoRemainder, SuggestVariableOrder, Tail, Triangularize]

 

[s, k, n, p, m, t, x, y]

 

R := polynomial_ring

 

dec_5334 := [[x*s+((-x^2+x)*m-t*y+y-1)*k = 0, (m*x*y-t)*k+(x+y)*t-y = 0, n+(-x^2+x)*m-t*y+y-1 = 0, -m*x*y+p = 0, (x^2*y+(y^2-y)*x-y^2)*m-x+y = 0, t*y^2-y^2+x = 0, (15*y^2+24*y+20)*x-6*y^2-13*y-10 = 0, y^3-y-2 = 0, 0 < k, 0 < m, 0 < s, 0 < x, 0 < y, 0 < 12891634966*y^2+19613071879*y+16947294542, 0 < 1256597*y^2+1911761*y+1651926, 0 < 6310892468*y^2+9601263717*y+8296275330, 0 < 1401*y^2+2130*y+1840, 0 < 1-k, 0 < 1-m, 0 < 72927541996846438*y^2+110950482461140595*y+95870270479707846, 0 < 1-t]]

 

[s, k, n, p, m, t, y, x]

 

R := polynomial_ring

 

dec_5380 := piecewise(`and`(`and`(`and`(0 < x^3-2*x^2+3*x-1, 0 < x^3+2*x^2+x-1), x^3+x^2+x < 1), 0 < 3*x-1), [[s*x+((1-x)*y*m+(x-1)*y+x^2-x)*k = 0, (m*y^2-y^2-t+(1-x)*y+x)*k+(y+x)*t-y = 0, n+(1-x)*y*m+(x-1)*y+x^2-x = 0, p-m*y^2+y^2+(x-1)*y-x = 0, m*y-x-y+1 = 0, t*y^2+(x-1)*y^2+(2*x^2-2*x)*y+x^3-2*x^2+x = 0, (3*x-1)*y^2+(3*x^2-3*x)*y+x^3-2*x^2+x = 0, 0 < k, 0 < m, 0 < s, 0 < y, 0 < -6*x^6-9*x^5*y+20*x^5+27*x^4*y-27*x^4-32*x^3*y+19*x^3+17*x^2*y-7*x^2-3*x*y+x, 0 < 3*x^6+3*x^5*y-14*x^5-10*x^4*y+26*x^4+11*x^3*y-24*x^3-3*x^2*y+11*x^2-2*x*y-2*x+y, 0 < 6*x^5+9*x^4*y-17*x^4-18*x^3*y+17*x^3+11*x^2*y-7*x^2-2*x*y+x, 0 < y+x-1, 0 < 1-k, 0 < -m+1, 0 < t-s, 0 < 1-t]], [])

 

[s, k, n, p, m, t, x, y]

 

R := polynomial_ring

 

dec_5382 := piecewise(`and`(`and`(y^3-2*y^2+y < 1, 0 < y-1), 23*y^3-37*y^2+13*y-3 <> 0), [[-k*n+s*x = 0, (p-t)*k+(y+x)*t-y = 0, (y+x-1)*n+(-x*y+y)*m+x-y = 0, (y+x-1)*p-m*y^2-x+y = 0, m*y-1 = 0, t*y^2+x^2+(y-1)*x-y^2 = 0, x^3+(3*y-2)*x^2+(2*y^2-3*y+1)*x-y^3+y^2 = 0, 0 < k, 0 < s, 0 < x, 0 < -2*x^2*y^2-2*x*y^3+2*y^4+x^2*y+3*x*y^2-3*y^3-x*y+y^2, 0 < x^2*y^2+2*x*y^3+y^4-x^2*y-4*x*y^2-3*y^3+2*x*y+3*y^2-y, 0 < -x^2*y-x*y^2+y^3+x*y-y^2, 0 < y+x-1, 0 < 1-k, 0 < t-s, 0 < 1-t]], 23*y^3-37*y^2+13*y-3 = 0, [[-k*n+s*x = 0, (p-t)*k+(y+x)*t-y = 0, (y+x-1)*n+(-x*y+y)*m+x-y = 0, (y+x-1)*p-m*y^2-x+y = 0, m*y-1 = 0, t*y^2+x^2+(y-1)*x-y^2 = 0, (2377326*y^2-1587000*y+302588)*x^2+(390793*y^2+497766*y+138115)*x-507805*y^2+152032*y-109047 = 0, 23*y^3-37*y^2+13*y-3 = 0, 0 < k, 0 < m, 0 < s, 0 < x, 0 < y, 0 < 700112222844255556263586865*x*y^2-260269572171898884295316974*x*y-93795749047261033657544191*y^2+73822886321394794237709987*x+34866975665513154551125606*y-9877974587657378842117575, 0 < -26166721441919*x*y^2+9412709182291*x*y+53422638514257*y^2-3387596446782*x-21180373503698*y+6484087812711, 0 < 21236600258115*x*y^2-8079468597142*x*y-3053799376681*y^2+2340822678357*x+1387037467490*y-370794765921, 0 < y+x-1, 0 < 1-k, 0 < -m+1, 0 < t-s, 0 < 1-t]], [])

 

[s, k, n, p, m, t, x, y]

 

R := polynomial_ring

 

`Non-fatal error while reading data from kernel.`

(1)

NULL

I would like to get results like in dec_5334. I can easily go on working with this kind of form. In dec_5380 you can see a diffrent output. I dont see the point of giving me this output. the second line i basically epmty. and in the first line the solution is broken into peaces. when a certain solution just works under some inequalitites, why dont they put those four inequalities inside of the list in front of it? Is there a workaround for the "normal" output? Or is there a way to read off the lines from this kind of structure, with the open { in front ?

The same problem appears in dec_5382. WHy dont give me a list with to lists of equations and inequalities to show me both solutions?
In the last example dec_5382_record you can see the output when you change the corresponding option in RealTrinagularize. But here I again have the problem that I dont know how to read of the equations and inequalities from the open curly bracket.

If anyone could help me, I would be very glad. Thank yu in advance.

Regards

Felix

Download Output_of_RegularChains.mw

1 2 Page 1 of 2