Ask Your Question
0

Bug in sage solve

asked 2016-05-21 09:09:31 +0200

proy gravatar image

Sage raises an error when I try to solve the following:

solve(a*exp(k*2) - n, a*exp(k*8)-m, a, k, solution_dict=True)

What is the reason for this?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2016-05-21 14:17:59 +0200

calc314 gravatar image

You need to define the variables using the var command. Also, the syntax for solve is slightly different.

var('a k n m')
solve([a*exp(k*2) - n==0, a*exp(k*8)-m==0], [a, k], solution_dict=True)

Unfortunately, Sage (which uses Maxima for this) does not solve the equation.

However, sympy does a nice job of solving here.

var('a k n m')
import sympy as sp
sp.solve([a*exp(k*2) - n, a*exp(k*8)-m], [a, k],dict=True)
edit flag offensive delete link more

Comments

Thank you. Just strange that Sage can't solve such simple system.

proy gravatar imageproy ( 2016-05-22 09:48:37 +0200 )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

1 follower

Stats

Asked: 2016-05-21 09:09:31 +0200

Seen: 404 times

Last updated: May 21 '16