access results of linsolve
- Subject: access results of linsolve
- From: Barton Willis
- Date: Tue, 15 Dec 2009 18:43:28 -0600
Sorry, I deleted part of the input; try something like:
(%i1) ssol[1] : 42$
(%i2) ssol : linsolve([C1*3-2,C2*1+4],[C1,C2]);
(%o2) [C1=2/3,C2=-4]
ssol[1] --> 42, not C1=2/3
(%i3) ssol[1];
(%o3) 42
But inpart(ssol,1) is OK
(%i4) inpart(ssol,1);
(%o4) C1=2/3
Sorry for the bother.
Barton
-----maxima-bounces at math.utexas.edu wrote: -----
>To:?maxima at math.utexas.edu
>From:?andre?maute?<andre.maute at gmx.de>
>Sent?by:?maxima-bounces at math.utexas.edu
>Date:?12/15/2009?05:37PM
>Subject:?Re:?[Maxima]?access?results?of?linsolve
>
>Hi?Barton,
>
>
>could?you?explain?the?details?of?the?difference?
>I?can't?reproduce?your?output,?see?below
>
>
>>??(%i5)?ssol?:?linsolve([C1*3-2,C2*1+4],[C1,C2]);
>>??(%o5)?[C1=2/3,C2=-4]
>>
>>?Not?what?we?want:
>>
>>??(%i6)?ssol[1];
>>??(%o6)?ssol[1]
>>
>>?OK
>>
>>??(%i7)?inpart(ssol,1);
>>??(%o7)?C1=2/3
>
>
>
>
>
>========================================================
>user at home:~$?maxima?-b?linsolve1.max
>Maxima?5.19.1?http://maxima.sourceforge.net
>Using?Lisp?SBCL?1.0.18.debian
>Distributed?under?the?GNU?Public?License.?See?the?file?COPYING.
>Dedicated?to?the?memory?of?William?Schelter.
>The?function?bug_report()?provides?bug?reporting?information.
>(%i1)????????????????????????batch(linsolve1.max)
>
>
>
>
>
>batching?/home/user/linsolve1.max
>(%i2)??????????????????????????display2d?:?false
>(%o2)?false
>(%i3)?sol:linsolve([C1*3-2,4+C2*1],[C1,C2])
>(%o3)?[C1?=?2/3,C2?=?-4]
>(%i4)?subst(sol,[C1,C2,C1-C2])
>(%o4)?[2/3,-4,14/3]
>(%i5)?ssol:linsolve([C1*3-2,4+C2*1],[C1,C2])
>(%o5)?[C1?=?2/3,C2?=?-4]
>(%i6)?ssol[1]
>(%o6)?C1?=?2/3
>(%i7)?inpart(ssol,1)
>(%o7)?C1?=?2/3
>(%o7)?"/home/user/linsolve1.max"
>========================================================
>
>
>
>
>
>Andre_______________________________________________
>Maxima?mailing?list
>Maxima at math.utexas.edu
>http://www.math.utexas.edu/mailman/listinfo/maxima