
%%%%%%%% START OF SDOF IDA %%%%%
clear all
nGM=40;
accFolder='GMset';
OSpath='C:\Program Files\Tcl\OpenSees\OpenSees246x32.exe'; 
    
IDAdata.dPGA=0.025; % Initial PGA value for which IDA is performed (e.g. 0.05)
IDAdata.maxPoints=15; % Maximum number of additional seismic responses (between the points which were calculated for the determiantion of capacity point) for construction of IDA curves (e.g. 15)
IDAdata.dPGAc=0.0125; % tolerance (in g) for the estimation of capacity point in terms of PGA (e.g 0.0125)


SDOFdata.m= 100 ; % mass of SDOF system in tons
SDOFdata.F=[100 100 0.01]; % forces of the F-U envelope of SDOF system in [kN]
SDOFdata.D=[0.05 0.4 0.8]; % displacements of the F-U envelope of SDOF system in [m]
SDOFdata.T=2.0;  % period of SDOF model


SDOFdata.hysteretic=[0 0 0 0 0.8]; % parameters of hysteretic backbone [pinchx pinchy damage1 damage2 beta]
SDOFdata.Collapse=SDOFdata.D(3); % displacement until which IDA is performed

ACCdata.name=([accFolder '/gmr1.acc']);

racDT=load([accFolder '/DT.acc']);
ACCdata.dt=racDT(1);
alfaM=0.8888;
SDOFdata.dynamic=[ACCdata.dt/2 alfaM 0 0 0]; % [tInteg alfaM betaK betaKcomm betaKinit]

akc=load([accFolder '/gmr1.acc']);
[spekter]=spec(akc, 0.05, racDT(k), [0 SDOFdata.T(1)]'); %celoten spekter za akcelerogram
betaSaT1=spekter(2)/spekter(1);
    

[SDOFIDAresult1]=SDOFIDAanalysis(OSpath,SDOFdata,ACCdata,IDAdata);
SDOFIDAresult1.IMSa =SDOFIDAresult1.IM*betaSaT1;


