from .name2idx import C, V
from .reaction_network import ReactionNetwork


class DifferentialEquation(ReactionNetwork):
    def __init__(self, perturbation):
        super(DifferentialEquation, self).__init__()
        self.perturbation = perturbation

    # Refined Model
    def diffeq(self, t, y, *x):
        v = self.flux(t, y, x)

        if self.perturbation:
            for i, dv in self.perturbation.items():
                v[i] = v[i] * dv

        dydt = [0] * V.NUM

        dydt[V.dose_EGF] = -v[6] + v[7]
        dydt[V.dose_HGF] = -v[14] + v[15]
        dydt[V.RTKph] = (
            -v[43]
            + v[44]
            - v[47]
            + v[48]
            - v[53]
            + v[54]
            - v[58]
            + v[59]
            - v[63]
            + v[64]
            - v[67]
            + v[68]
            - v[71]
            + v[72]
            - v[75]
            + v[76]
            - v[80]
            + v[81]
            - v[84]
            + v[85]
        )
        dydt[V.dose_IGF1] = -v[12] + v[13]
        dydt[V.dose_HRG] = -v[10] + v[11]
        dydt[V.dose_BTC] = -v[8] + v[9]
        dydt[V.EGFR] = v[1] - v[6] + v[7] - 2.0 * v[32] - v[35] - v[36] - v[40] + v[45]
        dydt[V.EGFR_EGF] = v[6] - v[7] - 2.0 * v[16] - v[21] - v[23] - v[30]
        dydt[V.EGFR_BTC] = v[8] - v[9] - 2.0 * v[17] - v[22] - v[24] - v[25] - v[31]
        dydt[V.pEGFRd] = v[16] + v[32] - v[41]
        dydt[V.pEGFRi] = v[41] - v[42] - v[43]
        dydt[V.pEGFRi_ph] = v[43] - v[44]
        dydt[V.EGFRi] = 2.0 * v[44] - v[45] + v[64] + v[72] + v[85]
        dydt[V.ErbB2] = v[2] - 2.0 * v[18] - v[21] - v[26] - v[35] - v[37] + v[50]
        dydt[V.pErbB2] = v[18] - v[46]
        dydt[V.pErbB2i] = v[46] - v[47] - v[49]
        dydt[V.ErbB2i] = 2.0 * v[48] - v[50] + v[64] + v[68]
        dydt[V.pErbB2i_ph] = v[47] - v[48]
        dydt[V.pErbB12] = v[21] + v[35] - v[61]
        dydt[V.pErbB12i] = v[61] - v[62] - v[63]
        dydt[V.pErbB12i_ph] = v[63] - v[64]
        dydt[V.ErbB3] = v[3] - v[10] + v[11] - 2.0 * v[33] - v[36] - v[37] - v[38] + v[55]
        dydt[V.ErbB3_HRG] = v[10] - v[11] - 2.0 * v[19] - v[23] - v[26] - v[28] - v[29]
        dydt[V.pErbB3d] = v[19] + v[33] - v[51]
        dydt[V.pErbB3i] = v[51] - v[52] - v[53]
        dydt[V.pErbB3i_ph] = v[53] - v[54]
        dydt[V.ErbB3i] = 2.0 * v[54] - v[55] + v[68] + v[72] + v[81]
        dydt[V.pErbB13] = v[23] + v[36] - v[69]
        dydt[V.pErbB13i] = v[69] - v[70] - v[71]
        dydt[V.pErbB13i_ph] = v[71] - v[72]
        dydt[V.pErbB32] = v[26] + v[37] - v[65]
        dydt[V.pErbB32i] = v[65] - v[66] - v[67]
        dydt[V.pErbB32i_ph] = v[67] - v[68]
        dydt[V.IGF1R] = v[4] - v[12] + v[13] - 2.0 * v[34] + v[60]
        dydt[V.IGF1R_IGF1] = v[12] - v[13] - 2.0 * v[20]
        dydt[V.pIGF1Rd] = v[20] + v[34] - v[56]
        dydt[V.pIGF1Ri] = v[56] - v[57] - v[58]
        dydt[V.pIGF1Ri_ph] = v[58] - v[59]
        dydt[V.IGF1Ri] = 2.0 * v[59] - v[60]
        dydt[V.Met] = v[5] - v[14] + v[15] - v[28] - v[38] - 2.0 * v[39] - v[40] + v[77]
        dydt[V.Met_HGF] = v[14] - v[15] - 2.0 * v[27] - v[29] - v[30]
        dydt[V.pMetd] = v[27] + v[39] - v[73]
        dydt[V.pMeti] = v[73] - v[74] - v[75]
        dydt[V.pMeti_ph] = v[75] - v[76]
        dydt[V.Meti] = 2.0 * v[76] - v[77] + v[81] + v[85]
        dydt[V.pMetErbB3] = v[28] + v[29] + v[38] - v[78]
        dydt[V.pMetErbB3i] = v[78] - v[79] - v[80]
        dydt[V.pMetErbB3i_ph] = v[80] - v[81]
        dydt[V.pMetEGFR] = v[30] + v[40] - v[82]
        dydt[V.pMetEGFRi] = v[82] - v[83] - v[84]
        dydt[V.pMetEGFRi_ph] = v[84] - v[85]
        dydt[V.MEK] = (
            -v[86] - v[87] - v[88] - v[89] - v[90] - v[91] - v[92] - v[93] - v[94] + v[95]
        )
        dydt[V.pMEK] = (
            v[86] + v[87] + v[88] + v[89] + v[90] + v[91] + v[92] + v[93] + v[94] - v[95]
        )
        dydt[V.ERK] = -v[96] + v[97]
        dydt[V.pERK] = v[96] - v[97]
        dydt[V.AKT] = (
            -v[98] - v[99] - v[100] - v[101] - v[102] - v[103] - v[104] - v[105] - v[106] + v[107]
        )
        dydt[V.pAKT] = (
            v[98] + v[99] + v[100] + v[101] + v[102] + v[103] + v[104] + v[105] + v[106] - v[107]
        )
        dydt[V.S6K1] = -v[108] - v[109] + v[110]
        dydt[V.pS6K1] = v[108] + v[109] - v[110]
        dydt[V.S6] = -v[111] - v[112] + v[113]
        dydt[V.pS6] = v[111] + v[112] - v[113]

        return dydt


def param_values():
    x = [0] * C.NUM

    x[C.AKT_activation_pEGFR] = 1.00000000000008e-5
    x[C.AKT_activation_pErbB12] = 0.0639758596193363
    x[C.AKT_activation_pErbB13] = 13.114480220736
    x[C.AKT_activation_pErbB32] = 0.560696624171667
    x[C.AKT_activation_pIGF1R] = 0.685272879413749
    x[C.AKT_activation_pMetEGFR] = 1.00000000000016e-5
    x[C.AKT_activation_pMetErbB3] = 0.0369784304561464
    x[C.AKT_activation_pMetd] = 0.895634029510145
    x[C.AKT_internIGF1R_effect] = 1.02158595529249e-5
    x[C.EGFR_BTC_binding] = 2.24e-5
    x[C.EGFR_BTC_dimerize] = 1.00e3
    x[C.EGFR_ErbB2_BTC_dimerize] = 1.61e0
    x[C.EGFR_ErbB2_basal_act] = 1.00000055393187e-5
    x[C.EGFR_ErbB2_dimerize] = 0.0156992626983121
    x[C.EGFR_ErbB3_BTC_dimerize] = 3.52e-2
    x[C.EGFR_ErbB3_basal_act] = 7.51086344216133e-4
    x[C.EGFR_ErbB3_dimerize] = 0.00118163147147325
    x[C.EGFR_ErbB3_dimerize_noHRG] = 1.00e-5
    x[C.EGFR_basal_activation] = 1.00000000000013e-5
    x[C.EGFR_basal_recycle] = 519022.804648067
    x[C.EGFR_dimerize] = 0.0630202348036973
    x[C.EGFR_lig_binding] = 1.89365431456425e-5
    x[C.EGF_kD] = 1.0
    x[C.ERK_phosphorylation_pMEK] = 2.58273728135596e-4
    x[C.ErbB2_ErbB3_dimerize] = 0.0302521519982926
    x[C.ErbB2_dimerize] = 0.00679233180470311
    x[C.ErbB2_recycle] = 0.00657059769157574
    x[C.ErbB3_ErbB2_basal_act] = 1.00000000000009e-5
    x[C.ErbB3_basal_activation] = 0.0292989708706365
    x[C.ErbB3_basal_recycle] = 0.736644857921333
    x[C.ErbB3_dimerize] = 0.0445825815551282
    x[C.ErbB3_lig_binding] = 5.7141588472601e-5
    x[C.HGF_kD] = 0.3
    x[C.HRG_kD] = 0.05
    x[C.IGF1R_basal_activation] = 0.00117036535223592
    x[C.IGF1R_basal_recycle] = 999.999999999949
    x[C.IGF1R_dimerize] = 17.128618175105
    x[C.IGF1R_lig_binding] = 0.00152919451073767
    x[C.IGF1_kD] = 0.3
    x[C.MEK_internIGF1R_effect] = 1.00008963405935e-5
    x[C.MEK_phosphorylation_pEGFR] = 1.00000000000534e-5
    x[C.MEK_phosphorylation_pErbB12] = 0.273831131210384
    x[C.MEK_phosphorylation_pErbB13] = 1.00000000000005e-5
    x[C.MEK_phosphorylation_pErbB32] = 0.0605666784423666
    x[C.MEK_phosphorylation_pIGF1R] = 0.0299477004480249
    x[C.MEK_phosphorylation_pMetEGFR] = 1.00000000000305e-5
    x[C.MEK_phosphorylation_pMetErbB3] = 0.0383373232331984
    x[C.MEK_phosphorylation_pMetd] = 1.87982658293355
    x[C.Met_EGFR_BTC_dimerize] = 1.11e-2
    x[C.Met_EGFR_basal_act] = 1.74545892225427e-5
    x[C.Met_EGFR_dimerize] = 5.13154978177414e-4
    x[C.Met_ErbB3_basal_act] = 3.29370803896943
    x[C.Met_ErbB3_dimerize] = 0.0370817212557079
    x[C.Met_basal_act] = 1.0000000000001e-5
    x[C.Met_dimerize] = 0.00916578895965068
    x[C.Met_lig_ErbB3_dimerize] = 567.027453817882
    x[C.Met_lig_binding] = 0.00451627458718536
    x[C.Met_recycle] = 0.542441478615171
    x[C.S6K1_phosphorylation_pAKT] = 0.249792927251245
    x[C.S6K1_phosphorylation_pERK] = 1.06710979945488e-5
    x[C.S6_phosphorylation_pERK] = 1.00288673965446e-5
    x[C.S6_phosphorylation_pS6K1] = 0.00856925565136242
    x[C.feedback_pAKT] = 1.05838913850398e-5
    x[C.feedback_pERK] = 999.999999999924
    x[C.feedback_pERK_on_AKT] = 1.00256433454385e-5
    x[C.feedback_pS6K1] = 2.09124432361637e-5
    x[C.init_AKT] = 2.70857345464684
    x[C.init_EGFR] = 17.8621933083143
    x[C.init_EGFR_EGF] = 0.0
    x[C.init_ErbB2] = 5.70185166249099
    x[C.init_ErbB3] = 2.47992342696256
    x[C.init_ErbB3_HRG] = 0.0
    x[C.init_IGF1R] = 4.73494621402554
    x[C.init_IGF1R_IGF1] = 0.0
    x[C.init_MEK] = 4.2412663925898
    x[C.init_Met] = 7.90290414461229
    x[C.init_Met_HGF] = 0.0
    x[C.init_RTKph] = 0.618911491797731
    x[C.init_S6] = 145.50079875804
    x[C.init_pERK] = 0.334274838149849
    x[C.init_pS6K1] = 0.00124327830478657
    x[C.pAKT_deactivation] = 0.302953254180854
    x[C.pEGFR_degradation] = 1.00000000000008e-5
    x[C.pEGFR_internalize] = 6.23146511697858
    x[C.pEGFR_phosphatase_binding] = 184.624220936499
    x[C.pEGFRi_dephosph] = 21.7225651446297
    x[C.pERK_dephosphorylation] = 0.542612023876822
    x[C.pErbB12_degradation] = 0.181829581884234
    x[C.pErbB12_internalize] = 1.89552080394473
    x[C.pErbB12i_dephosph] = 999.999999999899
    x[C.pErbB12i_phosphatase] = 0.845257575353603
    x[C.pErbB13_degradation] = 49.7215215909086
    x[C.pErbB13_internalize] = 999.985836443242
    x[C.pErbB13i_dephosph] = 58.4184341302768
    x[C.pErbB13i_phosphatase] = 1.59502117687145e-5
    x[C.pErbB2_degradation] = 318.736400510241
    x[C.pErbB2_internalize] = 999.999999999921
    x[C.pErbB2i_dephosph] = 8.24400865276562
    x[C.pErbB2i_phosphatase] = 999.996393349007
    x[C.pErbB32_degradation] = 0.573545291738867
    x[C.pErbB32_internalize] = 1.08720273664406
    x[C.pErbB32i_dephosph] = 0.0119215988587425
    x[C.pErbB32i_phosphatase] = 0.048790203127517
    x[C.pErbB3_degradation] = 0.908458608626761
    x[C.pErbB3_internalize] = 999.999999999923
    x[C.pErbB3i_dephosph] = 16.313728223184
    x[C.pErbB3i_phosphatase] = 82.1863566077617
    x[C.pIGF1R_degradation] = 1.00000000000006e-5
    x[C.pIGF1R_internalize] = 999.999999999947
    x[C.pIGF1Ri_dephosph] = 331.686853643139
    x[C.pIGF1Ri_phosphatase] = 999.999999999777
    x[C.pMEK_dephosphorylation] = 0.328146453777363
    x[C.pMetEGFR_degradation] = 1.42534860283419
    x[C.pMetEGFR_internalize] = 1.32700039711088
    x[C.pMetEGFRi_dephosph] = 0.503783534367803
    x[C.pMetEGFRi_phosphatase] = 3.57308236526967e-5
    x[C.pMetErbB3_degradation] = 983.696417689528
    x[C.pMetErbB3_internalize] = 999.999999999785
    x[C.pMetErbB3i_dephosph] = 999.999999999949
    x[C.pMetErbB3i_phosphatase] = 999.999999999868
    x[C.pMet_degradation] = 1.9065412889509
    x[C.pMet_internalize] = 999.997342974877
    x[C.pMeti_dephosph] = 12.9849936165651
    x[C.pMeti_phosphatase] = 999.999999999902
    x[C.pS6K1_dephosphorylation] = 0.0103304388732084
    x[C.pS6_dephosphorylation] = 0.118806824178018

    x[C.offset_pAKT_CelllineA431] = 4.52e0
    x[C.offset_pAKT_CelllineACHN_197] = 2.33e3
    x[C.offset_pAKT_CelllineACHN_200] = 1.64e-3
    x[C.offset_pAKT_CelllineACHN_218] = 5.88e2
    x[C.offset_pAKT_CelllineACHN_DM] = 3.92e3
    x[C.offset_pAKT_CelllineADRr] = 4.60e0
    x[C.offset_pAKT_CelllineADRr_B] = 1.00e2
    x[C.offset_pAKT_CelllineADRr_B2] = 1.00e0
    x[C.offset_pAKT_CelllineBT20] = 1.30e1
    x[C.offset_pAKT_CelllineBxPc3] = 1.38e-1
    x[C.offset_pAKT_CelllineH322M] = 1.87e-1
    x[C.offset_pAKT_CelllineIGROV1] = 1.49e1
    x[C.offset_pEGFR_CelllineA431] = 3.39e3
    x[C.offset_pEGFR_CelllineACHN_197] = 2.53e2
    x[C.offset_pEGFR_CelllineACHN_200] = 6.94e2
    x[C.offset_pEGFR_CelllineACHN_218] = 8.60e-2
    x[C.offset_pEGFR_CelllineACHN_DM] = 1.00e5
    x[C.offset_pEGFR_CelllineADRr] = 5.08e2
    x[C.offset_pEGFR_CelllineADRr_B] = 1.80e1
    x[C.offset_pEGFR_CelllineADRr_B2] = 1.00e2
    x[C.offset_pEGFR_CelllineBT20] = 2.86e2
    x[C.offset_pEGFR_CelllineBxPc3] = 2.28e0
    x[C.offset_pEGFR_CelllineH322M] = 4.90e0
    x[C.offset_pEGFR_CelllineIGROV1] = 5.69e2
    x[C.offset_pERK_CelllineA431] = 1.00e-7
    x[C.offset_pERK_CelllineACHN_197] = 1.00e-7
    x[C.offset_pERK_CelllineACHN_200] = 1.00e-7
    x[C.offset_pERK_CelllineACHN_218] = 1.00e-7
    x[C.offset_pERK_CelllineACHN_DM] = 1.00e-7
    x[C.offset_pERK_CelllineADRr] = 1.00e-7
    x[C.offset_pERK_CelllineADRr_B] = 1.00e-7
    x[C.offset_pERK_CelllineADRr_B2] = 1.00e-7
    x[C.offset_pERK_CelllineBT20] = 1.00e-7
    x[C.offset_pERK_CelllineBxPc3] = 1.00e-7
    x[C.offset_pERK_CelllineH322M] = 1.00e-7
    x[C.offset_pERK_CelllineIGROV1] = 1.00e-7
    x[C.offset_pErbB2_CelllineA431] = 5.28e-2
    x[C.offset_pErbB2_CelllineACHN_197] = 1.62e-4
    x[C.offset_pErbB2_CelllineACHN_200] = 1.16e-5
    x[C.offset_pErbB2_CelllineACHN_218] = 8.66e4
    x[C.offset_pErbB2_CelllineACHN_DM] = 2.15e-1
    x[C.offset_pErbB2_CelllineADRr] = 1.61e2
    x[C.offset_pErbB2_CelllineADRr_B] = 2.48e3
    x[C.offset_pErbB2_CelllineADRr_B2] = 3.80e1
    x[C.offset_pErbB2_CelllineBT20] = 2.39e2
    x[C.offset_pErbB2_CelllineBxPc3] = 1.81e0
    x[C.offset_pErbB2_CelllineH322M] = 1.09e0
    x[C.offset_pErbB2_CelllineIGROV1] = 3.43e-4
    x[C.offset_pErbB3_CelllineA431] = 3.20e2
    x[C.offset_pErbB3_CelllineACHN_197] = 5.80e-2
    x[C.offset_pErbB3_CelllineACHN_200] = 1.49e-2
    x[C.offset_pErbB3_CelllineACHN_218] = 4.58e1
    x[C.offset_pErbB3_CelllineACHN_DM] = 3.88e4
    x[C.offset_pErbB3_CelllineADRr] = 2.67e1
    x[C.offset_pErbB3_CelllineADRr_B] = 4.01e-4
    x[C.offset_pErbB3_CelllineADRr_B2] = 5.00e1
    x[C.offset_pErbB3_CelllineBT20] = 1.53e-4
    x[C.offset_pErbB3_CelllineBxPc3] = 8.28e-2
    x[C.offset_pErbB3_CelllineH322M] = 1.00e-5
    x[C.offset_pErbB3_CelllineIGROV1] = 1.07e2
    x[C.offset_pIGF1R_CelllineA431] = 1.49e2
    x[C.offset_pIGF1R_CelllineACHN_197] = 8.32e-3
    x[C.offset_pIGF1R_CelllineACHN_200] = 5.25e-2
    x[C.offset_pIGF1R_CelllineACHN_218] = 6.20e3
    x[C.offset_pIGF1R_CelllineACHN_DM] = 4.92e-3
    x[C.offset_pIGF1R_CelllineADRr] = 9.90e1
    x[C.offset_pIGF1R_CelllineADRr_B] = 1.79e3
    x[C.offset_pIGF1R_CelllineADRr_B2] = 6.51e4
    x[C.offset_pIGF1R_CelllineBT20] = 9.85e1
    x[C.offset_pIGF1R_CelllineBxPc3] = 8.08e1
    x[C.offset_pIGF1R_CelllineH322M] = 4.07e2
    x[C.offset_pIGF1R_CelllineIGROV1] = 2.20e2
    x[C.offset_pMEK_CelllineA431] = 5.80e0
    x[C.offset_pMEK_CelllineACHN_197] = 3.23e4
    x[C.offset_pMEK_CelllineACHN_200] = 1.28e-2
    x[C.offset_pMEK_CelllineACHN_218] = 5.25e2
    x[C.offset_pMEK_CelllineACHN_DM] = 3.99e-1
    x[C.offset_pMEK_CelllineADRr] = 7.01e0
    x[C.offset_pMEK_CelllineADRr_B] = 7.08e-1
    x[C.offset_pMEK_CelllineADRr_B2] = 4.70e3
    x[C.offset_pMEK_CelllineBT20] = 6.82e0
    x[C.offset_pMEK_CelllineBxPc3] = 2.83e-1
    x[C.offset_pMEK_CelllineH322M] = 1.37e-1
    x[C.offset_pMEK_CelllineIGROV1] = 5.66e0
    x[C.offset_pMet_CelllineA431] = 3.78e4
    x[C.offset_pMet_CelllineACHN_197] = 5.70e3
    x[C.offset_pMet_CelllineACHN_200] = 1.74e3
    x[C.offset_pMet_CelllineACHN_218] = 9.89e2
    x[C.offset_pMet_CelllineACHN_DM] = 1.98e4
    x[C.offset_pMet_CelllineADRr] = 2.04e-2
    x[C.offset_pMet_CelllineADRr_B] = 7.31e3
    x[C.offset_pMet_CelllineADRr_B2] = 3.19e3
    x[C.offset_pMet_CelllineBT20] = 4.98e-4
    x[C.offset_pMet_CelllineBxPc3] = 3.45e0
    x[C.offset_pMet_CelllineH322M] = 3.14e-2
    x[C.offset_pMet_CelllineIGROV1] = 2.67e3
    x[C.offset_pS6K1_CelllineA431] = 1.00e-7
    x[C.offset_pS6K1_CelllineACHN_197] = 1.00e-7
    x[C.offset_pS6K1_CelllineACHN_200] = 1.00e-7
    x[C.offset_pS6K1_CelllineACHN_218] = 1.00e-7
    x[C.offset_pS6K1_CelllineACHN_DM] = 1.00e-7
    x[C.offset_pS6K1_CelllineADRr] = 1.00e-7
    x[C.offset_pS6K1_CelllineADRr_B] = 1.00e-7
    x[C.offset_pS6K1_CelllineADRr_B2] = 1.00e-7
    x[C.offset_pS6K1_CelllineBT20] = 1.00e-7
    x[C.offset_pS6K1_CelllineBxPc3] = 1.00e-7
    x[C.offset_pS6K1_CelllineH322M] = 1.00e-7
    x[C.offset_pS6K1_CelllineIGROV1] = 1.00e-7
    x[C.offset_pS6_CelllineA431] = 1.00e-7
    x[C.offset_pS6_CelllineACHN_197] = 1.00e-7
    x[C.offset_pS6_CelllineACHN_200] = 1.00e-7
    x[C.offset_pS6_CelllineACHN_218] = 1.00e-7
    x[C.offset_pS6_CelllineACHN_DM] = 1.00e-7
    x[C.offset_pS6_CelllineADRr] = 1.00e-7
    x[C.offset_pS6_CelllineADRr_B] = 1.00e-7
    x[C.offset_pS6_CelllineADRr_B2] = 1.00e-7
    x[C.offset_pS6_CelllineBT20] = 1.00e-7
    x[C.offset_pS6_CelllineBxPc3] = 1.00e-7
    x[C.offset_pS6_CelllineH322M] = 1.00e-7
    x[C.offset_pS6_CelllineIGROV1] = 1.00e-7
    x[C.offset_tEGFR_CelllineA431] = 4.19e-2
    x[C.offset_tEGFR_CelllineACHN_197] = 1.70e2
    x[C.offset_tEGFR_CelllineACHN_200] = 1.46e2
    x[C.offset_tEGFR_CelllineACHN_218] = 3.91e-2
    x[C.offset_tEGFR_CelllineACHN_DM] = 5.74e3
    x[C.offset_tEGFR_CelllineADRr] = 1.38e3
    x[C.offset_tEGFR_CelllineADRr_B] = 2.42e-1
    x[C.offset_tEGFR_CelllineADRr_B2] = 1.35e1
    x[C.offset_tEGFR_CelllineBT20] = 3.70e3
    x[C.offset_tEGFR_CelllineBxPc3] = 6.50e-4
    x[C.offset_tEGFR_CelllineH322M] = 1.46e0
    x[C.offset_tEGFR_CelllineIGROV1] = 1.17e2
    x[C.offset_tErbB2_CelllineA431] = 1.00e2
    x[C.offset_tErbB2_CelllineACHN_197] = 1.30e-1
    x[C.offset_tErbB2_CelllineACHN_200] = 3.56e3
    x[C.offset_tErbB2_CelllineACHN_218] = 8.68e4
    x[C.offset_tErbB2_CelllineACHN_DM] = 2.45e-3
    x[C.offset_tErbB2_CelllineADRr] = 1.24e2
    x[C.offset_tErbB2_CelllineADRr_B] = 1.98e0
    x[C.offset_tErbB2_CelllineADRr_B2] = 1.86e-4
    x[C.offset_tErbB2_CelllineBT20] = 1.51e1
    x[C.offset_tErbB2_CelllineBxPc3] = 2.70e0
    x[C.offset_tErbB2_CelllineH322M] = 7.91e0
    x[C.offset_tErbB2_CelllineIGROV1] = 7.19e-2
    x[C.offset_tErbB3_CelllineA431] = 1.54e2
    x[C.offset_tErbB3_CelllineACHN_197] = 2.20e-1
    x[C.offset_tErbB3_CelllineACHN_200] = 5.18e-1
    x[C.offset_tErbB3_CelllineACHN_218] = 1.93e-3
    x[C.offset_tErbB3_CelllineACHN_DM] = 8.44e-5
    x[C.offset_tErbB3_CelllineADRr] = 1.17e2
    x[C.offset_tErbB3_CelllineADRr_B] = 3.83e2
    x[C.offset_tErbB3_CelllineADRr_B2] = 1.07e4
    x[C.offset_tErbB3_CelllineBT20] = 6.46e1
    x[C.offset_tErbB3_CelllineBxPc3] = 4.88e-1
    x[C.offset_tErbB3_CelllineH322M] = 7.86e-1
    x[C.offset_tErbB3_CelllineIGROV1] = 5.93e-5
    x[C.offset_tIGF1R_CelllineA431] = 2.81e-1
    x[C.offset_tIGF1R_CelllineACHN_197] = 1.06e1
    x[C.offset_tIGF1R_CelllineACHN_200] = 2.38e1
    x[C.offset_tIGF1R_CelllineACHN_218] = 5.94e-1
    x[C.offset_tIGF1R_CelllineACHN_DM] = 7.67e-3
    x[C.offset_tIGF1R_CelllineADRr] = 2.06e-3
    x[C.offset_tIGF1R_CelllineADRr_B] = 1.36e2
    x[C.offset_tIGF1R_CelllineADRr_B2] = 5.31e-4
    x[C.offset_tIGF1R_CelllineBT20] = 2.86e-1
    x[C.offset_tIGF1R_CelllineBxPc3] = 2.20e0
    x[C.offset_tIGF1R_CelllineH322M] = 4.21e-2
    x[C.offset_tIGF1R_CelllineIGROV1] = 2.51e-4

    x[C.scale_Ligand] = 37810.0
    x[C.scale_pAKT_CelllineA431] = 7.83e0
    x[C.scale_pAKT_CelllineACHN_197] = 3.44e4
    x[C.scale_pAKT_CelllineACHN_200] = 5.18e5
    x[C.scale_pAKT_CelllineACHN_218] = 1.35e3
    x[C.scale_pAKT_CelllineACHN_DM] = 1.62e5
    x[C.scale_pAKT_CelllineADRr] = 1.31e1
    x[C.scale_pAKT_CelllineADRr_B] = 5.65e3
    x[C.scale_pAKT_CelllineADRr_B2] = 4.18e2
    x[C.scale_pAKT_CelllineBT20] = 4.38e0
    x[C.scale_pAKT_CelllineBxPc3] = 9.87e-1
    x[C.scale_pAKT_CelllineH322M] = 7.14e-1
    x[C.scale_pAKT_CelllineIGROV1] = 1.24e1
    x[C.scale_pEGFR_CelllineA431] = 7.89e2
    x[C.scale_pEGFR_CelllineACHN_197] = 9.71e4
    x[C.scale_pEGFR_CelllineACHN_200] = 3.13e-1
    x[C.scale_pEGFR_CelllineACHN_218] = 1.72e-4
    x[C.scale_pEGFR_CelllineACHN_DM] = 1.43e4
    x[C.scale_pEGFR_CelllineADRr] = 7.54e-1
    x[C.scale_pEGFR_CelllineADRr_B] = 1.41e3
    x[C.scale_pEGFR_CelllineADRr_B2] = 1.90e2
    x[C.scale_pEGFR_CelllineBT20] = 1.39e3
    x[C.scale_pEGFR_CelllineBxPc3] = 2.45e1
    x[C.scale_pEGFR_CelllineH322M] = 3.30e1
    x[C.scale_pEGFR_CelllineIGROV1] = 5.01e3
    x[C.scale_pERK_CelllineA431] = 4.18e-1
    x[C.scale_pERK_CelllineACHN_197] = 3.40e4
    x[C.scale_pERK_CelllineACHN_200] = 9.02e4
    x[C.scale_pERK_CelllineACHN_218] = 3.33e4
    x[C.scale_pERK_CelllineACHN_DM] = 4.58e4
    x[C.scale_pERK_CelllineADRr] = 8.92e-1
    x[C.scale_pERK_CelllineADRr_B] = 5.76e3
    x[C.scale_pERK_CelllineADRr_B2] = 2.26e2
    x[C.scale_pERK_CelllineBT20] = 5.72e-1
    x[C.scale_pERK_CelllineBxPc3] = 9.12e-1
    x[C.scale_pERK_CelllineH322M] = 3.85e-1
    x[C.scale_pERK_CelllineIGROV1] = 5.80e-1
    x[C.scale_pErbB2_CelllineA431] = 8.48e2
    x[C.scale_pErbB2_CelllineACHN_197] = 3.89e5
    x[C.scale_pErbB2_CelllineACHN_200] = 3.97e-2
    x[C.scale_pErbB2_CelllineACHN_218] = 2.82e5
    x[C.scale_pErbB2_CelllineACHN_DM] = 2.11e3
    x[C.scale_pErbB2_CelllineADRr] = 6.91e2
    x[C.scale_pErbB2_CelllineADRr_B] = 2.08e3
    x[C.scale_pErbB2_CelllineADRr_B2] = 8.00e1
    x[C.scale_pErbB2_CelllineBT20] = 2.97e2
    x[C.scale_pErbB2_CelllineBxPc3] = 3.79e0
    x[C.scale_pErbB2_CelllineH322M] = 5.27e0
    x[C.scale_pErbB2_CelllineIGROV1] = 6.37e2
    x[C.scale_pErbB3_CelllineA431] = 1.54e3
    x[C.scale_pErbB3_CelllineACHN_197] = 1.71e3
    x[C.scale_pErbB3_CelllineACHN_200] = 5.63e-1
    x[C.scale_pErbB3_CelllineACHN_218] = 3.95e5
    x[C.scale_pErbB3_CelllineACHN_DM] = 1.75e-3
    x[C.scale_pErbB3_CelllineADRr] = 1.02e3
    x[C.scale_pErbB3_CelllineADRr_B] = 6.75e2
    x[C.scale_pErbB3_CelllineADRr_B2] = 1.31e-4
    x[C.scale_pErbB3_CelllineBT20] = 5.42e2
    x[C.scale_pErbB3_CelllineBxPc3] = 2.76e-1
    x[C.scale_pErbB3_CelllineH322M] = 2.71e0
    x[C.scale_pErbB3_CelllineIGROV1] = 1.82e1
    x[C.scale_pIGF1R_CelllineA431] = 1.10e3
    x[C.scale_pIGF1R_CelllineACHN_197] = 6.62e2
    x[C.scale_pIGF1R_CelllineACHN_200] = 4.54e2
    x[C.scale_pIGF1R_CelllineACHN_218] = 2.31e-4
    x[C.scale_pIGF1R_CelllineACHN_DM] = 1.05e1
    x[C.scale_pIGF1R_CelllineADRr] = 1.97e2
    x[C.scale_pIGF1R_CelllineADRr_B] = 1.44e-2
    x[C.scale_pIGF1R_CelllineADRr_B2] = 2.17e5
    x[C.scale_pIGF1R_CelllineBT20] = 9.08e1
    x[C.scale_pIGF1R_CelllineBxPc3] = 3.43e2
    x[C.scale_pIGF1R_CelllineH322M] = 1.19e4
    x[C.scale_pIGF1R_CelllineIGROV1] = 2.35e3
    x[C.scale_pMEK_CelllineA431] = 2.20e3
    x[C.scale_pMEK_CelllineACHN_197] = 2.14e-4
    x[C.scale_pMEK_CelllineACHN_200] = 6.79e-4
    x[C.scale_pMEK_CelllineACHN_218] = 2.06e1
    x[C.scale_pMEK_CelllineACHN_DM] = 6.92e0
    x[C.scale_pMEK_CelllineADRr] = 6.76e-4
    x[C.scale_pMEK_CelllineADRr_B] = 4.70e2
    x[C.scale_pMEK_CelllineADRr_B2] = 2.51e3
    x[C.scale_pMEK_CelllineBT20] = 3.66e3
    x[C.scale_pMEK_CelllineBxPc3] = 1.34e3
    x[C.scale_pMEK_CelllineH322M] = 3.51e2
    x[C.scale_pMEK_CelllineIGROV1] = 7.66e3
    x[C.scale_pMet_CelllineA431] = 6.41e-3
    x[C.scale_pMet_CelllineACHN_197] = 2.83e3
    x[C.scale_pMet_CelllineACHN_200] = 2.52e3
    x[C.scale_pMet_CelllineACHN_218] = 1.24e3
    x[C.scale_pMet_CelllineACHN_DM] = 8.92e3
    x[C.scale_pMet_CelllineADRr] = 9.16e0
    x[C.scale_pMet_CelllineADRr_B] = 1.52e-2
    x[C.scale_pMet_CelllineADRr_B2] = 6.40e-2
    x[C.scale_pMet_CelllineBT20] = 9.33e-4
    x[C.scale_pMet_CelllineBxPc3] = 4.84e3
    x[C.scale_pMet_CelllineH322M] = 6.53e-3
    x[C.scale_pMet_CelllineIGROV1] = 3.61e-4
    x[C.scale_pS6K1_CelllineA431] = 5.92e-1
    x[C.scale_pS6K1_CelllineACHN_197] = 4.40e5
    x[C.scale_pS6K1_CelllineACHN_200] = 3.76e-4
    x[C.scale_pS6K1_CelllineACHN_218] = 1.71e4
    x[C.scale_pS6K1_CelllineACHN_DM] = 1.63e-1
    x[C.scale_pS6K1_CelllineADRr] = 1.39e1
    x[C.scale_pS6K1_CelllineADRr_B] = 4.00e5
    x[C.scale_pS6K1_CelllineADRr_B2] = 1.14e0
    x[C.scale_pS6K1_CelllineBT20] = 6.97e4
    x[C.scale_pS6K1_CelllineBxPc3] = 4.69e2
    x[C.scale_pS6K1_CelllineH322M] = 3.22e2
    x[C.scale_pS6K1_CelllineIGROV1] = 6.14e4
    x[C.scale_pS6_CelllineA431] = 5.45e2
    x[C.scale_pS6_CelllineACHN_197] = 2.75e2
    x[C.scale_pS6_CelllineACHN_200] = 4.86e3
    x[C.scale_pS6_CelllineACHN_218] = 2.30e5
    x[C.scale_pS6_CelllineACHN_DM] = 6.14e4
    x[C.scale_pS6_CelllineADRr] = 3.48e2
    x[C.scale_pS6_CelllineADRr_B] = 5.72e4
    x[C.scale_pS6_CelllineADRr_B2] = 1.70e0
    x[C.scale_pS6_CelllineBT20] = 2.40e2
    x[C.scale_pS6_CelllineBxPc3] = 4.10e1
    x[C.scale_pS6_CelllineH322M] = 2.65e1
    x[C.scale_pS6_CelllineIGROV1] = 2.33e2
    x[C.scale_tEGFR_CelllineA431] = 1.16e2
    x[C.scale_tEGFR_CelllineACHN_197] = 1.64e-2
    x[C.scale_tEGFR_CelllineACHN_200] = 3.71e-2
    x[C.scale_tEGFR_CelllineACHN_218] = 2.02e5
    x[C.scale_tEGFR_CelllineACHN_DM] = 2.42e3
    x[C.scale_tEGFR_CelllineADRr] = 8.24e-4
    x[C.scale_tEGFR_CelllineADRr_B] = 2.74e5
    x[C.scale_tEGFR_CelllineADRr_B2] = 2.04e4
    x[C.scale_tEGFR_CelllineBT20] = 8.20e0
    x[C.scale_tEGFR_CelllineBxPc3] = 8.62e-1
    x[C.scale_tEGFR_CelllineH322M] = 7.91e-1
    x[C.scale_tEGFR_CelllineIGROV1] = 2.57e1
    x[C.scale_tErbB2_CelllineA431] = 1.67e1
    x[C.scale_tErbB2_CelllineACHN_197] = 1.70e5
    x[C.scale_tErbB2_CelllineACHN_200] = 4.55e3
    x[C.scale_tErbB2_CelllineACHN_218] = 2.84e-4
    x[C.scale_tErbB2_CelllineACHN_DM] = 3.45e1
    x[C.scale_tErbB2_CelllineADRr] = 2.00e0
    x[C.scale_tErbB2_CelllineADRr_B] = 7.73e3
    x[C.scale_tErbB2_CelllineADRr_B2] = 3.40e4
    x[C.scale_tErbB2_CelllineBT20] = 7.52e0
    x[C.scale_tErbB2_CelllineBxPc3] = 1.00e-4
    x[C.scale_tErbB2_CelllineH322M] = 1.00e-4
    x[C.scale_tErbB2_CelllineIGROV1] = 9.41e-1
    x[C.scale_tErbB3_CelllineA431] = 4.57e1
    x[C.scale_tErbB3_CelllineACHN_197] = 3.67e3
    x[C.scale_tErbB3_CelllineACHN_200] = 4.08e0
    x[C.scale_tErbB3_CelllineACHN_218] = 9.14e-2
    x[C.scale_tErbB3_CelllineACHN_DM] = 9.27e1
    x[C.scale_tErbB3_CelllineADRr] = 1.25e0
    x[C.scale_tErbB3_CelllineADRr_B] = 6.25e1
    x[C.scale_tErbB3_CelllineADRr_B2] = 1.15e-2
    x[C.scale_tErbB3_CelllineBT20] = 9.93e-2
    x[C.scale_tErbB3_CelllineBxPc3] = 5.74e-4
    x[C.scale_tErbB3_CelllineH322M] = 3.69e-4
    x[C.scale_tErbB3_CelllineIGROV1] = 4.18e-1
    x[C.scale_tIGF1R_CelllineA431] = 2.26e1
    x[C.scale_tIGF1R_CelllineACHN_197] = 3.70e5
    x[C.scale_tIGF1R_CelllineACHN_200] = 6.73e0
    x[C.scale_tIGF1R_CelllineACHN_218] = 2.35e3
    x[C.scale_tIGF1R_CelllineACHN_DM] = 2.39e3
    x[C.scale_tIGF1R_CelllineADRr] = 2.03e1
    x[C.scale_tIGF1R_CelllineADRr_B] = 1.63e1
    x[C.scale_tIGF1R_CelllineADRr_B2] = 2.51e0
    x[C.scale_tIGF1R_CelllineBT20] = 1.08e1
    x[C.scale_tIGF1R_CelllineBxPc3] = 1.70e-5
    x[C.scale_tIGF1R_CelllineH322M] = 2.17e0
    x[C.scale_tIGF1R_CelllineIGROV1] = 1.45e1

    return x


def initial_values():
    y0 = [0] * V.NUM

    y0[V.dose_EGF] = 0.0
    y0[V.dose_HGF] = 0.0
    y0[V.RTKph] = 0.618911491797731
    y0[V.dose_IGF1] = 0.0
    y0[V.dose_HRG] = 0.0
    y0[V.dose_BTC] = 0.0
    y0[V.EGFR] = 17.8621933083143
    y0[V.EGFR_EGF] = 0.0
    y0[V.EGFR_BTC] = 0.0
    y0[V.pEGFRd] = 5.12011130278668e-4
    y0[V.pEGFRi] = 2.79223720669219e-5
    y0[V.pEGFRi_ph] = 1.4687856601509e-4
    y0[V.EGFRi] = 1.37508187561569e-8
    y0[V.ErbB2] = 5.70185166249099
    y0[V.pErbB2] = 2.20826262632109e-4
    y0[V.pErbB2i] = 2.35511421879916e-4
    y0[V.ErbB2i] = 44.4835113645705
    y0[V.pErbB2i_ph] = 0.0176807431775487
    y0[V.pErbB12] = 5.37306859494303e-4
    y0[V.pErbB12i] = 0.00144471037537624
    y0[V.pErbB12i_ph] = 7.55785246775258e-7
    y0[V.ErbB3] = 2.47992342696256
    y0[V.ErbB3_HRG] = 0.0
    y0[V.pErbB3d] = 1.8018926279905e-4
    y0[V.pErbB3i] = 0.00348026782363202
    y0[V.pErbB3i_ph] = 0.0108514486150842
    y0[V.ErbB3i] = 34.3224209878038
    y0[V.pErbB13] = 3.32712466211581e-5
    y0[V.pErbB13i] = 6.69142208681604e-4
    y0[V.pErbB13i_ph] = 1.13074197411592e-10
    y0[V.pErbB32] = 1.30059969850016e-4
    y0[V.pErbB32i] = 2.34208535412277e-4
    y0[V.pErbB32i_ph] = 5.93238579976826e-4
    y0[V.IGF1R] = 4.73494621402554
    y0[V.IGF1R_IGF1] = 0.0
    y0[V.pIGF1Rd] = 2.6239258403409e-5
    y0[V.pIGF1Ri] = 4.2395816408642e-5
    y0[V.pIGF1Ri_ph] = 7.91085256809129e-5
    y0[V.IGF1Ri] = 5.24785159589016e-5
    y0[V.Met] = 7.90290414461229
    y0[V.Met_HGF] = 0.0
    y0[V.pMetd] = 6.24560598662565e-7
    y0[V.pMeti] = 1.0060257690714e-6
    y0[V.pMeti_ph] = 4.79508059771836e-5
    y0[V.Meti] = 45.960014100956
    y0[V.pMetErbB3] = 0.0645520569171923
    y0[V.pMetErbB3i] = 0.0402793824584546
    y0[V.pMetErbB3i_ph] = 0.0249293726860515
    y0[V.pMetEGFR] = 0.00185677841647765
    y0[V.pMetEGFRi] = 0.00172863499055847
    y0[V.pMetEGFRi_ph] = 7.58806259570584e-8
    y0[V.MEK] = 4.2412663925898
    y0[V.pMEK] = 1.014543757693e-4
    y0[V.ERK] = 6922167.20947519
    y0[V.pERK] = 0.334274838149849
    y0[V.AKT] = 2.70857345464684
    y0[V.pAKT] = 0.0263677143207646
    y0[V.S6K1] = 0.00194894402116983
    y0[V.pS6K1] = 0.00124327830478657
    y0[V.S6] = 145.50079875804
    y0[V.pS6] = 0.0171533722671392

    return y0
