|
Dear all
This is a section of my code that I am using:
***********************************************
function [objP, padN, N] = plasticMultiplierTerms(nodes, discs, c, phiDegrees,rw, a, Yw, rd, rsat);
global flag;
objP = sparse(0, 0); padN = sparse(0, 0); N = sparse(0, 0); count = 1; tan_phi = tan(pi * phiDegrees / 180);
for i = 1 : size(discs, 1);
if (discs(i, 3) < 2) % i.e. if rigid or symmetry
[eff_c eff_tanPhi] = deal(c * (discs(i, 3) ~= 1), tan_phi * (discs(i, 3) ~= 1));
[n1 n2 len] = deal(discs(i, 1), discs(i, 2), discs(i, 4));
Tensile = unsatCohesion(nodes(n1,2), nodes(n1, 3), nodes(n2,2), nodes(n2, 3), tan_phi, len, rw, a, Yw, rd, rsat);
Ts = Tensile/len;
[con var] = deal(2 * count - 1, 2 * count - 1);
N_local = [1 -1 1 -1; eff_tanPhi eff_tanPhi 1000 1000];
[N_local]
N([con con + 1], [var var + 1 1 2]) = N_local;
N([con con + 1], [var var + 1 10 10])
padN_local = sparse(2, 2 * size(discs, 1)); %All zero sparse: 2-by-12
[padN_local];
padN_local(1, 2 * i - 1) = -1;
padN_local(2, 2 * i) = -1;
padN = [padN; padN_local];
[padN];
objP = [objP eff_c * discs(i, 4) Ts*discs(i, 4) 0 0 eff_c * discs(i, 4) Ts*discs(i, 4) 0 0 ];
[objP];
count = count + 1;
end
end
***********************************
I have this( N([con con + 1], [var var + 1 1 2])) matrix and I want to equalize it to N_local matrix
N([con con + 1], [var var + 1 1 2]) = N_local;
but for the above term they are not equal. I tried to change :
N([con con + 1], [var var + 1 1 2]) to N([con con + 1], [var var + 1 2 3) , but also I got different answer comparing to N_local
could any one help me how to do this and what this term mean N([con con + 1], [var var + 1 1 2]) ?
Regards
Bestun
|