EL-Centro Earthquake 1940 N-S response analysis
by Nasser Abbasi

Remove["Global`*"];
SetDirectory["E:/nabbasi/data/nabbasi_web_Page/my_courses/UCI_\
COURSES/CREDIT_COURSES/fall_2006/CEE_247/HWs/HW4"];

Load El-Centro data and plot the earthquack recorded accelration

data = 
        Import["el_centro.txt", "Table"];
dataLength = 8 Length[data];

    
g = Table[{0, 0}, {dataLength}];
t = Table[0, {dataLength}];
u = Table[{0, 0}, {dataLength}];
v = Table[{0, 0}, {dataLength}];
acc = Table[{0, 0}, {dataLength}];

    
delT = 0.02;   
k = 
      0;
currentTime = 0;
For[i = 1, i ≤ Length[data], 
        i = i + 1, 
For[j = 1, j ≤ 8, 
          j = j + 1, 
{
k = 
              k + 1; 

g[[k, 1]] = 
              currentTime; 
u[[k, 1]] = 
              currentTime; 
v[[k, 1]] = 
              currentTime; 
acc[[k, 1]] = 
              currentTime; 

g[[k, 
                  2]] = 
              data[[i, 
                  j]]; 

currentTime = 
              currentTime + 
                delT;
}
]
];

    
ListPlot[g, PlotJoined -> True, PlotRange -> All, 
        AxesLabel -> {"Time sec", "Acc. g"}, 
        PlotLabel -> "El centro earthquack 1940 N-S"];

Implementation of Linear Accelration step-by-step algorithm

u[[1, 2]] = 0. ;

    v[[1, 2]] = 0. ;

    acc[[1, 2]] = 0. ;


    ξ = 0.05;

    ω = π;


    gConversionFactor = 32.174*12;


    For[i = 1, i < dataLength, 
        i = i + 1, 
{
delg = (g[[i + 
                        1, 2]] - 
                  g[[i, 
                      2]])  gConversionFactor; 
delU = (1/((ω^2) + 
                    (6/(delT^2)) + ((3*2 ξ ω)/( delT)))) (-delg + (6/delT) v[[i, 2]] + 3 acc[[i, 2]] + 
                  2 ξ ω (3 v[[i, 2]] + (delT/2) 
                          acc[[i, 
                              2]])); 

u[[i + 1, 2]] = 
            u[[i, 2]] + 
              delU; 

delV = (3/delT) 
                delU - 3 v[[i, 2]] - (delT/2) 
                acc[[i, 
                    2]]; 

v[[i + 1, 
                2]] = 
            v[[i, 2]] + delV; 
delAcc = -delg - 
              2 ξ ω delV - (ω^2) delU; 
acc[[i + 1, 2]] = 
            acc[[i, 2]] + 
              delAcc;
}
];

Plot results

\(\(ListPlot[u, PlotJoined -> True, PlotRange -> All, 
        AxesLabel -> {"Time sec", "u(t) inch"}, 
        PlotLabel -> "Displacment from El centro earthquack 1940 N-S"];\)\)

ListPlot[v, PlotJoined -> True, PlotRange -> All, 
        AxesLabel -> {"Time sec", "v(t) in/sec"}, 
        PlotLabel -> "speed from El centro earthquack 1940 N-S"];

ListPlot[acc/(32*12), PlotJoined -> True, 
        PlotRange -> All, 
        AxesLabel -> {"Time sec", "acc(t) g"}, 
        PlotLabel -> "accelaration from El centro earthquack 1940 \
N-S"];