Question: Block Matrix assembly problem


Trying to build a block matrix. Having a problem getting the syntax correct. Can't add in the predefind matrices to the lower band.

restart

with(LinearAlgebra):

interface(displayprecision = 5)

5

(1)

interface(rtablesize = 81)

10

(2)

S := 2

2

(3)

dmax := 7

7

(4)

CCnew0 := Matrix(2, 2, {(1, 1) = 336750255587/3769550688757, (1, 2) = -14853552191797/1696297809940650, (2, 1) = 665096091/76929605893, (2, 2) = 1328910382993/11539440883950})

CCnew0 := Matrix(2, 2, {(1, 1) = 336750255587/3769550688757, (1, 2) = -14853552191797/1696297809940650, (2, 1) = 665096091/76929605893, (2, 2) = 1328910382993/11539440883950})

(5)

CCnew1 := Matrix(2, 2, {(1, 1) = 49655436033349/56543260331355, (1, 2) = -75647656451147/1413581508283875, (2, 1) = 29849106694/384648029465, (2, 2) = 10591394356218/9616200736625})

CCnew1 := Matrix(2, 2, {(1, 1) = 49655436033349/56543260331355, (1, 2) = -75647656451147/1413581508283875, (2, 1) = 29849106694/384648029465, (2, 2) = 10591394356218/9616200736625})

(6)

CCnew2 := Matrix(2, 2, {(1, 1) = 299962512141959/80776086187650, (1, 2) = -1231816081155781/8481489049703250, (2, 1) = 155175716729/549497184950, (2, 2) = 260449617208489/57697204419750})

CCnew2 := Matrix(2, 2, {(1, 1) = 299962512141959/80776086187650, (1, 2) = -1231816081155781/8481489049703250, (2, 1) = 155175716729/549497184950, (2, 2) = 260449617208489/57697204419750})

(7)

CCnew3 := Matrix(2, 2, {(1, 1) = 50445725001719/5769720441975, (1, 2) = -9065291388901/40388043093825, (2, 1) = 21111399914/39249798925, (2, 2) = 2819495262394/274748592475})

CCnew3 := Matrix(2, 2, {(1, 1) = 50445725001719/5769720441975, (1, 2) = -9065291388901/40388043093825, (2, 1) = 21111399914/39249798925, (2, 2) = 2819495262394/274748592475})

(8)

CCnew4 := Matrix(2, 2, {(1, 1) = 142685068141037/11539440883950, (1, 2) = -116560067351321/565432603313550, (2, 1) = 44654487647/78499597850, (2, 2) = 53741323977599/3846480294650})

CCnew4 := Matrix(2, 2, {(1, 1) = 142685068141037/11539440883950, (1, 2) = -116560067351321/565432603313550, (2, 1) = 44654487647/78499597850, (2, 2) = 53741323977599/3846480294650})

(9)

CCnew5 := Matrix(2, 2, {(1, 1) = 60560690824604/5769720441975, (1, 2) = -88774498025543/848148904970325, (2, 1) = 12484906049/39249798925, (2, 2) = 65745570806567/5769720441975})

CCnew5 := Matrix(2, 2, {(1, 1) = 60560690824604/5769720441975, (1, 2) = -88774498025543/848148904970325, (2, 1) = 12484906049/39249798925, (2, 2) = 65745570806567/5769720441975})

(10)

CCnew6 := Matrix(2, 2, {(1, 1) = 20398649489879/4121228887125, (1, 2) = -5446073753219/242328258562950, (2, 1) = 14465459393/196248994625, (2, 2) = 8502096238511/1648491554850})

CCnew6 := Matrix(2, 2, {(1, 1) = 20398649489879/4121228887125, (1, 2) = -5446073753219/242328258562950, (2, 1) = 14465459393/196248994625, (2, 2) = 8502096238511/1648491554850})

(11)

S*dmax

14

(12)

M1 := Matrix(S*dmax, S*dmax, [Matrix(S*(dmax-1), S), Matrix(S*(dmax-1), shape = identity), Matrix(S, S*dmax, [seq(-CCnew || n, n = 0 .. dmax-1)])])

Error, (in Matrix) this entry is too tall or too short: Matrix(2, 14, {(1, 1) = -336750255587/3769550688757, (1, 2) = 14853552191797/1696297809940650, (1, 3) = -49655436033349/56543260331355, (1, 4) = 75647656451147/1413581508283875, (1, 5) = -299962512141959/80776086187650, (1, 6) = 1231816081155781/8481489049703250, (1, 7) = -50445725001719/5769720441975, (1, 8) = 9065291388901/40388043093825, (1, 9) = -142685068141037/11539440883950, (1, 10) = 116560067351321/565432603313550, (1, 11) = -60560690824604/5769720441975, (1, 12) = 88774498025543/848148904970325, (1, 13) = -20398649489879/4121228887125, (1, 14) = 5446073753219/242328258562950, ...

 

M2 := Matrix(S*dmax, S*dmax, [Matrix(S*(dmax-1), S), Matrix(S*(dmax-1), shape = identity)])

M2 := Matrix(14, 14, {(1, 1) = 0, (1, 2) = 0, (1, 3) = 1, (1, 4) = 0, (1, 5) = 0, (1, 6) = 0, (1, 7) = 0, (1, 8) = 0, (1, 9) = 0, (1, 10) = 0, (1, 11) = 0, (1, 12) = 0, (1, 13) = 0, (1, 14) = 0, (2, 1) = 0, (2, 2) = 0, (2, 3) = 0, (2, 4) = 1, (2, 5) = 0, (2, 6) = 0, (2, 7) = 0, (2, 8) = 0, (2, 9) = 0, (2, 10) = 0, (2, 11) = 0, (2, 12) = 0, (2, 13) = 0, (2, 14) = 0, (3, 1) = 0, (3, 2) = 0, (3, 3) = 0, (3, 4) = 0, (3, 5) = 1, (3, 6) = 0, (3, 7) = 0, (3, 8) = 0, (3, 9) = 0, (3, 10) = 0, (3, 11) = 0, (3, 12) = 0, (3, 13) = 0, (3, 14) = 0, (4, 1) = 0, (4, 2) = 0, (4, 3) = 0, (4, 4) = 0, (4, 5) = 0, (4, 6) = 1, (4, 7) = 0, (4, 8) = 0, (4, 9) = 0, (4, 10) = 0, (4, 11) = 0, (4, 12) = 0, (4, 13) = 0, (4, 14) = 0, (5, 1) = 0, (5, 2) = 0, (5, 3) = 0, (5, 4) = 0, (5, 5) = 0, (5, 6) = 0, (5, 7) = 1, (5, 8) = 0, (5, 9) = 0, (5, 10) = 0, (5, 11) = 0, (5, 12) = 0, (5, 13) = 0, (5, 14) = 0, (6, 1) = 0, (6, 2) = 0, (6, 3) = 0, (6, 4) = 0, (6, 5) = 0, (6, 6) = 0, (6, 7) = 0, (6, 8) = 1, (6, 9) = 0, (6, 10) = 0, (6, 11) = 0, (6, 12) = 0, (6, 13) = 0, (6, 14) = 0, (7, 1) = 0, (7, 2) = 0, (7, 3) = 0, (7, 4) = 0, (7, 5) = 0, (7, 6) = 0, (7, 7) = 0, (7, 8) = 0, (7, 9) = 1, (7, 10) = 0, (7, 11) = 0, (7, 12) = 0, (7, 13) = 0, (7, 14) = 0, (8, 1) = 0, (8, 2) = 0, (8, 3) = 0, (8, 4) = 0, (8, 5) = 0, (8, 6) = 0, (8, 7) = 0, (8, 8) = 0, (8, 9) = 0, (8, 10) = 1, (8, 11) = 0, (8, 12) = 0, (8, 13) = 0, (8, 14) = 0, (9, 1) = 0, (9, 2) = 0, (9, 3) = 0, (9, 4) = 0, (9, 5) = 0, (9, 6) = 0, (9, 7) = 0, (9, 8) = 0, (9, 9) = 0, (9, 10) = 0, (9, 11) = 1, (9, 12) = 0, (9, 13) = 0, (9, 14) = 0, (10, 1) = 0, (10, 2) = 0, (10, 3) = 0, (10, 4) = 0, (10, 5) = 0, (10, 6) = 0, (10, 7) = 0, (10, 8) = 0, (10, 9) = 0, (10, 10) = 0, (10, 11) = 0, (10, 12) = 1, (10, 13) = 0, (10, 14) = 0, (11, 1) = 0, (11, 2) = 0, (11, 3) = 0, (11, 4) = 0, (11, 5) = 0, (11, 6) = 0, (11, 7) = 0, (11, 8) = 0, (11, 9) = 0, (11, 10) = 0, (11, 11) = 0, (11, 12) = 0, (11, 13) = 1, (11, 14) = 0, (12, 1) = 0, (12, 2) = 0, (12, 3) = 0, (12, 4) = 0, (12, 5) = 0, (12, 6) = 0, (12, 7) = 0, (12, 8) = 0, (12, 9) = 0, (12, 10) = 0, (12, 11) = 0, (12, 12) = 0, (12, 13) = 0, (12, 14) = 1, (13, 1) = 0, (13, 2) = 0, (13, 3) = 0, (13, 4) = 0, (13, 5) = 0, (13, 6) = 0, (13, 7) = 0, (13, 8) = 0, (13, 9) = 0, (13, 10) = 0, (13, 11) = 0, (13, 12) = 0, (13, 13) = 0, (13, 14) = 0, (14, 1) = 0, (14, 2) = 0, (14, 3) = 0, (14, 4) = 0, (14, 5) = 0, (14, 6) = 0, (14, 7) = 0, (14, 8) = 0, (14, 9) = 0, (14, 10) = 0, (14, 11) = 0, (14, 12) = 0, (14, 13) = 0, (14, 14) = 0})

(13)

lowerband := Matrix(S, S*dmax, [seq(-evalf(CCnew || n), n = 0 .. dmax-1)])

lowerband := Matrix(2, 14, {(1, 1) = -0.893343e-1, (1, 2) = 0.875645e-2, (1, 3) = -.878185, (1, 4) = 0.535149e-1, (1, 5) = -3.71351, (1, 6) = .145236, (1, 7) = -8.74318, (1, 8) = .224455, (1, 9) = -12.36499, (1, 10) = .206143, (1, 11) = -10.49630, (1, 12) = .104669, (1, 13) = -4.94965, (1, 14) = 0.224740e-1, (2, 1) = -0.864552e-2, (2, 2) = -.115162, (2, 3) = -0.776011e-1, (2, 4) = -1.10141, (2, 5) = -.282396, (2, 6) = -4.51408, (2, 7) = -.537873, (2, 8) = -10.26209, (2, 9) = -.568850, (2, 10) = -13.97156, (2, 11) = -.318088, (2, 12) = -11.39493, (2, 13) = -0.737097e-1, (2, 14) = -5.15750})

(14)

M3 := Matrix(S*dmax, S*dmax, [Matrix(S*(dmax-1), S), Matrix(S*(dmax-1), shape = identity), lowerband])

Error, (in Matrix) this entry is too tall or too short: Matrix(2, 14, {(1, 1) = -0.8933432215e-1, (1, 2) = 0.8756453086e-2, (1, 3) = -.8781848755, (1, 4) = 0.5351488825e-1, (1, 5) = -3.713506389, (1, 6) = .1452358276, (1, 7) = -8.743183575, (1, 8) = .224454831, (1, 9) = -12.36498974, (1, 10) = .2061431666, (1, 11) = -10.49629552, (1, 12) = .1046685287, (1, 13) = -4.949652167, (1, 14) = 0.2247395242e-1, (2, 1) = -0.8645515381e-2, (2, 2) = -.1151624586, (2, 3) = -0.7760109089e-1, (2, 4) = -1.101411529, (2, 5) = -.2823958356, (2, 6) = -4.514076892, (2, 7) = -.537872817, (2, 8) = -10.26209174, (2, 9) = -.5688498906, (2, 10) = -13.97155838, (2, 1...

 

``


Download Test_Block_matrix.mw

restart

with(LinearAlgebra):

interface(displayprecision = 5)

5

(1)

interface(rtablesize = 81)

10

(2)

S := 2

2

(3)

dmax := 7

7

(4)

CCnew0 := Matrix(2, 2, {(1, 1) = 336750255587/3769550688757, (1, 2) = -14853552191797/1696297809940650, (2, 1) = 665096091/76929605893, (2, 2) = 1328910382993/11539440883950})

CCnew0 := Matrix(2, 2, {(1, 1) = 336750255587/3769550688757, (1, 2) = -14853552191797/1696297809940650, (2, 1) = 665096091/76929605893, (2, 2) = 1328910382993/11539440883950})

(5)

CCnew1 := Matrix(2, 2, {(1, 1) = 49655436033349/56543260331355, (1, 2) = -75647656451147/1413581508283875, (2, 1) = 29849106694/384648029465, (2, 2) = 10591394356218/9616200736625})

CCnew1 := Matrix(2, 2, {(1, 1) = 49655436033349/56543260331355, (1, 2) = -75647656451147/1413581508283875, (2, 1) = 29849106694/384648029465, (2, 2) = 10591394356218/9616200736625})

(6)

CCnew2 := Matrix(2, 2, {(1, 1) = 299962512141959/80776086187650, (1, 2) = -1231816081155781/8481489049703250, (2, 1) = 155175716729/549497184950, (2, 2) = 260449617208489/57697204419750})

CCnew2 := Matrix(2, 2, {(1, 1) = 299962512141959/80776086187650, (1, 2) = -1231816081155781/8481489049703250, (2, 1) = 155175716729/549497184950, (2, 2) = 260449617208489/57697204419750})

(7)

CCnew3 := Matrix(2, 2, {(1, 1) = 50445725001719/5769720441975, (1, 2) = -9065291388901/40388043093825, (2, 1) = 21111399914/39249798925, (2, 2) = 2819495262394/274748592475})

CCnew3 := Matrix(2, 2, {(1, 1) = 50445725001719/5769720441975, (1, 2) = -9065291388901/40388043093825, (2, 1) = 21111399914/39249798925, (2, 2) = 2819495262394/274748592475})

(8)

CCnew4 := Matrix(2, 2, {(1, 1) = 142685068141037/11539440883950, (1, 2) = -116560067351321/565432603313550, (2, 1) = 44654487647/78499597850, (2, 2) = 53741323977599/3846480294650})

CCnew4 := Matrix(2, 2, {(1, 1) = 142685068141037/11539440883950, (1, 2) = -116560067351321/565432603313550, (2, 1) = 44654487647/78499597850, (2, 2) = 53741323977599/3846480294650})

(9)

CCnew5 := Matrix(2, 2, {(1, 1) = 60560690824604/5769720441975, (1, 2) = -88774498025543/848148904970325, (2, 1) = 12484906049/39249798925, (2, 2) = 65745570806567/5769720441975})

CCnew5 := Matrix(2, 2, {(1, 1) = 60560690824604/5769720441975, (1, 2) = -88774498025543/848148904970325, (2, 1) = 12484906049/39249798925, (2, 2) = 65745570806567/5769720441975})

(10)

CCnew6 := Matrix(2, 2, {(1, 1) = 20398649489879/4121228887125, (1, 2) = -5446073753219/242328258562950, (2, 1) = 14465459393/196248994625, (2, 2) = 8502096238511/1648491554850})

CCnew6 := Matrix(2, 2, {(1, 1) = 20398649489879/4121228887125, (1, 2) = -5446073753219/242328258562950, (2, 1) = 14465459393/196248994625, (2, 2) = 8502096238511/1648491554850})

(11)

S*dmax

14

(12)

M1 := Matrix(S*dmax, S*dmax, [Matrix(S*(dmax-1), S), Matrix(S*(dmax-1), shape = identity), Matrix(S, S*dmax, [seq(-CCnew || n, n = 0 .. dmax-1)])])

Error, (in Matrix) this entry is too tall or too short: Matrix(2, 14, {(1, 1) = -336750255587/3769550688757, (1, 2) = 14853552191797/1696297809940650, (1, 3) = -49655436033349/56543260331355, (1, 4) = 75647656451147/1413581508283875, (1, 5) = -299962512141959/80776086187650, (1, 6) = 1231816081155781/8481489049703250, (1, 7) = -50445725001719/5769720441975, (1, 8) = 9065291388901/40388043093825, (1, 9) = -142685068141037/11539440883950, (1, 10) = 116560067351321/565432603313550, (1, 11) = -60560690824604/5769720441975, (1, 12) = 88774498025543/848148904970325, (1, 13) = -20398649489879/4121228887125, (1, 14) = 5446073753219/242328258562950, ...

 

M2 := Matrix(S*dmax, S*dmax, [Matrix(S*(dmax-1), S), Matrix(S*(dmax-1), shape = identity)])

M2 := Matrix(14, 14, {(1, 1) = 0, (1, 2) = 0, (1, 3) = 1, (1, 4) = 0, (1, 5) = 0, (1, 6) = 0, (1, 7) = 0, (1, 8) = 0, (1, 9) = 0, (1, 10) = 0, (1, 11) = 0, (1, 12) = 0, (1, 13) = 0, (1, 14) = 0, (2, 1) = 0, (2, 2) = 0, (2, 3) = 0, (2, 4) = 1, (2, 5) = 0, (2, 6) = 0, (2, 7) = 0, (2, 8) = 0, (2, 9) = 0, (2, 10) = 0, (2, 11) = 0, (2, 12) = 0, (2, 13) = 0, (2, 14) = 0, (3, 1) = 0, (3, 2) = 0, (3, 3) = 0, (3, 4) = 0, (3, 5) = 1, (3, 6) = 0, (3, 7) = 0, (3, 8) = 0, (3, 9) = 0, (3, 10) = 0, (3, 11) = 0, (3, 12) = 0, (3, 13) = 0, (3, 14) = 0, (4, 1) = 0, (4, 2) = 0, (4, 3) = 0, (4, 4) = 0, (4, 5) = 0, (4, 6) = 1, (4, 7) = 0, (4, 8) = 0, (4, 9) = 0, (4, 10) = 0, (4, 11) = 0, (4, 12) = 0, (4, 13) = 0, (4, 14) = 0, (5, 1) = 0, (5, 2) = 0, (5, 3) = 0, (5, 4) = 0, (5, 5) = 0, (5, 6) = 0, (5, 7) = 1, (5, 8) = 0, (5, 9) = 0, (5, 10) = 0, (5, 11) = 0, (5, 12) = 0, (5, 13) = 0, (5, 14) = 0, (6, 1) = 0, (6, 2) = 0, (6, 3) = 0, (6, 4) = 0, (6, 5) = 0, (6, 6) = 0, (6, 7) = 0, (6, 8) = 1, (6, 9) = 0, (6, 10) = 0, (6, 11) = 0, (6, 12) = 0, (6, 13) = 0, (6, 14) = 0, (7, 1) = 0, (7, 2) = 0, (7, 3) = 0, (7, 4) = 0, (7, 5) = 0, (7, 6) = 0, (7, 7) = 0, (7, 8) = 0, (7, 9) = 1, (7, 10) = 0, (7, 11) = 0, (7, 12) = 0, (7, 13) = 0, (7, 14) = 0, (8, 1) = 0, (8, 2) = 0, (8, 3) = 0, (8, 4) = 0, (8, 5) = 0, (8, 6) = 0, (8, 7) = 0, (8, 8) = 0, (8, 9) = 0, (8, 10) = 1, (8, 11) = 0, (8, 12) = 0, (8, 13) = 0, (8, 14) = 0, (9, 1) = 0, (9, 2) = 0, (9, 3) = 0, (9, 4) = 0, (9, 5) = 0, (9, 6) = 0, (9, 7) = 0, (9, 8) = 0, (9, 9) = 0, (9, 10) = 0, (9, 11) = 1, (9, 12) = 0, (9, 13) = 0, (9, 14) = 0, (10, 1) = 0, (10, 2) = 0, (10, 3) = 0, (10, 4) = 0, (10, 5) = 0, (10, 6) = 0, (10, 7) = 0, (10, 8) = 0, (10, 9) = 0, (10, 10) = 0, (10, 11) = 0, (10, 12) = 1, (10, 13) = 0, (10, 14) = 0, (11, 1) = 0, (11, 2) = 0, (11, 3) = 0, (11, 4) = 0, (11, 5) = 0, (11, 6) = 0, (11, 7) = 0, (11, 8) = 0, (11, 9) = 0, (11, 10) = 0, (11, 11) = 0, (11, 12) = 0, (11, 13) = 1, (11, 14) = 0, (12, 1) = 0, (12, 2) = 0, (12, 3) = 0, (12, 4) = 0, (12, 5) = 0, (12, 6) = 0, (12, 7) = 0, (12, 8) = 0, (12, 9) = 0, (12, 10) = 0, (12, 11) = 0, (12, 12) = 0, (12, 13) = 0, (12, 14) = 1, (13, 1) = 0, (13, 2) = 0, (13, 3) = 0, (13, 4) = 0, (13, 5) = 0, (13, 6) = 0, (13, 7) = 0, (13, 8) = 0, (13, 9) = 0, (13, 10) = 0, (13, 11) = 0, (13, 12) = 0, (13, 13) = 0, (13, 14) = 0, (14, 1) = 0, (14, 2) = 0, (14, 3) = 0, (14, 4) = 0, (14, 5) = 0, (14, 6) = 0, (14, 7) = 0, (14, 8) = 0, (14, 9) = 0, (14, 10) = 0, (14, 11) = 0, (14, 12) = 0, (14, 13) = 0, (14, 14) = 0})

(13)

lowerband := Matrix(S, S*dmax, [seq(-evalf(CCnew || n), n = 0 .. dmax-1)])

lowerband := Matrix(2, 14, {(1, 1) = -0.893343e-1, (1, 2) = 0.875645e-2, (1, 3) = -.878185, (1, 4) = 0.535149e-1, (1, 5) = -3.71351, (1, 6) = .145236, (1, 7) = -8.74318, (1, 8) = .224455, (1, 9) = -12.36499, (1, 10) = .206143, (1, 11) = -10.49630, (1, 12) = .104669, (1, 13) = -4.94965, (1, 14) = 0.224740e-1, (2, 1) = -0.864552e-2, (2, 2) = -.115162, (2, 3) = -0.776011e-1, (2, 4) = -1.10141, (2, 5) = -.282396, (2, 6) = -4.51408, (2, 7) = -.537873, (2, 8) = -10.26209, (2, 9) = -.568850, (2, 10) = -13.97156, (2, 11) = -.318088, (2, 12) = -11.39493, (2, 13) = -0.737097e-1, (2, 14) = -5.15750})

(14)

M3 := Matrix(S*dmax, S*dmax, [Matrix(S*(dmax-1), S), Matrix(S*(dmax-1), shape = identity), lowerband])

Error, (in Matrix) this entry is too tall or too short: Matrix(2, 14, {(1, 1) = -0.8933432215e-1, (1, 2) = 0.8756453086e-2, (1, 3) = -.8781848755, (1, 4) = 0.5351488825e-1, (1, 5) = -3.713506389, (1, 6) = .1452358276, (1, 7) = -8.743183575, (1, 8) = .224454831, (1, 9) = -12.36498974, (1, 10) = .2061431666, (1, 11) = -10.49629552, (1, 12) = .1046685287, (1, 13) = -4.949652167, (1, 14) = 0.2247395242e-1, (2, 1) = -0.8645515381e-2, (2, 2) = -.1151624586, (2, 3) = -0.7760109089e-1, (2, 4) = -1.101411529, (2, 5) = -.2823958356, (2, 6) = -4.514076892, (2, 7) = -.537872817, (2, 8) = -10.26209174, (2, 9) = -.5688498906, (2, 10) = -13.97155838, (2, 1...

 

``


Download Test_Block_matrix.mw

Please Wait...