Ask Your Question
0

solve exponential

asked 2016-02-15 04:12:08 -0500

mare gravatar image

updated 2016-02-16 17:13:49 -0500

tmonteil gravatar image

I've just started to experiment with Sage, so I might be missing something simple here. What I'm trying to do is to solve the following equation:

var('t','k1','k2','y1','y2')
assume(k1>0,k2>0,y1>0,y2>0)
assume(k1,'real')
assume(k2,'real')
assume(y1,'real')
assume(y2,'real')
assume(t,'real')
solve(y1*exp(-t/k1)/k1 - y2*exp(-t/k2)/k2==0,t)

The result is[e^(t/k2) == k1*y2*e^(t/k1)/(k2*y1)], and not fully solved for some reason. I was expecting something like

t==ln(y2*k1/y1*k2)/(1/k2-1/k1)
edit retag flag offensive close merge delete

Comments

Thanks for reporting ! I added a confirmed_bug tag to track such issues.

tmonteil gravatar imagetmonteil ( 2016-02-16 17:14:14 -0500 )edit

Ah! I didn't know about this tag. Good.

kcrisman gravatar imagekcrisman ( 2016-02-17 12:11:19 -0500 )edit

1 answer

Sort by » oldest newest most voted
1

answered 2016-02-16 03:29:33 -0500

ndomes gravatar image

sympy.solvers.solve gives a solution similar to what you expected:

from sympy import solvers, Symbol
y1 = Symbol('y1')
y2 = Symbol('y2')
t = Symbol('t')
k1 = Symbol('k1')
k2 = Symbol('k2')
sol = solvers.solve(y1*exp(-t/k1)/k1 - y2*exp(-t/k2)/k2,t)
show(sol[0]._sage_())
edit flag offensive delete link more

Comments

Yep, that's it, thanks!

mare gravatar imagemare ( 2016-02-17 04:29:16 -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: 2016-02-15 04:12:08 -0500

Seen: 243 times

Last updated: Feb 16 '16