cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - When posting, your subject should be specific and summarize your question. Here are some additional tips on asking a great question. X

Forming of consolidation matrix

TikkaMasala
11-Garnet

Forming of consolidation matrix

Hello

I'm trying to form a consolidation matrix to compute one-dimensional soil consolidation (settlement).

The matrix is formed by taking values from values from previous columns and rows of the matrix and

I don't get this to work.

In the matrix the horizontal axis ( j ) represents time steps and the vertical axis different depth nodes ( i ).

Each node point is a value of

, where the multiplier ct/z^2 is repleced by factor beta.

The values in the  first column are given u0

The first row should be only 0 -values

and the last row should be determined by function

Thank you for your help.

ACCEPTED SOLUTION

Accepted Solutions
Werner_E
25-Diamond I
(To:TikkaMasala)

The error occurs because your block with four if statements does not cover all possibilities. If i=0 only the cases j=0 and j=1 are covered. i=0 and j=2 throws the error.

If you fix this, you get another error because you are using u_0 like a 2D-matrix, accessing the second column values which don't exist because u_0 is just a one column vector. I guess a couple of u_0's where meant to be u.all's.

BTW, you have defined u_0 as a 1x1 matrix containing a 9x1 vector. Guess this was not done on purpose. You should use the literal index for u.0 and I think it was meant to be a 8x1 vector only.

But the next problem would be waiting around the corner. To calculate a matrix element you need to already know the three elements to its left in the current, the previous and the next row. So you can only build up the matrix column by column. The way you nested your two loops would try to build the matrix row by row, which will fail, because you try to use values from the next row which not already exist. You have to switch inner and outer loop (simply switch i and j 😉

WE

View solution in original post

3 REPLIES 3
Werner_E
25-Diamond I
(To:TikkaMasala)

The error occurs because your block with four if statements does not cover all possibilities. If i=0 only the cases j=0 and j=1 are covered. i=0 and j=2 throws the error.

If you fix this, you get another error because you are using u_0 like a 2D-matrix, accessing the second column values which don't exist because u_0 is just a one column vector. I guess a couple of u_0's where meant to be u.all's.

BTW, you have defined u_0 as a 1x1 matrix containing a 9x1 vector. Guess this was not done on purpose. You should use the literal index for u.0 and I think it was meant to be a 8x1 vector only.

But the next problem would be waiting around the corner. To calculate a matrix element you need to already know the three elements to its left in the current, the previous and the next row. So you can only build up the matrix column by column. The way you nested your two loops would try to build the matrix row by row, which will fail, because you try to use values from the next row which not already exist. You have to switch inner and outer loop (simply switch i and j 😉

WE

Thank you for your review and advices, I think I got it working now!

Werner_E
25-Diamond I
(To:TikkaMasala)

I think you also had two errors in the indices in your equations.

Hope the attached sheet does what you intend.

Announcements

Top Tags