예제 #1
0
def test_spikem_other_params():
    '''A second test to the spikem function call'''

    expected = [
        0, 0.08825, 0.09311700935788386, 0.09685159698893431,
        0.0991992569177931, 0.1, 0.09919925691779312, 0.09685159698893432,
        0.09311700935788388, 0.08825000000000001, 0.08258224755990927,
        0.07650000000000001, 158.5278077751763, 125.64238221712182,
        103.21667708005539, 85.83281031774499, 72.71496085158682,
        63.530709797013394, 57.837613417258154, 55.144704384379615,
        55.03448608299409, 57.22539602860946, 61.57402208579433,
        68.03726198260726, 76.60520647795413, 87.20450022137217,
        99.5702951997814, 113.09785228354676, 126.71440121280325,
        138.85004934065856, 147.60482326602238, 151.16176891848352,
        148.3606724284304, 139.18598403228185, 124.88288485366766,
        107.59239834710075, 89.68356050085198, 73.12059263105918,
        59.12064660008057, 48.144454302857376, 40.09901182646379,
        34.59495520516871, 31.153479011691736, 29.328319848805755,
        28.754696747133124, 29.152438175745274, 30.306902390527952,
        32.042133558618985, 34.19337452640513, 36.58251290672771,
        38.999597227115515, 41.19476002738756, 42.885948422646884,
        43.78676294385258, 43.65375537247743, 42.34384455875927,
        39.863457412696, 36.38775105932265, 32.23592977039793,
        27.80607982442992, 23.491218451913568, 19.606210623566692,
        16.34798534369971, 13.7943897966148, 11.930997852097253,
        10.688373064743423, 9.975217761611125, 9.70040004393065,
        9.783521455234014, 10.15701031281651, 10.763184439477728,
        11.548883410784677, 12.459344464684525, 13.432511933945156,
        14.394960205228703, 15.260851398736735, 15.935468898499247,
        16.324413022699744, 16.348150942017142, 15.959328062842118,
        15.1578538098714, 13.997723232447328, 12.581191420374576,
        11.040348885636647, 9.511454159523826, 8.110549702016938,
        6.917907065069279, 5.974366150954882, 5.287511246922958,
        4.842692183649987, 4.6140064233665035, 4.572355280695447,
        4.689851167750934, 4.941169992762824, 5.302845804769171,
        5.751398545409311, 6.260971438023532, 6.80104482403202,
        7.334829422701806, 7.8190524908044265, 8.205886581647531,
        8.447540472357275, 8.503378805072604, 8.348382080710664,
        7.9806412097169375, 7.425043437513394, 6.730982862377456,
        5.963913654536003, 5.193067366741936, 4.479304013419124,
        3.866831034932599, 3.3805544710045505, 3.0283748292894193,
        2.8061818339194478, 2.7031671149817393, 2.7059192577768525,
        2.8007933868994037, 2.9747331253092866, 3.214981959191631,
        3.5081197051500266
    ]

    parameters = np.array([7000, 0.75, -1.5, 11, 300, 0.1, 0.47, 14, 24])
    series = spikem(parameters, 120)
    assert_array_almost_equal(series, expected, 3)
예제 #2
0
def test_spikem():
    '''Tests if the spike m equations are correct'''
    expected = [
        0, 0.8, 0.8627851429109662, 0.9358758339363041, 0.9996576406137521,
        1.054890887159524, 1.1114450641232896, 1.1842000065551639,
        1.2910052722936263, 1.4528616437625088, 1.696414281977417,
        2.0586309773184586, 2.593780896044384, 3.383225082464748,
        4.54860877627242, 6.268251711386903, 8.794002369385312,
        12.460302244913315, 17.667725503397843, 24.811539525409312,
        34.121237747271316, 45.40152268570426, 57.74624844847561,
        69.42573207694466, 78.21132972508663, 82.20238621386368,
        80.7503567362898, 74.79090033684597, 66.29616370510696,
        57.311619921471916, 49.27031983119198, 42.8449645940599,
        38.14674424154012, 34.993429993391054, 33.10165482213525,
        32.183282742454814, 31.975882896681703, 32.240237301864475,
        32.7472305260181, 33.267394927361735, 33.571058511624535,
        33.443102630657286, 32.71121033079103, 31.27970470256318,
        29.155364365308653, 26.451567086632892, 23.365096508970865,
        20.13235741605441, 16.980735247963082, 14.090914209292103,
        11.578524261376753, 9.49447214201015, 7.83764898934411,
        6.572514253508246, 5.64579026635902, 4.999169448575787,
        4.577239625092699, 4.3312668913866625, 4.220056916888775,
        4.2091131481303785, 4.269038198499279, 4.373815732383308,
        4.499377371179227, 4.622718726586664, 4.721742497761868,
        4.775918453659146, 4.767712884338523, 4.684539654268352,
        4.520760011852747, 4.2791014903967755, 3.9708898884039976,
        3.6147559404623633, 3.233938251776802, 2.8527815830660344,
        2.493305859464687, 2.1726614062005205, 1.9019260172248724,
        1.6862248080119415, 1.5257821224867711, 1.4173721403270991,
        1.3557093511698106, 1.3345080060145784, 1.3471294010584043,
        1.3868645323953026, 1.4469594742466907, 1.5205042558425128,
        1.6002990298577877, 1.6787992114262522, 1.7482262311412862,
        1.800905621075308, 1.8298497036006731, 1.8295338736628555,
        1.7967324286029345, 1.731208585047054, 1.6360317872473857,
        1.5173548980536313, 1.383624508544958, 1.2443749455726676,
        1.1088951350450602, 0.9850907115009229, 0.8787757469547363,
        0.7934656891792443, 0.7305848589891022, 0.6899116361044938,
        0.6700786675585614, 0.668997840825105, 0.684149410637254,
        0.7127315947217855, 0.7517009637650284, 0.797748980275542,
        0.8472643805893915, 0.896330620782169, 0.9408034562887174,
        0.9765030371722414, 0.9995333395822592, 1.0067071954018507,
        0.9960117739595221, 0.9670099563090996, 0.9210569965916782,
        0.8612365510784336
    ]

    parameters = np.array([2000.0, 1.0, -1.5, 0.0, 1.0, 0.0, 0.40, 0.0, 24.0])
    series = spikem(parameters, 120)

    assert_array_almost_equal(series, expected, 3)
예제 #3
0
def test_spikem_other_params():
    '''A second test to the spikem function call'''
    
    expected = [0, 0.08825, 0.09311700935788386, 
            0.09685159698893431, 0.0991992569177931, 0.1, 
            0.09919925691779312, 0.09685159698893432, 0.09311700935788388, 
            0.08825000000000001, 0.08258224755990927, 0.07650000000000001, 
            158.5278077751763, 125.64238221712182, 103.21667708005539, 
            85.83281031774499, 72.71496085158682, 63.530709797013394, 
            57.837613417258154, 55.144704384379615, 55.03448608299409, 
            57.22539602860946, 61.57402208579433, 68.03726198260726, 
            76.60520647795413, 87.20450022137217, 99.5702951997814, 
            113.09785228354676, 126.71440121280325, 138.85004934065856, 
            147.60482326602238, 151.16176891848352, 148.3606724284304, 
            139.18598403228185, 124.88288485366766, 107.59239834710075, 
            89.68356050085198, 73.12059263105918, 59.12064660008057, 
            48.144454302857376, 40.09901182646379, 34.59495520516871, 
            31.153479011691736, 29.328319848805755, 28.754696747133124, 
            29.152438175745274, 30.306902390527952, 32.042133558618985, 
            34.19337452640513, 36.58251290672771, 38.999597227115515, 
            41.19476002738756, 42.885948422646884, 43.78676294385258, 
            43.65375537247743, 42.34384455875927, 39.863457412696, 
            36.38775105932265, 32.23592977039793, 27.80607982442992, 
            23.491218451913568, 19.606210623566692, 16.34798534369971, 
            13.7943897966148, 11.930997852097253, 10.688373064743423, 
            9.975217761611125, 9.70040004393065, 9.783521455234014, 
            10.15701031281651, 10.763184439477728, 11.548883410784677, 
            12.459344464684525, 13.432511933945156, 14.394960205228703, 
            15.260851398736735, 15.935468898499247, 16.324413022699744, 
            16.348150942017142, 15.959328062842118, 15.1578538098714, 
            13.997723232447328, 12.581191420374576, 11.040348885636647, 
            9.511454159523826, 8.110549702016938, 6.917907065069279, 
            5.974366150954882, 5.287511246922958, 4.842692183649987, 
            4.6140064233665035, 4.572355280695447, 4.689851167750934, 
            4.941169992762824, 5.302845804769171, 5.751398545409311, 
            6.260971438023532, 6.80104482403202, 7.334829422701806, 
            7.8190524908044265, 8.205886581647531, 8.447540472357275, 
            8.503378805072604, 8.348382080710664, 7.9806412097169375, 
            7.425043437513394, 6.730982862377456, 5.963913654536003, 
            5.193067366741936, 4.479304013419124, 3.866831034932599, 
            3.3805544710045505, 3.0283748292894193, 2.8061818339194478, 
            2.7031671149817393, 2.7059192577768525, 2.8007933868994037, 
            2.9747331253092866, 3.214981959191631, 3.5081197051500266]

    parameters = np.array([7000, 0.75, -1.5, 11, 300, 0.1, 0.47, 14, 24])
    series = spikem(parameters, 120)
    assert_array_almost_equal(series, expected, 3)
예제 #4
0
def test_spikem():
    '''Tests if the spike m equations are correct'''
    expected = [0, 0.8, 0.8627851429109662, 0.9358758339363041, 
            0.9996576406137521, 1.054890887159524, 1.1114450641232896, 
            1.1842000065551639, 1.2910052722936263, 1.4528616437625088, 
            1.696414281977417, 2.0586309773184586, 2.593780896044384, 
            3.383225082464748, 4.54860877627242, 6.268251711386903, 
            8.794002369385312, 12.460302244913315, 17.667725503397843, 
            24.811539525409312, 34.121237747271316, 45.40152268570426, 
            57.74624844847561, 69.42573207694466, 78.21132972508663, 
            82.20238621386368, 80.7503567362898, 74.79090033684597, 
            66.29616370510696, 57.311619921471916, 49.27031983119198, 
            42.8449645940599, 38.14674424154012, 34.993429993391054, 
            33.10165482213525, 32.183282742454814, 31.975882896681703, 
            32.240237301864475, 32.7472305260181, 33.267394927361735, 
            33.571058511624535, 33.443102630657286, 32.71121033079103, 
            31.27970470256318, 29.155364365308653, 26.451567086632892, 
            23.365096508970865, 20.13235741605441, 16.980735247963082, 
            14.090914209292103, 11.578524261376753, 9.49447214201015, 
            7.83764898934411, 6.572514253508246, 5.64579026635902, 
            4.999169448575787, 4.577239625092699, 4.3312668913866625, 
            4.220056916888775, 4.2091131481303785, 4.269038198499279, 
            4.373815732383308, 4.499377371179227, 4.622718726586664, 
            4.721742497761868, 4.775918453659146, 4.767712884338523, 
            4.684539654268352, 4.520760011852747, 4.2791014903967755, 
            3.9708898884039976, 3.6147559404623633, 3.233938251776802, 
            2.8527815830660344, 2.493305859464687, 2.1726614062005205, 
            1.9019260172248724, 1.6862248080119415, 1.5257821224867711, 
            1.4173721403270991, 1.3557093511698106, 1.3345080060145784, 
            1.3471294010584043, 1.3868645323953026, 1.4469594742466907, 
            1.5205042558425128, 1.6002990298577877, 1.6787992114262522, 
            1.7482262311412862, 1.800905621075308, 1.8298497036006731, 
            1.8295338736628555, 1.7967324286029345, 1.731208585047054, 
            1.6360317872473857, 1.5173548980536313, 1.383624508544958, 
            1.2443749455726676, 1.1088951350450602, 0.9850907115009229, 
            0.8787757469547363, 0.7934656891792443, 0.7305848589891022, 
            0.6899116361044938, 0.6700786675585614, 0.668997840825105, 
            0.684149410637254, 0.7127315947217855, 0.7517009637650284, 
            0.797748980275542, 0.8472643805893915, 0.896330620782169, 
            0.9408034562887174, 0.9765030371722414, 0.9995333395822592, 
            1.0067071954018507, 0.9960117739595221, 0.9670099563090996, 
            0.9210569965916782, 0.8612365510784336]
    
    parameters = np.array([2000.0, 1.0, -1.5, 0.0, 1.0, 0.0, 0.40, 0.0, 24.0])
    series = spikem(parameters, 120)
    
    assert_array_almost_equal(series, expected, 3)