From Matlab to Python - Solve function
<p>I made a Matlab function and I would like to convert it to Python to use with my web application.</p>

<p>I converted (.m file to .py file) almost everything using OMPC.
However, I can't make the <code>solve()</code> function to work (I am using the sympy library).</p>

<p>This is the Matlab line:</p>

<pre><code>SBC = solve(sqrt((xa-x)^(2)+(ya-y)^(2))-sqrt((xb-x)^(2)+(yb-y)^(2))-D12==0,sqrt((xa-x)^(2)+(ya-y)^(2))-sqrt((xc-x)^(2)+(yc-y)^(2))-D13==0,[x,y]);
</code></pre>

<p>And this is the Python line where <code>x</code> and <code>y</code> are symbols (with <code>x = Symbol('x')</code> and <code>y = Symbol('y')</code>) :</p>

<pre><code>sbc = solve(
            sqrt((xa - x) ** (2) + (ya - y) ** (2))
            - sqrt((xb - x) ** (2) + (yb - y) ** (2))
            - D12 == 0,
            sqrt((xa - x) ** (2) + (ya - y) ** (2))
            - sqrt((xc - x) ** (2) + (yc - y) ** (2))
            - D13 == 0,
            [x, y]
        )
</code></pre>

<p>With this Python code, I am getting <code>False</code> instead of a result (it works great with the Matlab code).</p>

<p>Am I missing something?</p>

<p><strong>EDIT</strong>:</p>

<p>And with this, I am getting <code>[]</code> :</p>

<pre><code># -*- coding: utf-8 -*-

from sympy import *

def alg(xa=None, ya=None, za=None, Ta=None, xb=None, yb=None, zb=None, Tb=None, xc=None, yc=None, zc=None, Tc=None, xd=None, yd=None, zd=None, Td=None, RSSIA=None, RSSIB=None, RSSIC=None, RSSID=None, txPower=None, n=None):
    n = 2
    c = 3 * 10 ** 8
    TOA12 = Ta - Tb
    TOA13 = Ta - Tc
    TOA14 = Ta - Td

    D12 = TOA12 * c
    D13 = TOA13 * c
    D14 = TOA14 * c
    x, y = symbols('x y')

    eqs = [sqrt((xa - x) ** (2) + (ya - y) ** (2)) - sqrt((xb - x) ** (2) + (yb - y) ** (2)) - D12,
   sqrt((xa - x) ** (2) + (ya - y) ** (2)) - sqrt((xc - x) ** (2) + (yc - y) ** (2)) - D13]

    print solve(eqs, [x, y])

alg(3,1,0,21.8898790015,4,6,0,21.8898790005,10,4,0,21.88987900009,9,0.5,0,21.889879000105,23.9,23.85,23.9,23.95,24,1)
</code></pre>