Steel rack joint (SRJ) hysteretic model



Matlab code:

Input parameters:

fi - trial rotation
fipr - previous rotation
Mpr - previous moment
Mg0 - positive and negative moment envelope (2x4)
fig - positive and negative rotation envelope (2x4)
Mp - pivot point moments (1x2)
fip - pivot point rotations (1x2)
koef - model coefficients k1, k2, k3, k4 (1x4)

Output parameters:

M - trial moment
Et - trial tangent stiffness
redFlag - if rotation is outside of envelope

History variables:

fiun - unloading point rotations (1x2)
fid - cumulative rotation

function [M, Et, fiun, redFlag, fid] = SRJ(fi,fipr,Mpr,fiun,Mg0,fig,Mp,fip,fid,koef)
M=0;
Et=0;
redFlag=0;
tana=koef(2)*Mg0(1,2)/fig(1,2);
ni=koef(3)*Mg0(:,2);        
fiM=1.00*(fig(1,end)-fig(2,end));
st=3;
Mg=(1-log((fid/fiM)^st+1)*koef(4)/st)*Mg0;
if fi>=fipr
    if fiun(2)==0 && fi<0
        fiun(2)=fipr;
    end
    if fi>=0
        [M, Et, redFlag]=calculatePlus(fi,Mg,fig); %obujmica
        Mnul=tana*fi+ni(1);
        Mtr=Mpr+(fi-fipr)/(fig(1,2)-fig(1,1))*(Mg0(1,2)-Mg0(1,1));
            if Mtr>Mnul && M<Mnul
                M=Mnul;
                Et=tana;
            elseif Mtr>M && Mtr<Mnul
                M=Mtr;
                Et=(Mg(1,2)-Mg(1,1))/(fig(1,2)-fig(1,1));
            end
        if fiun(1)~=0
            [Mun]=calculatePlus(fiun(1),Mg,fig);
            fidtren=koef(1)*fid;
            if koef(1)*fid>0.90*(fiun(1)-Mun/((Mun-Mp(2))/(fiun(1)-fip(2))))
                fidtren=0.90*(fiun(1)-Mun/((Mun-Mp(2))/(fiun(1)-fip(2))));
            elseif fi-koef(1)*fid<0
                fidtren=+fi;
            end          
            if fipr<0
                Mtrtr=Mpr+(-fipr)/(fig(2,2)-fig(2,1))*(Mg(2,2)-Mg(2,1)) + (fi)/(fig(1,2)-fig(1,1))*(Mg(1,2)-Mg(1,1));
            else
                Mtrtr=Mpr+(fi-fipr)/(fig(1,2)-fig(1,1))*(Mg(1,2)-Mg(1,1));
            end
            nag=(Mun-0)/(fiun(1)-fidtren);
            Mtr=0+nag*(fi-fidtren);
            Mnul=tana*fi+ni(1);
           
            if M>=Mnul && Mtr>=M %nije vise relaoding
                fiun(1)=0;
            elseif Mtrtr>Mnul && ( M<Mnul || (M>=Mnul && Mtr<Mnul) ) % na nultoj grani
                M=Mnul;
                Et=tana;
            elseif (Mun-Mpr)/(fiun(1)-fipr)>(Mg(1,2)-Mg(1,1))/(fig(1,2)-fig(1,1)) && fiun(1)>fi
                M=Mpr+(fi-fipr)*(Mun-Mpr)/(fiun(1)-fipr);
                Et=(Mun-Mpr)/(fiun(1)-fipr);
            elseif M>=Mnul && Mtr>=Mnul && ((Mg(1,2)-Mg(1,1))/(fig(1,2)-fig(1,1))<nag || (Mtrtr>=Mtr && (Mg(1,2)-Mg(1,1))/(fig(1,2)-fig(1,1))>=nag)) %reloading grana
                M=Mtr;
                Et=nag;
           
            else
                M=Mtrtr;
                Et=(Mg(1,2)-Mg(1,1))/(fig(1,2)-fig(1,1));
            end

        end
    else
        [Mun]=calculateMinus(fiun(2),Mg,fig);

        Mtr=Mpr+(fi-fipr)/(fip(1)-fiun(2))*(Mp(1)-Mun);
        Mnul=tana*fi+ni(1);
        if Mtr>Mnul
            M=Mnul;
            Et=tana;
        else
            M=Mtr;
            Et=(Mp(1)-Mun)/(fip(1)-fiun(2));
        end
    end
else
    if fiun(1)==0 && fi>0
        fiun(1)=fipr;
    end
    if fi<=0
       
        [M, Et, redFlag]=calculateMinus(fi,Mg,fig); %obujmica
        Mnul=tana*fi+ni(2);
        Mtr=Mpr+(fi-fipr)/(fig(2,2)-fig(2,1))*(Mg0(2,2)-Mg0(2,1));

            if Mtr<Mnul && M>Mnul
                M=Mnul;
                Et=tana;
            elseif Mtr<M && Mtr>Mnul
                M=Mtr;
                Et=(Mg(2,2)-Mg(2,1))/(fig(2,2)-fig(2,1));
            end
        if fiun(2)~=0
            [Mun]=calculateMinus(fiun(2),Mg,fig);
            fidtren=koef(1)*fid;

            if koef(1)*fid>-0.90*(fiun(2)-Mun/((Mun-Mp(1))/(fiun(2)-fip(1))))
                fidtren=-0.90*(fiun(2)-Mun/((Mun-Mp(1))/(fiun(2)-fip(1))));
            elseif fi+koef(1)*fid>0
                fidtren=-fi;
            end
            if fipr>0
                Mtrtr=Mpr+(-fipr)/(fig(1,2)-fig(1,1))*(Mg(1,2)-Mg(1,1)) + (fi)/(fig(2,2)-fig(2,1))*(Mg(2,2)-Mg(2,1));
            else
                Mtrtr=Mpr+(fi-fipr)/(fig(2,2)-fig(2,1))*(Mg(2,2)-Mg(2,1));
            end
            nag=(Mun-0)/(fiun(2)+fidtren);
            Mtr=nag*(fi+fidtren);
            Mnul=tana*fi+ni(2);

            if M<=Mnul && Mtr<=M
                fiun(2)=0;
            elseif Mtrtr<Mnul && ( M>Mnul || (M<=Mnul && Mtr>Mnul) )
                M=Mnul;
                Et=tana;
            elseif (Mun-Mpr)/(fiun(2)-fipr)>(Mg(2,2)-Mg(2,1))/(fig(2,2)-fig(2,1)) && fiun(2)<fi
                M=Mpr+(fi-fipr)*(Mun-Mpr)/(fiun(2)-fipr);
                Et=(Mun-Mpr)/(fiun(2)-fipr);
            elseif M<=Mnul && Mtr<=Mnul && ((Mg(2,2)-Mg(2,1))/(fig(2,2)-fig(2,1))<nag || (Mtrtr<=Mtr && (Mg(2,2)-Mg(2,1))/(fig(2,2)-fig(2,1))>=nag))
                M=Mtr;
                Et=nag;
           
            else
                M=Mtrtr;
                Et=(Mg(2,2)-Mg(2,1))/(fig(2,2)-fig(2,1));
            end

        end
    else
        [Mun]=calculatePlus(fiun(1),Mg,fig);

        Mtr=Mpr+(fi-fipr)/(fip(2)-fiun(1))*(Mp(2)-Mun);
        Mnul=tana*fi+ni(2);
        if Mtr<Mnul
            M=Mnul;
            Et=tana;
        else
            M=Mtr;
            Et=(Mp(2)-Mun)/(fip(2)-fiun(1));
        end
    end
end
fid=fid+abs(fi-fipr);

end
function [M, Et, redFlag]=calculatePlus(fi,Mg,fig)
redFlag=0;
if fi<=fig(1,2)
    M=Mg(1,1)+(fi-fig(1,1))/(fig(1,2)-fig(1,1))*(Mg(1,2)-Mg(1,1));
    Et=(Mg(1,2)-Mg(1,1))/(fig(1,2)-fig(1,1));
elseif fi<=fig(1,3)
    M=Mg(1,2)+(fi-fig(1,2))/(fig(1,3)-fig(1,2))*(Mg(1,3)-Mg(1,2));
    Et=(Mg(1,3)-Mg(1,2))/(fig(1,3)-fig(1,2));
elseif fi<=fig(1,4)
    M=Mg(1,3)+(fi-fig(1,3))/(fig(1,4)-fig(1,3))*(Mg(1,4)-Mg(1,3));
    Et=(Mg(1,4)-Mg(1,3))/(fig(1,4)-fig(1,3));
else
    M=Mg(1,4);
%     M=0;
    Et=0;
    redFlag=1;
end
end

function [M, Et, redFlag]=calculateMinus(fi,Mg,fig)
redFlag=0;
if fi>=fig(2,2)
    M=Mg(2,1)+(fi-fig(2,1))/(fig(2,2)-fig(2,1))*(Mg(2,2)-Mg(2,1));
    Et=(Mg(2,2)-Mg(2,1))/(fig(2,2)-fig(2,1));
elseif fi>=fig(2,3)
    M=Mg(2,2)+(fi-fig(2,2))/(fig(2,3)-fig(2,2))*(Mg(2,3)-Mg(2,2));
    Et=(Mg(2,3)-Mg(2,2))/(fig(2,3)-fig(2,2));
elseif fi>=fig(2,4)
    M=Mg(2,3)+(fi-fig(2,3))/(fig(2,4)-fig(2,3))*(Mg(2,4)-Mg(2,3));
    Et=(Mg(2,4)-Mg(2,3))/(fig(2,4)-fig(2,3));
else
    M=Mg(2,4);
%     M=0;
    Et=0;
    redFlag=1;
end
end

Comments