Ask Your Question

solve() does not solve

asked 2020-03-29 19:24:47 +0200

Alex89 gravatar image

updated 2020-08-15 07:42:17 +0200

slelievre gravatar image

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

log(10,a2) + log(10,b2) * 435 == 50.88,
log(10,a2) * 435 + log(10,b2) * 8555 == 979.15], a2,b2)
edit retag flag offensive close merge delete



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"?

dsejas gravatar imagedsejas ( 2020-03-29 20:12:30 +0200 )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.

Alex89 gravatar imageAlex89 ( 2020-03-29 20:44:13 +0200 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2020-03-29 21:04:55 +0200

dsejas gravatar image

updated 2020-03-29 22:04:15 +0200

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

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!

edit flag offensive delete link more


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

Alex89 gravatar imageAlex89 ( 2020-03-29 22:59:15 +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


Asked: 2020-03-29 19:24:47 +0200

Seen: 554 times

Last updated: Mar 29 '20