Page 1 sur 1

linsolve and giacpy

Publié : sam. déc. 09, 2017 6:04 pm
par jocaps
Hi,

linsolve behaves unlike Xcas when solving linear system of equations that has no solutions. Consider for instance the simple

Code : Tout sélectionner

linsolve([x+y,x+y-2],[x,y])
in python using giacpy (x,y are defined as pygen types) the output is

Code : Tout sélectionner

[[undef,undef],[undef,y]]
while in Xcas the output is simply an empty list. I believe the python output is unwanted by most users and the empty list output by Xcas is the correct output. Can this be changed or is this what the developers really want?

Jose

Re: linsolve and giacpy

Publié : lun. déc. 11, 2017 9:14 am
par frederic han
Strange, I am not able to reproduce this. How is your x, is it really a free symbol?

Code : Tout sélectionner

Python 2.7.13 (v2.7.13:a06454b1afa1, Dec 17 2016, 20:42:59) [MSC v.1500 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> from giacpy import linsolve,giac
Help file doc/fr/aide_cas not found
Added 0 synonyms
>>> x,y=giac('x,y')
>>> linsolve([x+y,x+y-2],[x,y])
[]

Re: linsolve and giacpy

Publié : lun. déc. 11, 2017 10:11 pm
par jocaps
Hi,

I'm not able to reproduce it anymore myself. My apologies! Maybe I made a mistake somewhere in my code. But if I encounter this again I will post it in this thread (with the exact code that reproduces it). Thank you for verifying this. Most probably there was a wrong initiation of the variables "x" and "y" from my side.

Jose