________________________________
 From: MARK BAKER <[email protected]>
To: ""[email protected]"" <[email protected]> 
Sent: Sunday, July 15, 2012 9:12 AM
Subject: simultaneous equations
 

Hello,

I have been trying to get a simultaneous equations done, yet 

I finding errors... in how im doing it 


Im trying to do this equation  here 

              A                    b

2x'1' + 4x'2' + 3x'3'    = 4 

    x'1' - 2x'2' - 2x'3'   = 0
-3x'1' + 3x'2' + 2x'3'  = -7

this is the solution 

              [2x'1' + 4x'2' + 3x'3']   [ 4]  = [2]  = x'1'

(1/11)    [x'1' - 2x'2' - 2x'3' ]      [0]   = [-3] = x'2'

              [-3x'1' + 3x'2' + 2x'3']  [-7] = [4]   = x'3'

How should i do this in PDL ???

I tried  x = (A**-1)*b 

like this 


pdl> p $k = pdl([[2,1,-2],[4,13,7],[-3,-18,-8]]);

[
 [  2   1  -2]
 [  4  13   7]
 [ -3 -18  -8]
]


pdl> p $j = pdl([[4],[0],[7]]);

[
 [4]
 [0]
 [7]
]

so when I try to do the answer i get 


pdl> p ((1/11)*$k**-1)*$j;

[
 [  0.045454545   0.090909091  -0.045454545]
 [  0.022727273   0.006993007   0.012987013]
 [  -0.03030303 -0.0050505051  -0.011363636]
]

can any one help me with what im doing wrong in PDL here ???

Thanks

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

Reply via email to