def state_events(self, t, y, yd, sw):
    event1 = np.zeros([an.params['npoints']])
    event2 = np.zeros([an.params['npoints']])
    event3 = np.zeros([an.params['nshells']])
    event4 = np.zeros([an.params['nshells']])
    for j in np.arange(0, an.params['npoints']):
        offset = (j * an.params['nVars'])
        event1[j] = y[(offset + an.ptr['V_dl'])]
        event2[j] = (1 - y[(offset + an.ptr['V_dl'])])
        for i in np.arange(0, an.params['nshells']):
            event3[i] = (y[(offset + an.ptr['X_ed'][i])] - (1 - an.params['X_Li_max']))
            event4[i] = ((1 - an.params['X_Li_min']) - y[(offset + an.ptr['X_ed'][i])])
    event5 = np.zeros([cat.params['npoints']])
    event6 = np.zeros([cat.params['npoints']])
    event7 = np.zeros([cat.params['nshells']])
    event8 = np.zeros([cat.params['nshells']])
    for j in np.arange(0, cat.params['npoints']):
        offset = (((j * cat.params['nVars']) + (an.npoints * an.nVars)) + (sep.npoints * sep.nVars))
        event5[j] = y[(offset + cat.ptr['V_dl'])]
        event6[j] = (y[(offset + cat.ptr['V_dl'])] - 5)
        for i in np.arange(0, cat.params['nshells']):
            event7[i] = (y[(offset + cat.ptr['X_ed'][i])] - (1 - cat.params['X_Li_max']))
            event8[i] = ((1 - cat.params['X_Li_min']) - y[(offset + cat.ptr['X_ed'][i])])
    event9 = np.zeros([sep.npoints])
    event10 = np.zeros([sep.npoints])
    for j in np.arange(0, sep.npoints):
        offset = (an.npoints * an.nVars)
        event9[j] = (1 - y[(offset + sep.ptr['X_elyte'])])
        event10[j] = y[(offset + sep.ptr['X_elyte'])]
    events = np.concatenate((event1, event2, event3, event4, event5, event6, event7, event8, event9, event10))
    return events
def state_events(self, t, y, yd, sw):
    event1 = np.zeros([an.params['npoints']])
    event2 = np.zeros([an.params['npoints']])
    event3 = np.zeros([an.params['nshells']])
    event4 = np.zeros([an.params['nshells']])
    for j in np.arange(0, an.params['npoints']):
        offset = (j * an.params['nVars'])
        event1[j] = y[(offset + an.ptr['V_dl'])]
        event2[j] = (1 - y[(offset + an.ptr['V_dl'])])
        for i in np.arange(0, an.params['nshells']):
            event3[i] = (y[(offset + an.ptr['X_ed'][i])] - (1 - an.params['X_Li_max']))
            event4[i] = ((1 - an.params['X_Li_min']) - y[(offset + an.ptr['X_ed'][i])])
    event5 = np.zeros([cat.params['npoints']])
    event6 = np.zeros([cat.params['npoints']])
    event7 = np.zeros([cat.params['nshells']])
    event8 = np.zeros([cat.params['nshells']])
    for j in np.arange(0, cat.params['npoints']):
        offset = (((j * cat.params['nVars']) + (an.npoints * an.nVars)) + (sep.npoints * sep.nVars))
        event5[j] = y[(offset + cat.ptr['V_dl'])]
        event6[j] = (y[(offset + cat.ptr['V_dl'])] - 5)
        for i in np.arange(0, cat.params['nshells']):
            event7[i] = (y[(offset + cat.ptr['X_ed'][i])] - (1 - cat.params['X_Li_max']))
            event8[i] = ((1 - cat.params['X_Li_min']) - y[(offset + cat.ptr['X_ed'][i])])
    event9 = np.zeros([sep.npoints])
    event10 = np.zeros([sep.npoints])
    for j in np.arange(0, sep.npoints):
        offset = (an.npoints * an.nVars)
        event9[j] = (1 - y[(offset + sep.ptr['X_elyte'])])
        event10[j] = y[(offset + sep.ptr['X_elyte'])]
    events = np.concatenate((event1, event2, event3, event4, event5, event6, event7, event8, event9, event10))
    return events