Ask Your Question
0

Solving non linear system of equations

asked 2014-01-04 00:19:38 -0500

Zardoz777 gravatar image

updated 2014-01-04 07:06:54 -0500

Shashank gravatar image

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 flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
1

answered 2014-01-04 08:14:42 -0500

calc314 gravatar image

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.

edit flag offensive delete link more

Comments

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.

tmonteil gravatar imagetmonteil ( 2014-01-07 05:44:03 -0500 )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: 2014-01-04 00:19:38 -0500

Seen: 211 times

Last updated: Jan 04 '14