LINEAR3 hp32sII A program to solve a linear system of 3 equations with 3 unknowns. System: Ax+By+Cz = E (A NOT ZERO) Gx+Hy+Iz = K Mx+Ny+Oz = P The program stores all coefficients in the memory of the same letter variable. The input is by row including the independent terms: A,B,C,E, G,H,I,K, M,N,O,P. The results for x,y,z are shown in the corresponding stack registers (use roll to see them). WARNINGS: The program clears ALL variables (not sums) before starting. To save memory the program is very primitive; it does not do pivoting, and it may fail in some few instances even for non singular matrices (change the order of the rows if this happens or if A is zero). You can also use this program to solve systems with only 2 unknowns. For example, to solve a 2x2 system (x,y unknowns) enter the equivalent 3x3 system: Ax+By+0z = E (A NOT ZERO) Gx+Hy+0z = K 0x+0y+1z = 0 Memory requirements: Total:193.5 bytes. Program:97.5 bytes. Variables:96 bytes (8x12). Left free: 43.5 bytes. No Flags used. C CHKSUM=F0b4 097.5 x--------------x--------------x--------------x--------------x----------- C01 LBL C C11 INPUT M C21 STOx P C31 RCL B C41 STOx O C02 CLVARS C12 INPUT N C22 RCL B C32 RCLx M C42 STOx P C03 INPUT A C13 INPUT O C23 RCLx G C33 STO- N C43 RCL I C04 INPUT B C14 INPUT P C24 STO- H C34 RCL C C44 RCLx N C05 INPUT C C15 RCL A C25 RCL C C35 RCLx M C45 STO- O C06 INPUT E C16 STOx H C26 RCLx G C36 STO- O C46 RCL K C07 INPUT G C17 STOx I C27 STO- I C37 RCL E C47 RCLx N C08 INPUT H C18 STOx K C28 RCL E C38 RCLx M C48 STO- P C09 INPUT I C19 STOx N C29 RCLx G C39 STO- P C49 RCL O C10 INPUT K C20 STOx O C30 STO- K C40 RCL H C50 STO/ P C51 RCL P C61 RCL P C52 STOx I C62 RCL K C53 STOx C C63 RCL E C54 RCL K C64 RCL/ A C55 RCL- I C65 RTN C56 RCL/ H C57 STO K C58 RCLx B C59 RCL+ C C60 STO- E