Processing math: 100%

First time here? Check out the FAQ!

Ask Your Question
0

A Simple Exponential Equation

asked 4 years ago

Kapcak gravatar image

Sage can solve the equation 8t=37 for t:

solve( (8)^t ==37, t )

But strangely, cannot solve (89)t=37

solve( (8/9)^t ==37, t )

Any ideas?

Preview: (hide)

1 Answer

Sort by » oldest newest most voted
0

answered 4 years ago

Emmanuel Charpentier gravatar image

Two workarounds :

sage: ((8/9)^t==37).log().log_expand().solve(t)
[t == -log(37)/(2*log(3) - 3*log(2))]
sage: solve((8/9)^t==37, t, algorithm="sympy")
[t == -log(37)/(2*log(3) - 3*log(2))]

Curiously :

sage: solve((8/9)^t==37, t, to_poly_solve="force")
[]

Worse :

sage: solve((8/9)^t==37,t, to_poly_solve=True)
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-26-811d238787f4> in <module>
----> 1 solve((Integer(8)/Integer(9))**t==Integer(37),t, to_poly_solve=True)

/usr/local/sage-9/local/lib/python3.9/site-packages/sage/symbolic/relation.py in solve(f, *args, **kwds)
   1041 
   1042     if is_Expression(f): # f is a single expression
-> 1043         return _solve_expression(f, x, explicit_solutions, multiplicities, to_poly_solve, solution_dict, algorithm, domain)
   1044 
   1045     if not isinstance(f, (list, tuple)):

/usr/local/sage-9/local/lib/python3.9/site-packages/sage/symbolic/relation.py in _solve_expression(f, x, explicit_solutions, multiplicities, to_poly_solve, solution_dict, algorithm, domain)
   1340                 s = m.to_poly_solve(x, options='algexact:true')
   1341                 T = string_to_list_of_solutions(repr(s))
-> 1342                 X.extend([t[0] for t in T])
   1343             except TypeError as mess:
   1344                 if ignore_exceptions:

/usr/local/sage-9/local/lib/python3.9/site-packages/sage/symbolic/relation.py in <listcomp>(.0)
   1340                 s = m.to_poly_solve(x, options='algexact:true')
   1341                 T = string_to_list_of_solutions(repr(s))
-> 1342                 X.extend([t[0] for t in T])
   1343             except TypeError as mess:
   1344                 if ignore_exceptions:

TypeError: 'sage.symbolic.expression.Expression' object is not subscriptable

This might be a bug...

HTH,

Preview: (hide)
link

Comments

It seems so. Thanks for the reply.

Kapcak gravatar imageKapcak ( 4 years ago )

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: 4 years ago

Seen: 415 times

Last updated: Dec 23 '20