Hi every one. I want to use staggered grid to write MATLAB code about viscoelastic fluid. You suppose I have a 10×14 node at x and y direction. I have initial value for conformation tensor as A=[1 , 0 ;0  1]

I should allocate this value for all grids as matrix.  Then It should calculate eigen values of A matrix and also its normalized vectors. Then put eigen values in matrix as diagonal matrix as "Lamda".

Then Z= RT *Lambda*R

Which RT is the transpose of normalazed matrix of A.

Now I do not know how should I define matrix (A) as the input , that the new one will replace with the previous in the loop.

I defined as this:

A (i,j)=eye(2)

Or

A11(i,j)=1, A12(i,j)0 , A21(i,j)=0 , A22(i,j)=1

But it gives error about dimension.

If I define A=eye(2), how MATLAB understand put this value in each node and in the next step replace it with new one which the value can be different from each grid to other one.

Because it just gives me a 2×2 matrix.

More Hamideh Rouhanitazangi's questions See All
Similar questions and discussions