# Solving non linear system of equations

Why this is not working in sage?

f=-V+exp(V)-w-1;
g=0.5*V-w;
sol=solve([f==0,g==0],V,w,solution_dict=True)


It does not return numerical solutions when there are two.

Thanks

edit retag close merge delete

Sort by ยป oldest newest most voted

The solve command looks for an analytic solution. In this case, the solution will involve the Lambert W function, lambert_w. For some reason, though, Sage is not finding it. (You need to use to_poly_solve=True in the solve command, but Sage is encountering an error.)

To find approximations of the solutions, you can use find_root.

For example,

find_root(-V+exp(V)-0.5*V-1,-1,0.5)


and

find_root(-V+exp(V)-0.5*V-1,0.5,1)


give the two roots.

more

Yep. Though in this case it is straightforward to reduce the system into a 1-dimensional equation, it coud be very nice to have find_root work with more variables. Also, i do not get an error with to_poly_solve=True, just a useless result.

( 2014-01-07 12:44:03 +0200 )edit