solve() does not solve

The output of this system is [] after waiting 10 mins. What's the problem here?

var('a2,b2')
solve([
log(10,a2) + log(10,b2) * 435 == 50.88,
log(10,a2) * 435 + log(10,b2) * 8555 == 979.15], a2,b2)

edit retag close merge delete

1

Hello, @Alex89! One question: Are you trying to determine the base for the logarithm? Remember that log(10,a2) means "the logarithm of 10 in base a2", i.e., $\log_{a2}(10)$. Is that correct? Or did you intend to mean "the logarithm of a2 in base 10"?

( 2020-03-29 13:12:30 -0600 )edit

I am sorry, I messed up the log function, I wanted the log of a2 in base 10 - log(a2, 10). However when I corrected my mistake the function still doesn't work.

( 2020-03-29 13:44:13 -0600 )edit

Sort by » oldest newest most voted

Hello, @Alex89! I don't know exactly why this is failing. I even try using Sympy as solver for the problem, but my computer crashed (in SageCell, I got a "Memory Error"). However, you can cleverly solve this system. Check this out:

Let's make a change of variables, making $x=\log_10(a2)$ and $y=\log_10(b2)$. Then, your code can be rewritten as

var('a2,b2')
solve([x + 435*y == 50.88, 435*x + 8555*y == 979.15], x, y)


That gives the following solution:

[[x == (-921/17800), y == (60439/516200)]]


This implies that $\log_{10}(a2)=-921/17800$ and $\log_{10}(b2)=60439/516200$. Now, if you apply the definition of the logarithm, these in turn imply that $a2=10^{-921/17800}$ and $b2=10^{60439/516200}$. If you want these values as numerical values, you do

a2 = N(10^(-921/17800))
b2 = N(10^(60439/516200))


which gives you

a2 = 0.887684071389383
b2 = 1.30943656287307


That's it! I hope this helps!

more

Thank you for your answer, the result is what I was looking for. Sucks that solve() does not work with logs.

( 2020-03-29 15:59:15 -0600 )edit