I know the symbolic package isn't the same as matlab but this error confuses me and I'm not sure what causes this What I type in to test it
pkg load symbolic syms x y sol = solve([x^2+y^2==20,y==x^2,x>0,y>0],[x,y])
I should get x=2 and y=4
but I get this instead
OctSymPy v2.2.4: this is free software without warranty, see source. Initializing communication with SymPy using a popen2() pipe. Some output from the Python subprocess (pid 20298) might appear next. Python 2.7.12 (default, Nov 19 2016, 06:48:10) [GCC 5.4.0 20160609] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> >>> Traceback (most recent call last): File "<stdin>", line 26, in <module> File "<stdin>", line 6, in _fcn File "/usr/lib/python2.7/dist-packages/sympy/matrices/matrices.py", line 3084, in __getattr__ "%s has no attribute %s." % (self.__class__.__name__, attr)) AttributeError: MutableDenseMatrix has no attribute is_Relational.
OctSymPy: Communication established. SymPy v0.7.6.1. PYTHON: Error in cmd Resetting the octsympy communication mechanism Closing the Python pipe... error: python_cmd: unexpected return error: called from python_cmd at line 144 column 6 solve at line 135 column 9
Re: Symbolic package and solving multiple variables
On Tue, Jul 11, 2017 at 18:31:38 -0400, RT wrote:
> I know the symbolic package isn't the same as matlab but this error
> confuses me and I'm not sure what causes this
> What I type in to test it
> pkg load symbolic
> syms x y
> sol = solve([x^2+y^2==20,y==x^2,x>0,y>0],[x,y])
> I should get x=2 and y=4
> but I get this instead
> Any ideas how to get this to work should I not use the symbolic package?
Our solve function is not quite Matlab compatible, but it will give you
what you want if you adapt slightly.
The first difference is to pass each equality, inequality, and variable
as separate arguments instead of as a matrix.
The second difference is that SymPy doesn't appear to handle solving
systems of inequalities for more than one variable at a time.
To work around both of these differences, I used the following
syms x y
assume x y positive
sol = solve (x^2+y^2==20, y==x^2, x, y)