/* * This code is generated by BioUML FrameWork * for BIOMD0000000095.xml diagram at 2008.03.20 15:08:31 */ import biouml.plugins.simulation.ae.NewtonSolver; import biouml.plugins.simulation.java.JavaBaseModel; import ru.biosoft.math.MathRoutines; public class BIOMD0000000095 extends JavaBaseModel { /* * Write rules to calculate equation parameters */ /* * Write rules to calculate equation parameters excluding internal variables. */ public void __internalRateVarInitFunc_0(double time, double[] x) { rate_R1 = _cytoplasm_nucleus_*ld*q1*x[12]; rate_R10 = _cytoplasm_nucleus_*m4*x[13]/(k4 + x[13]); rate_R11 = cytoplasm*p2*x[13]; rate_R12 = cytoplasm*r3*x[3]; rate_R13 = _cytoplasm_nucleus_*r4*x[14]; rate_R14 = cytoplasm*((lmax - ld)*m5 + m6)*(x[3]/(k5 + x[3])); rate_R15 = _cytoplasm_nucleus_*((lmax - ld)*m7 + m8)*(x[14]/(k6 + x[14])); rate_R16 = _cytoplasm_nucleus_*(n3*Math.pow(x[14], d)/(Math.pow(g4, d) + Math.pow(x[14], d))); rate_R17 = _cytoplasm_nucleus_*(m9*x[15]/(k7 + x[15])); rate_R18 = cytoplasm*p3*x[15]; rate_R19 = cytoplasm*r5*x[4]; rate_R2 = _cytoplasm_nucleus_*(n1*Math.pow(x[16], a)/(Math.pow(g1, a) + Math.pow(x[16], a)))*(Math.pow(g7, h)/(Math.pow(g7, h) + Math.pow(x[9], h)))*(Math.pow(g8, i)/(Math.pow(g8, i) + Math.pow(x[11], i))); rate_R20 = _cytoplasm_nucleus_*r6*x[16]; rate_R21 = cytoplasm*m10*x[4]/(k8 + x[4]); rate_R22 = _cytoplasm_nucleus_*m11*x[16]/(k9 + x[16]); rate_R23 = _cytoplasm_nucleus_*(ld*q2*x[12] + (ld*n4 + n5)*Math.pow(g5, e)/(Math.pow(g5, e) + Math.pow(x[14], e)))*(Math.pow(g6, f)/(Math.pow(g6, f) + Math.pow(x[7], f))); rate_R24 = _cytoplasm_nucleus_*m12*x[17]/(k10 + x[17]); rate_R25 = cytoplasm*p4*x[17]; rate_R26 = cytoplasm*r7*x[5]; rate_R27 = _cytoplasm_nucleus_*r8*x[18]; rate_R28 = cytoplasm*m13*x[5]/(k11 + x[5]); rate_R29 = _cytoplasm_nucleus_*m14*x[18]/(k12 + x[18]); rate_R3 = _cytoplasm_nucleus_*m1*x[6]/(k1 + x[6]); rate_R30 = _cytoplasm_nucleus_*(lmax - ld)*p5; rate_R31a = _cytoplasm_nucleus_*m15*x[12]/(k13 + x[12]); rate_R31b = _cytoplasm_nucleus_*q3*ld*x[12]; rate_R32 = _cytoplasm_nucleus_*n6*Math.pow(x[7], j)/(Math.pow(g9, j) + Math.pow(x[7], j)); rate_R33 = _cytoplasm_nucleus_*m16*x[8]/(k14 + x[8]); rate_R34 = cytoplasm*p6*x[8]; rate_R35 = cytoplasm*r9*x[1]; rate_R36 = _cytoplasm_nucleus_*r10*x[9]; rate_R37 = cytoplasm*m17*x[1]/(k15 + x[1]); rate_R38 = _cytoplasm_nucleus_*m18*x[9]/(k16 + x[9]); rate_R39 = _cytoplasm_nucleus_*n7*Math.pow(x[7], k)/(Math.pow(g10, k) + Math.pow(x[7], k)); rate_R4 = cytoplasm*p1*x[6]; rate_R40 = _cytoplasm_nucleus_*m19*x[10]/(k17 + x[10]); rate_R41 = cytoplasm*p7*x[10]; rate_R42 = cytoplasm*r11*x[2]; rate_R43 = _cytoplasm_nucleus_*r12*x[11]; rate_R44 = cytoplasm*m20*x[2]/(k18 + x[2]); } public void __internalRateVarInitFunc_1(double time, double[] x) { rate_R45 = _cytoplasm_nucleus_*m21*x[11]/(k19 + x[11]); rate_R5 = cytoplasm*r1*x[0]; rate_R6 = _cytoplasm_nucleus_*r2*x[7]; rate_R7 = cytoplasm*m2*x[0]/(k2 + x[0]); rate_R8 = _cytoplasm_nucleus_*m3*x[7]/(k3 + x[7]); rate_R9 = _cytoplasm_nucleus_*(n2*Math.pow(x[18], b)/(Math.pow(g2, b) + Math.pow(x[18], b)))*(Math.pow(g3, c)/(Math.pow(g3, c) + Math.pow(x[7], c))); } public void Init() { initialValues = getInitialValues(); /* * Initialize variables */ _cytoplasm_nucleus_ = 1.0; // initial value of $"cytoplasm.nucleus" cytoplasm = 1.0; // initial value of $cytoplasm a = 1.8775; // initial value of a b = 1.5408; // initial value of b c = 1.4723; // initial value of c d = 4.0627; // initial value of d e = 3.5723; // initial value of e f = 2.0127; // initial value of f g1 = 11.7992; // initial value of g1 g10 = 17.7951; // initial value of g10 g2 = 8.733; // initial value of g2 g3 = 17.9887; // initial value of g3 g4 = 5.6552; // initial value of g4 g5 = 1.5091; // initial value of g5 g6 = 20.7577; // initial value of g6 g7 = 4.6434; // initial value of g7 g8 = 4.7985; // initial value of g8 g9 = 4.8052; // initial value of g9 h = 3.3286; // initial value of h i = 3.5898; // initial value of i j = 1.269; // initial value of j k = 1.5212; // initial value of k k1 = 4.1029; // initial value of k1 k10 = 16.4042; // initial value of k10 k11 = 55.7326; // initial value of k11 k12 = 9.0406; // initial value of k12 k13 = 1.2; // initial value of k13 k14 = 14.0306; // initial value of k14 k15 = 19.799; // initial value of k15 k16 = 8.7977; // initial value of k16 k17 = 16.0706; // initial value of k17 k18 = 48.4999; // initial value of k18 k19 = 57.4671; // initial value of k19 k2 = 29.5681; // initial value of k2 k3 = 18.6335; // initial value of k3 k4 = 4.7728; // initial value of k4 k5 = 3.0204; // initial value of k5 k6 = 55.3798; // initial value of k6 k7 = 29.3208; // initial value of k7 k8 = 9.5343; // initial value of k8 k9 = 45.1336; // initial value of k9 lmax = 1.0; // initial value of lmax m1 = 3.7622; // initial value of m1 m10 = 35.1982; // initial value of m10 m11 = 7.0274; // initial value of m11 m12 = 3.4563; // initial value of m12 m13 = 9.1535; // initial value of m13 m14 = 7.5549; // initial value of m14 m15 = 1.2; // initial value of m15 m16 = 10.1357; // initial value of m16 m17 = 7.2481; // initial value of m17 m18 = 7.8275; // initial value of m18 m19 = 10.1288; // initial value of m19 m2 = 22.5198; // initial value of m2 m20 = 0.5315; // initial value of m20 m21 = 8.5942; // initial value of m21 m3 = 4.5545; // initial value of m3 m4 = 7.1601; // initial value of m4 m5 = 1.5511; // initial value of m5 m6 = 1.4189; // initial value of m6 m7 = 1.6789; // initial value of m7 m8 = 11.3548; // initial value of m8 m9 = 5.7847; // initial value of m9 n1 = 1.0988; // initial value of n1 n2 = 13.5067; // initial value of n2 n3 = 1.7236; // initial value of n3 n4 = 1.8828; // initial value of n4 n5 = 1.506; // initial value of n5 n6 = 4.6039; // initial value of n6 n7 = 4.4383; // initial value of n7 p1 = 7.5408; // initial value of p1 p2 = 1.4452; // initial value of p2 p3 = 3.1473; // initial value of p3 p4 = 2.8599; // initial value of p4 p5 = 0.5; // initial value of p5 p6 = 2.0248; // initial value of p6 p7 = 1.0929; // initial value of p7 q1 = 13.1446; // initial value of q1 q2 = 12.7437; // initial value of q2 q3 = 1.0; // initial value of q3 r1 = 9.9378; // initial value of r1 r10 = 30.7684; // initial value of r10 r11 = 9.7804; // initial value of r11 r12 = 15.4577; // initial value of r12 r2 = 9.6442; // initial value of r2 r3 = 14.7607; // initial value of r3 r4 = 0.2559; // initial value of r4 r5 = 31.0081; // initial value of r5 r6 = 12.5039; // initial value of r6 r7 = 5.735; // initial value of r7 r8 = 37.3301; // initial value of r8 r9 = 3.2996; // initial value of r9 } /* * Model variables initial values */ protected double _cytoplasm_nucleus_; protected double rate_R1; protected double rate_R10; protected double rate_R11; protected double rate_R12; protected double rate_R13; protected double rate_R14; protected double rate_R15; protected double rate_R16; protected double rate_R17; protected double rate_R18; protected double rate_R19; protected double rate_R2; protected double rate_R20; protected double rate_R21; protected double rate_R22; protected double rate_R23; protected double rate_R24; protected double rate_R25; protected double rate_R26; protected double rate_R27; protected double rate_R28; protected double rate_R29; protected double rate_R3; protected double rate_R30; protected double rate_R31a; protected double rate_R31b; protected double rate_R32; protected double rate_R33; protected double rate_R34; protected double rate_R35; protected double rate_R36; protected double rate_R37; protected double rate_R38; protected double rate_R39; protected double rate_R4; protected double rate_R40; protected double rate_R41; protected double rate_R42; protected double rate_R43; protected double rate_R44; protected double rate_R45; protected double rate_R5; protected double rate_R6; protected double rate_R7; protected double rate_R8; protected double rate_R9; protected double cytoplasm; protected double a; protected double b; protected double c; protected double d; protected double e; protected double f; protected double g1; protected double g10; protected double g2; protected double g3; protected double g4; protected double g5; protected double g6; protected double g7; protected double g8; protected double g9; protected double h; protected double i; protected double j; protected double k; protected double k1; protected double k10; protected double k11; protected double k12; protected double k13; protected double k14; protected double k15; protected double k16; protected double k17; protected double k18; protected double k19; protected double k2; protected double k3; protected double k4; protected double k5; protected double k6; protected double k7; protected double k8; protected double k9; protected double ld; protected double lmax; protected double m1; protected double m10; protected double m11; protected double m12; protected double m13; protected double m14; protected double m15; protected double m16; protected double m17; protected double m18; protected double m19; protected double m2; protected double m20; protected double m21; protected double m3; protected double m4; protected double m5; protected double m6; protected double m7; protected double m8; protected double m9; protected double n1; protected double n2; protected double n3; protected double n4; protected double n5; protected double n6; protected double n7; protected double p1; protected double p2; protected double p3; protected double p4; protected double p5; protected double p6; protected double p7; protected double q1; protected double q2; protected double q3; protected double r1; protected double r10; protected double r11; protected double r12; protected double r2; protected double r3; protected double r4; protected double r5; protected double r6; protected double r7; protected double r8; protected double r9; protected double time; public double[] extendResult(double time,double [] x) { this.time = time; double[] y = new double[20]; y[0] = x[0]; y[1] = x[1]; y[2] = x[2]; y[3] = x[3]; y[4] = x[4]; y[5] = x[5]; y[6] = x[6]; y[7] = x[7]; y[8] = x[8]; y[9] = x[9]; y[10] = x[10]; y[11] = x[11]; y[12] = x[12]; y[13] = x[13]; y[14] = x[14]; y[15] = x[15]; y[16] = x[16]; y[17] = x[17]; y[18] = x[18]; y[19] = ld; return y; } public double[] getInitialValues() { double [] x = new double[19]; this.time = 0.0; x[0] = 6.7846; // - $"cytoplasm.cLc" x[1] = 20.0554; // - $"cytoplasm.cP7c" x[2] = 6.0091; // - $"cytoplasm.cP9c" x[3] = 0.1724; // - $"cytoplasm.cTc" x[4] = 13.0372; // - $"cytoplasm.cXc" x[5] = 7.075; // - $"cytoplasm.cYc" x[6] = 0.8539; // - $"cytoplasm.nucleus.cLm" x[7] = 6.8104; // - $"cytoplasm.nucleus.cLn" x[8] = 4.28; // - $"cytoplasm.nucleus.cP7m" x[9] = 2.091; // - $"cytoplasm.nucleus.cP7n" x[10] = 1.1006; // - $"cytoplasm.nucleus.cP9m" x[11] = 3.7528; // - $"cytoplasm.nucleus.cP9n" x[12] = 0.0; // - $"cytoplasm.nucleus.cPn" x[13] = 0.3717; // - $"cytoplasm.nucleus.cTm" x[14] = 8.0398; // - $"cytoplasm.nucleus.cTn" x[15] = 8.487; // - $"cytoplasm.nucleus.cXm" x[16] = 31.8995; // - $"cytoplasm.nucleus.cXn" x[17] = 0.1937; // - $"cytoplasm.nucleus.cYm" x[18] = 1.07; // - $"cytoplasm.nucleus.cYn" __internalRateVarInitFunc_0(time, x); __internalRateVarInitFunc_1(time, x); return x; } /* * code for algebraic rules calculations */ /* * end of code for algebraic rules calculations */ protected void calculateRates(double time, double[] x) { __internalRateVarInitFunc_0(time, x); __internalRateVarInitFunc_1(time, x); } /* * calculate dy/dt for 'BIOMD0000000095.xml' model */ public void __internalDyDt_0(double time, double [] x, double[] result) { result[0] = +rate_R4-rate_R5+rate_R6-rate_R7; result[1] = +rate_R34-rate_R35+rate_R36-rate_R37; result[2] = +rate_R41-rate_R42+rate_R43-rate_R44; result[3] = +rate_R11-rate_R12+rate_R13-rate_R14; result[4] = +rate_R18-rate_R19+rate_R20-rate_R21; result[5] = +rate_R25-rate_R26+rate_R27-rate_R28; result[6] = +rate_R1+rate_R2-rate_R3; result[7] = +rate_R5-rate_R6-rate_R8; result[8] = +rate_R32-rate_R33; result[9] = +rate_R35-rate_R36-rate_R38; result[10] = +rate_R39-rate_R40; result[11] = +rate_R42-rate_R43-rate_R45; result[12] = +rate_R30-rate_R31a-rate_R31b; result[13] = -rate_R10+rate_R9; result[14] = +rate_R12-rate_R13-rate_R15; result[15] = +rate_R16-rate_R17; result[16] = +rate_R19-rate_R20-rate_R22; result[17] = +rate_R23-rate_R24; result[18] = +rate_R26-rate_R27-rate_R29; } protected double [] calculateResult(double time, double[] x) { double[] result = new double[19]; __internalDyDt_0(time, x, result); return result; } public double[] dy_dt(double time, double[] x) { this.time = time; calculateRates( time,x ); return calculateResult( time,x ); } public double[] checkEvent(double time, double[] x) { this.time = time; __internalRateVarInitFunc_0(time, x); __internalRateVarInitFunc_1(time, x); double [] flags = new double[1]; flags[0] = (time > 30) ? +1 : -1; //event_0000001 return flags; } public void processEvent(int __internalVar12060041115150, double time, double[] x) { this.time = time; if ( __internalVar12060041115150 == 0) //event_0000001 { ld = 1; } } } // class ...