Ask Your Question
1

Some equations fail to solve even with to_poly_solve

asked 2012-09-03 01:02:34 +0100

heatkernel gravatar image

updated 2012-09-03 01:25:27 +0100

In the following, I would expect to obtain [z == 1/y*lambda_w(y)]:

sage: z=var('z')
sage: y=var('y')
sage: solve(log(z)+3*z==0, z, to_poly_solve=True)
[z == 1/3*lambert_w(3)]
sage: solve(log(z)+y*z==0, z, to_poly_solve=True)
[z == -log(z)/y]

But Sage doesn't want to solve the equation for z. Perhaps, in view of the fact that it solves the equation when 3 is in place of z, it doesn't realize that y is supposed to represent a real number. I tried assume(y,'real') but that command did not help.

Does anyone know a workaround?

edit retag flag offensive close merge delete

Comments

1

That's a valid observation. Maybe you (or someone) would be willing to post the issue upstream to the Maxima mailing list?

benjaminfjones gravatar imagebenjaminfjones ( 2012-09-03 01:23:03 +0100 )edit

I couldn't even reproduce the correct answers in Maxima, strangely.

kcrisman gravatar imagekcrisman ( 2012-09-04 15:37:06 +0100 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2012-09-03 03:15:54 +0100

achrzesz gravatar image

updated 2012-09-03 03:21:46 +0100

Maybe sympy can be helpful?

sage: from sympy import *            
sage: y,z=symbols('y z')             
sage: from sympy.solvers import solve
sage: solve(log(z)+y*z, z)           
[LambertW(y)/y]
edit flag offensive delete link more

Comments

thanks, that works.

heatkernel gravatar imageheatkernel ( 2012-09-04 23:53:27 +0100 )edit

Your Answer

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

Add Answer

Question Tools

Stats

Asked: 2012-09-03 01:02:34 +0100

Seen: 654 times

Last updated: Sep 03 '12