Error with list2expr

Messages in english

Modérateur : xcasadmin

Répondre
compsystems
Messages : 558
Inscription : sam. févr. 04, 2017 11:34 pm
Localisation : Colombia
Contact :

Error with list2expr

Message par compsystems » mar. août 07, 2018 7:36 pm

Hello BP, in the last version I observe

1: linsolve([x+y=(1+√2)/2, x-y=(1-√2)/2],[x,y])
[1/2,1/(sqrt(2))]

2: list2exp(ans(-1),[x,y])
error

3: list2exp(linsolve([x+y=(1+√2)/2, x-y=(1-√2)/2],[x,y]),[x,y])
error

4: list2exp([[1/2,1/(sqrt(2))]],[x,y])
(x=1/2) and (y=(1/sqrt(2)))


---

5: linsolve([x+2*y=5,1/2*x+y=5/2],[x,y])
[-2*y+5,y]

6: list2exp(linsolve([x+2*y=5,1/2*x+y=5/2],[x,y]),[x,y])
error

7: list2exp([[-2*y+5,y]],[x,y])
(x=-2*y+5) and (y=y) =)

parisse
Messages : 5734
Inscription : mar. déc. 20, 2005 4:02 pm
Contact :

Re: Error with list2expr

Message par parisse » mer. août 08, 2018 8:20 pm

Yes, that's because linsolve returns a unique solution instead of a list of solutions. Will be fixed.

compsystems
Messages : 558
Inscription : sam. févr. 04, 2017 11:34 pm
Localisation : Colombia
Contact :

Re: Error with list2expr

Message par compsystems » jeu. août 09, 2018 5:48 pm

I do not know, if it is important to add an extra parameter '=' to get more quickly input and the most 'explicit' form output

1: linsolve( [x+y=(1+√2)/2, x-y=(1-√2)/2], [x, y] )

[ 1/2, 1/(sqrt(2)) ]

2: linsolve( [x+y=(1+√2)/2, x-y=(1-√2)/2], [x, y], '= ' )

[ x=1/2, y=(1/sqrt(2) ]

parisse
Messages : 5734
Inscription : mar. déc. 20, 2005 4:02 pm
Contact :

Re: Error with list2expr

Message par parisse » jeu. août 09, 2018 8:11 pm

Ok, I will add '=' as an optional arg for linsolve, this is coherent with solve.

compsystems
Messages : 558
Inscription : sam. févr. 04, 2017 11:34 pm
Localisation : Colombia
Contact :

Re: Error with list2expr

Message par compsystems » ven. août 10, 2018 2:19 pm

Thanks Mr Bernard.

and with desolve and similar cmds

desolve(((y')'+y) = 0,y) returns
G_0*cos(x)+G_1*sin(x)

desolve(((y')'+y) = 0,y, '=' )
y(x)=G_0*cos(x)+G_1*sin(x)

compsystems
Messages : 558
Inscription : sam. févr. 04, 2017 11:34 pm
Localisation : Colombia
Contact :

Re: Error with list2expr

Message par compsystems » mar. août 14, 2018 3:12 pm

Hello, the inverse function exp2list, automatically changes to ti68k mode flag, this causes that when the code is re-executed the outputs fail, the exp2list command must not change the flag automatically to ti68k mode.

parisse
Messages : 5734
Inscription : mar. déc. 20, 2005 4:02 pm
Contact :

Re: Error with list2expr

Message par parisse » jeu. août 16, 2018 8:34 am

I can't reproduce, I tried with the first example of the help.

compsystems
Messages : 558
Inscription : sam. févr. 04, 2017 11:34 pm
Localisation : Colombia
Contact :

Re: Error with list2expr

Message par compsystems » jeu. août 16, 2018 2:05 pm

hello, there's no problem with exp2list, it's with list2exp, with linsolve,

list2exp(linsolve([equal(x+y,(1+√2)/2),equal(x-y,(1-(√2))/2)],[x,y]),[x,y]) // change to ti89 mode

//

As the list2exp and exp2list commands are new please can rename to list2expr and expr2list, with the purpose of differences the EXPonential function of EXPRession

Thanks

parisse
Messages : 5734
Inscription : mar. déc. 20, 2005 4:02 pm
Contact :

Re: Error with list2expr

Message par parisse » jeu. août 16, 2018 6:24 pm

compsystems a écrit :
ven. août 10, 2018 2:19 pm
Thanks Mr Bernard.

and with desolve and similar cmds

desolve(((y')'+y) = 0,y) returns
G_0*cos(x)+G_1*sin(x)

desolve(((y')'+y) = 0,y, '=' )
y(x)=G_0*cos(x)+G_1*sin(x)
I don't think it's worth the effort. Students running desolve are at a higher level of math, they can certainly understand the current form for the solution (or if they don't, the problem will most probably be with the integration constants).

parisse
Messages : 5734
Inscription : mar. déc. 20, 2005 4:02 pm
Contact :

Re: Error with list2expr

Message par parisse » jeu. août 16, 2018 6:32 pm

compsystems a écrit :
jeu. août 16, 2018 2:05 pm
hello, there's no problem with exp2list, it's with list2exp, with linsolve,

list2exp(linsolve([equal(x+y,(1+√2)/2),equal(x-y,(1-(√2))/2)],[x,y]),[x,y]) // change to ti89 mode
It works with the current devel version.

Répondre