linsolve w/linsolve_params:false;
- Subject: linsolve w/linsolve_params:false;
- From: Stavros Macrakis
- Date: Wed, 12 Jun 2013 12:08:54 -0400
Shouldn't linsolve give an error when given a non-linear system?
On Wed, Jun 12, 2013 at 12:04 PM, Raymond Toy <toy.raymond at gmail.com> wrote:
> >>>>> "Henry" == Henry Baker <hbaker1 at pipeline.com> writes:
>
> Henry> Actually, linsolve w/linsolve_params:false; doesn't work at
> all!!
> Henry> Note that b0 is given in terms of b0, b1 in terms of b1, d0 in
> terms of d0, d1 in terms of d1.
>
> Henry> What's going on here?
>
> Henry> Maxima 5.28.0-2 http://maxima.sourceforge.net
> Henry> using Lisp GNU Common Lisp (GCL) GCL 2.6.8 (a.k.a. GCL)
> Henry> Distributed under the GNU Public License. See the file COPYING.
> Henry> Dedicated to the memory of William Schelter.
> Henry> The function bug_report() provides bug reporting information.
> Henry> (%i1) load("f:\\dof.mac");
> Henry> solve: dependent equations eliminated: (1 4)
>
> Henry> solve: dependent equations eliminated: (5 6)
> Henry> (%o0) f:\dof.mac
> Henry> (%i1) eqns:append(eqn1,eqn2);
> Henry> (%o1) [b1 c2 - a1 c2 - b2 c1 + a2 c1 + a1 b2 - a2 b1,
> Henry> - b0 c2 + a0 c2 + b2 c0 - a2 c0 - a0 b2 + a2 b0,
> Henry> b0 c1 - a0 c1 - b1 c0 + a1 c0 + a0 b1 - a1 b0,
> Henry> - c1 d2 + a1 d2 + c2 d1 - a2 d1 - a1 c2 + a2 c1,
> Henry> c0 d2 - a0 d2 - c2 d0 + a2 d0 + a0 c2 - a2 c0,
> Henry> - c0 d1 + a0 d1 + c1 d0 - a1 d0 - a0 c1 + a1 c0]
> Henry> (%i2) vars:append(a,b,c,d);
> Henry> (%o2) [a0, a1, a2, b0, b1, b2, c0, c1, c2, d0, d1, d2]
>
> If eqns is the set of equations to be solved and vars is the set of
> unknowns, then it seems to me that eqns is not a linear system since
> it contains terms like b1*c2, a product of two of the unknowns.
>
> I would expect linsolve not to do a very good job here. Maybe algsys
> is what you want here:
>
> algsys(eqns,vars);
> [[a0 = %r133,a1 = %r134,a2 = %r135,b0 = %r136,b1 = %r137,b2 = %r138,
> c0 = %r133,c1 = %r134,c2 = %r135,d0 = %r139,d1 = %r140,d2 = %r141],
> [a0 = (%r144*%r149+(%r142-%r146)*%r147-%r142*%r144)/(%r149-%r146),
> a1 = (%r145*%r149+(%r142-%r146)*%r148-%r142*%r145)/(%r149-%r146),a2 =
> %r142,
> b0 = (%r144*%r149+(%r143-%r146)*%r147-%r143*%r144)/(%r149-%r146),
> b1 = (%r145*%r149+(%r143-%r146)*%r148-%r143*%r145)/(%r149-%r146),b2 =
> %r143,
> c0 = %r144,c1 = %r145,c2 = %r146,d0 = %r147,d1 = %r148,d2 = %r149],
> [a0 = (%r153*%r156+(%r150-%r154)*%r155-%r150*%r153)/(%r156-%r154),a1 =
> %r150,
> a2 = %r151,b0 =
> (%r153*%r156+(%r152-%r154)*%r155-%r152*%r153)/(%r156-%r154),
> b1 = %r152,b2 = %r151,c0 = %r153,c1 = %r154,c2 = %r151,d0 = %r155,
> d1 = %r156,d2 = %r151],
> [a0 = (%r158*%r163+(%r157-%r160)*%r161-%r157*%r158)/(%r163-%r160),
> a1 = (%r159*%r163+(%r157-%r160)*%r162-%r157*%r159)/(%r163-%r160),a2 =
> %r157,
> b0 = %r158,b1 = %r159,b2 = %r160,c0 = %r161,c1 = %r162,c2 = %r163,
> d0 = %r161,d1 = %r162,d2 = %r163],
> [a0 = (%r166*%r170+(%r164-%r165)*%r168-%r164*%r166)/(%r170-%r165),
> a1 = (%r167*%r170+(%r164-%r165)*%r169-%r164*%r167)/(%r170-%r165),a2 =
> %r164,
> b0 = (%r166*%r170-%r165*%r166)/(%r170-%r165),
> b1 = (%r167*%r170-%r165*%r167)/(%r170-%r165),b2 = %r165,c0 = %r166,
> c1 = %r167,c2 = %r165,d0 = %r168,d1 = %r169,d2 = %r170],
> [a0 = (%r174*%r177+(%r172-%r175)*%r176-%r172*%r174)/(%r177-%r175),a1 =
> %r171,
> a2 = %r172,b0 =
> (%r174*%r177+(%r173-%r175)*%r176-%r173*%r174)/(%r177-%r175),
> b1 = %r171,b2 = %r173,c0 = %r174,c1 = %r171,c2 = %r175,d0 = %r176,
> d1 = %r171,d2 = %r177],
> [a0 = (%r181*%r183+(%r178-%r180)*%r182-%r178*%r181)/(%r183-%r180),a1 =
> %r178,
> a2 = %r179,b0 = (%r181*%r183-%r180*%r181)/(%r183-%r180),b1 = %r180,
> b2 = %r179,c0 = %r181,c1 = %r180,c2 = %r179,d0 = %r182,d1 = %r183,
> d2 = %r179],
> [a0 = %r184,a1 = %r185,a2 = %r186,b0 = %r187,b1 = %r188,b2 = %r189,
> c0 = %r187,c1 = %r188,c2 = %r189,d0 = %r187,d1 = %r188,d2 = %r189],
> [a0 = %r190,a1 = %r191,a2 = %r192,b0 = %r193,b1 = %r191,b2 = %r192,
> c0 = %r194,c1 = %r191,c2 = %r192,d0 = %r195,d1 = %r191,d2 = %r192]]$
>
> I have no idea if these are correct, but a quick glance shows that at
> least the solutions don't involve the unkowns.
>
> Ray
>
> _______________________________________________
> Maxima mailing list
> Maxima at math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima
>