> On Sun, 15 Jul 2012 13:40:15 -0700 (PDT)
> MARK BAKER <[email protected]> wrote:
>
> Hey all,
> 
> does any one in the development have any idea on if 
> it would be possible to add functionality like this to PDL
> 
> 
> __p__ $k = pdl([[ 1x+2y+3z=27], [3x+2z+1y=27],[2x+1z+3x=27]]);
> 
> x = 5
> y = 6
> z = 10
> 
> does any one think this might be possible;
> __it would make simultaneous equations a snap ... 

This is somewhat ill-defined. If the equations aren't linear then there isn't
necessarily a unique solution. There could be no solutions or many. If it IS
linear, then it's a plain system of linear equations, and there are many ways to
solve them. Example:


use PDL::LinearAlgebra;
my $M = pdl[[1,2,3],
            [3,1,2],
            [2,3,1]];
my $b = transpose pdl(47,41,38);
my $x = msolve($M, $b);
say $x;


In the linear case there could be multiple solutions also (if $M is singular),
but the solution function you're using would tell you this. I think PDL already
does what it needs to for these types of problems.


_______________________________________________
Perldl mailing list
[email protected]
http://mailman.jach.hawaii.edu/mailman/listinfo/perldl

Reply via email to