1 | initial version |
The value 8
is not a solution, but there is a solution
whose approximate solution is 8.2510146...
Here are some ways to work on solving this equation.
Define t
as a symbolic variable in the symbolic ring,
and call eq
the equation.
sage: t = SR.var('t')
sage: eq = 0.111*t == 1-exp(-0.3*t)
Try to solve with solve
: unfortunately, Sage returns an
equation which is equivalent to the equation we started with.
sage: solve(eq, t)
[t == 1000/111*(e^(3/10*t) - 1)*e^(-3/10*t)]
Use find_root
to find an approximate solution between 5 and 10.
sage: eq.find_root(5, 10)
8.251014632362164
or
sage: find_root(eq, 5, 10)
8.251014632362164
The computation above is done using floating-point computations and it is not clear which digits are exact.
For a computation using arbitrary precision, use the mpmath
library:
define a function equal to the difference of the left-hand side and
the right-hand side of eq
and use mpmath.findroot
to look for a
root near 8:
sage: import mpmath
sage: mpmath.findroot(lambda t: 1 - exp(-0.3*t) - 0.111*t, 8)
mpf('8.2510146323620207')
See the answer by @Emmanuel Charpentier for how to use SymPy to get an exact solution in symbolic form. It is likely Giac or FriCAS could do it too.