Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

phcpy2 verbose=False skip solve #47

Open
IsayamaYoomi opened this issue May 24, 2021 · 3 comments
Open

phcpy2 verbose=False skip solve #47

IsayamaYoomi opened this issue May 24, 2021 · 3 comments

Comments

@IsayamaYoomi
Copy link

When I set verbose=False in solve(), somehow it would not solve the polynomial system. I have a 3 by 3 system which I called fC with degree more than 100. I am using the python interface on my mac machine. My code looks like
sC = solve(fC, verbose=False)
if len(sC)==0:
print "no solution found'
If I remove verbose=False then I would not get the prineted message. I looked into the phcpy2.solver file and tried to replace the silence by False under the standard_solve function but I still got printed message occasionally. Could you please give me some suggestions?

Thanks in advance!

@janverschelde
Copy link
Owner

Could it be possible to provide the input of your problem?

@IsayamaYoomi
Copy link
Author

Sure. For my problem I need to loop through all wavenumber k, and fP is the polynomial system evaluated at k-1, while fC is the system evaluated at k. The polynomial system is
x^3*(y+z^2+s1*(1+y+0.5z^2))(z+y^2+s2*(1+z+0.5y^2))-(3x^2-3x+1)*(-z+s1)(-y+s1)(1-z)(1-y)=0
2x^2(y^2-(kh)^2)-(3x^2-4x+1)*c=0
2x^2(z^2-(kh)^2)-(3x^2-4x+1)*c=0
and the code is like
fP =['','','']
fC =['','','']
for k in range(0,kmax):
fP[0] = 'x**3*(1*y + z**2 + ('+str(s1)+')*(1+1*y+0.5*z**2))*(1*z + y**2 + (' +str(s2)+ ')*(1+1*z+0.5*y**2)) - (3*x**2-3*x+1)*(-z+'+str(s1)+')*(-y+'+str(s2)+')*(1-y)*(1-z);'
fP[1] = '2*x**2*(y**2-('+str((k-1)*h)+')**2) - (3*x**2-4*x+1)*'+str(c)+';'
fP[2] = '2*x**2*(z**2-('+str((k-1)*h)+')**2) - (3*x**2-4*x+1)*'+str(c)+';'
fC[0] = 'x**3*(1*y + z**2 + ('+str(s1)+')*(1+1*y+0.5*z**2))*(1*z + y**2 + (' +str(s2)+ ')*(1+1*z+0.5*y**2)) - (3*x**2-3*x+1)*(-z+'+str(s1)+')*(-y+'+str(s2)+')*(1-y)*(1-z);'
fC[1] = '-2*x**2*(y**2-('+str(k*h)+')**2) + (3*x**2-4*x+1)*'+str(c)+';'
fC[2] = '-2*x**2*(z**2-('+str(k*h)+')**2) + (3*x**2-4*x+1)*'+str(c)+';'
if k==1 or k==0 or (total_degree(fC)!=total_degree(fP)):
sC = solve(fC)
#sC = solve(fC,verbose=False)
else:
sC = track(fC,fP,sP)
sLength=len(sC)
if sLength==0:
print "no solution founud"

If solutions are found then I will proceed to check the validity of the roots.

@IsayamaYoomi
Copy link
Author

I also tried to run the regression tests. The Apollonius example did not give me any solution either. The solution set was empty, but if I turn on the verbose option then I would get desired result.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants