/* * This code is generated by BioUML FrameWork * for BIOMD0000000074.xml diagram at 2008.03.20 15:07:55 */ import biouml.plugins.simulation.ae.NewtonSolver; import biouml.plugins.simulation.java.JavaBaseModel; import ru.biosoft.math.MathRoutines; public class BIOMD0000000074 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_reaction_0 = compartment_0*function_0(reaction_0_vsb, reaction_0_K, reaction_0_m, x[10]); rate_reaction_1 = compartment_0*function_1(reaction_1_k, x[0]); rate_reaction_10 = compartment_0*function_1(reaction_10_k, x[16]); rate_reaction_11 = compartment_0*function_2(reaction_11_V, x[18], reaction_11_Km); rate_reaction_12 = compartment_0*function_2(reaction_12_V, x[17], reaction_12_Km); rate_reaction_13 = compartment_0*(reaction_13_k1*x[13]*x[17] - reaction_13_k2*x[2]); rate_reaction_14 = compartment_0*function_2(reaction_14_V, x[2], reaction_14_Km); rate_reaction_15 = compartment_0*function_2(reaction_15_V, x[3], reaction_15_Km); rate_reaction_16 = compartment_0*(reaction_16_k1*x[2] - reaction_16_k2*x[4]); rate_reaction_17 = compartment_0*reaction_17_k1*x[6]; rate_reaction_18 = compartment_0*reaction_18_k1*x[11]; rate_reaction_19 = compartment_0*reaction_19_k1*x[5]; rate_reaction_2 = compartment_0*reaction_2_k1*x[0]; rate_reaction_20 = compartment_0*function_3(reaction_20_Vs, x[12], reaction_20_n, reaction_20_K); rate_reaction_21 = compartment_0*function_2(reaction_21_V, x[4], reaction_21_Km); rate_reaction_22 = compartment_0*reaction_22_k1*x[16]; rate_reaction_23 = compartment_0*(reaction_23_k1*x[4]*x[12] - reaction_23_k2*x[7]); rate_reaction_24 = compartment_0*function_2(reaction_24_V, x[0], reaction_24_Km); rate_reaction_25 = compartment_0*function_2(reaction_25_V, x[14], reaction_25_Km); rate_reaction_26 = compartment_0*function_2(reaction_26_V, x[16], reaction_26_Km); rate_reaction_27 = compartment_0*reaction_27_k1*x[17]; rate_reaction_28 = compartment_0*reaction_28_k1*x[13]; rate_reaction_29 = compartment_0*reaction_29_k1*x[18]; rate_reaction_3 = compartment_0*function_2(reaction_3_V, x[1], reaction_3_Km); rate_reaction_30 = compartment_0*reaction_30_k1*x[15]; rate_reaction_31 = compartment_0*reaction_31_k1*x[3]; rate_reaction_32 = compartment_0*reaction_32_k1*x[2]; rate_reaction_33 = compartment_0*function_2(reaction_33_V, x[6], reaction_33_Km); rate_reaction_34 = compartment_0*reaction_34_k1*x[1]; rate_reaction_35 = compartment_0*function_2(reaction_35_V, x[11], reaction_35_Km); rate_reaction_36 = compartment_0*function_2(reaction_36_V, x[12], reaction_36_Km); rate_reaction_37 = compartment_0*function_2(reaction_37_V, x[5], reaction_37_Km); rate_reaction_38 = compartment_0*reaction_38_k1*x[7]; rate_reaction_39 = compartment_0*function_2(reaction_39_V, x[7], reaction_39_Km); rate_reaction_4 = compartment_0*(reaction_4_k1*x[1] - reaction_4_k2*x[12]); rate_reaction_40 = compartment_0*reaction_40_k1*x[12]; rate_reaction_41 = compartment_0*function_2(reaction_41_V, x[11], reaction_41_Km); rate_reaction_42 = compartment_0*function_2(reaction_42_V, x[5], reaction_42_Km); rate_reaction_43 = compartment_0*function_2(reaction_43_V, x[15], reaction_43_Km); rate_reaction_44 = compartment_0*function_2(reaction_44_V, x[18], reaction_44_Km); } public void __internalRateVarInitFunc_1(double time, double[] x) { rate_reaction_45 = compartment_0*function_2(reaction_45_V, x[6], reaction_45_Km); rate_reaction_46 = compartment_0*reaction_46_k1*x[4]; rate_reaction_47 = compartment_0*function_2(reaction_47_V, x[3], reaction_47_Km); rate_reaction_48 = compartment_0*function_3(reaction_48_Vs, x[12], reaction_48_n, reaction_48_K); rate_reaction_49 = compartment_0*reaction_49_k1*x[8]; rate_reaction_5 = compartment_0*function_1(reaction_5_k, x[14]); rate_reaction_50 = compartment_0*function_2(reaction_50_V, x[8], reaction_50_Km); rate_reaction_51 = compartment_0*function_1(reaction_51_k, x[8]); rate_reaction_52 = compartment_0*(reaction_52_k1*x[9] - reaction_52_k2*x[10]); rate_reaction_53 = compartment_0*function_2(reaction_53_V, x[9], reaction_53_Km); rate_reaction_54 = compartment_0*reaction_54_k1*x[9]; rate_reaction_55 = compartment_0*function_2(reaction_55_V, x[10], reaction_55_Km); rate_reaction_56 = compartment_0*reaction_56_k1*x[10]; rate_reaction_6 = compartment_0*reaction_6_k1*x[14]; rate_reaction_7 = compartment_0*function_2(reaction_7_V, x[13], reaction_7_Km); rate_reaction_8 = compartment_0*function_2(reaction_8_V, x[15], reaction_8_Km); rate_reaction_9 = compartment_0*function_3(reaction_9_Vs, x[12], reaction_9_n, reaction_9_K); } public void Init() { initialValues = getInitialValues(); /* * Initialize variables */ compartment_0 = 1.0; // initial value of $compartment_0 reaction_0_K = 1.0; // initial value of reaction_0_K reaction_0_m = 2.0; // initial value of reaction_0_m reaction_0_vsb = 1.8; // initial value of reaction_0_vsb reaction_10_k = 1.2; // initial value of reaction_10_k reaction_11_Km = 0.3; // initial value of reaction_11_Km reaction_11_V = 3.4; // initial value of reaction_11_V reaction_12_Km = 1.006; // initial value of reaction_12_Km reaction_12_V = 9.6; // initial value of reaction_12_V reaction_13_k1 = 0.8; // initial value of reaction_13_k1 reaction_13_k2 = 0.4; // initial value of reaction_13_k2 reaction_14_Km = 1.006; // initial value of reaction_14_Km reaction_14_V = 2.4; // initial value of reaction_14_V reaction_15_Km = 0.3; // initial value of reaction_15_Km reaction_15_V = 1.4; // initial value of reaction_15_V reaction_16_k1 = 0.8; // initial value of reaction_16_k1 reaction_16_k2 = 0.4; // initial value of reaction_16_k2 reaction_17_k1 = 0.02; // initial value of reaction_17_k1 reaction_18_k1 = 0.02; // initial value of reaction_18_k1 reaction_19_k1 = 0.02; // initial value of reaction_19_k1 reaction_1_k = 0.32; // initial value of reaction_1_k reaction_20_K = 0.6; // initial value of reaction_20_K reaction_20_Vs = 2.2; // initial value of reaction_20_Vs reaction_20_n = 2.0; // initial value of reaction_20_n reaction_21_Km = 1.006; // initial value of reaction_21_Km reaction_21_V = 2.4; // initial value of reaction_21_V reaction_22_k1 = 0.02; // initial value of reaction_22_k1 reaction_23_k1 = 1.0; // initial value of reaction_23_k1 reaction_23_k2 = 0.2; // initial value of reaction_23_k2 reaction_24_Km = 0.4; // initial value of reaction_24_Km reaction_24_V = 1.3; // initial value of reaction_24_V reaction_25_Km = 0.4; // initial value of reaction_25_Km reaction_25_V = 2.0; // initial value of reaction_25_V reaction_26_Km = 0.3; // initial value of reaction_26_Km reaction_26_V = 2.2; // initial value of reaction_26_V reaction_27_k1 = 0.02; // initial value of reaction_27_k1 reaction_28_k1 = 0.02; // initial value of reaction_28_k1 reaction_29_k1 = 0.02; // initial value of reaction_29_k1 reaction_2_k1 = 0.02; // initial value of reaction_2_k1 reaction_30_k1 = 0.02; // initial value of reaction_30_k1 reaction_31_k1 = 0.02; // initial value of reaction_31_k1 reaction_32_k1 = 0.02; // initial value of reaction_32_k1 reaction_33_Km = 0.3; // initial value of reaction_33_Km reaction_33_V = 1.4; // initial value of reaction_33_V reaction_34_k1 = 0.02; // initial value of reaction_34_k1 reaction_35_Km = 0.3; // initial value of reaction_35_Km reaction_35_V = 3.0; // initial value of reaction_35_V reaction_36_Km = 1.006; // initial value of reaction_36_Km reaction_36_V = 1.4; // initial value of reaction_36_V reaction_37_Km = 0.3; // initial value of reaction_37_Km reaction_37_V = 3.0; // initial value of reaction_37_V reaction_38_k1 = 0.02; // initial value of reaction_38_k1 reaction_39_Km = 0.3; // initial value of reaction_39_Km reaction_39_V = 1.6; // initial value of reaction_39_V reaction_3_Km = 1.006; // initial value of reaction_3_Km reaction_3_V = 1.4; // initial value of reaction_3_V reaction_40_k1 = 0.02; // initial value of reaction_40_k1 reaction_41_Km = 0.1; // initial value of reaction_41_Km reaction_41_V = 0.2; // initial value of reaction_41_V reaction_42_Km = 0.1; // initial value of reaction_42_Km reaction_42_V = 0.4; // initial value of reaction_42_V reaction_43_Km = 0.1; // initial value of reaction_43_Km reaction_43_V = 0.2; // initial value of reaction_43_V reaction_44_Km = 0.1; // initial value of reaction_44_Km reaction_44_V = 0.6; // initial value of reaction_44_V reaction_45_Km = 0.1; // initial value of reaction_45_Km reaction_45_V = 0.2; // initial value of reaction_45_V reaction_46_k1 = 0.02; // initial value of reaction_46_k1 reaction_47_Km = 0.1; // initial value of reaction_47_Km reaction_47_V = 0.2; // initial value of reaction_47_V reaction_48_K = 0.6; // initial value of reaction_48_K reaction_48_Vs = 1.6; // initial value of reaction_48_Vs reaction_48_n = 2.0; // initial value of reaction_48_n reaction_49_k1 = 0.02; // initial value of reaction_49_k1 reaction_4_k1 = 0.8; // initial value of reaction_4_k1 reaction_4_k2 = 0.4; // initial value of reaction_4_k2 reaction_50_Km = 0.4; // initial value of reaction_50_Km reaction_50_V = 1.6; // initial value of reaction_50_V reaction_51_k = 1.7; // initial value of reaction_51_k reaction_52_k1 = 0.8; // initial value of reaction_52_k1 reaction_52_k2 = 0.4; // initial value of reaction_52_k2 reaction_53_Km = 0.3; // initial value of reaction_53_Km reaction_53_V = 4.4; // initial value of reaction_53_V reaction_54_k1 = 0.02; // initial value of reaction_54_k1 reaction_55_Km = 0.3; // initial value of reaction_55_Km reaction_55_V = 0.8; // initial value of reaction_55_V reaction_56_k1 = 0.02; // initial value of reaction_56_k1 reaction_5_k = 3.2; // initial value of reaction_5_k reaction_6_k1 = 0.02; // initial value of reaction_6_k1 reaction_7_Km = 1.006; // initial value of reaction_7_Km reaction_7_V = 1.2; // initial value of reaction_7_V reaction_8_Km = 0.3; // initial value of reaction_8_Km reaction_8_V = 1.4; // initial value of reaction_8_V reaction_9_K = 0.6; // initial value of reaction_9_K reaction_9_Vs = 2.4; // initial value of reaction_9_Vs reaction_9_n = 2.0; // initial value of reaction_9_n } /* * Model variables initial values */ protected double rate_reaction_0; protected double rate_reaction_1; protected double rate_reaction_10; protected double rate_reaction_11; protected double rate_reaction_12; protected double rate_reaction_13; protected double rate_reaction_14; protected double rate_reaction_15; protected double rate_reaction_16; protected double rate_reaction_17; protected double rate_reaction_18; protected double rate_reaction_19; protected double rate_reaction_2; protected double rate_reaction_20; protected double rate_reaction_21; protected double rate_reaction_22; protected double rate_reaction_23; protected double rate_reaction_24; protected double rate_reaction_25; protected double rate_reaction_26; protected double rate_reaction_27; protected double rate_reaction_28; protected double rate_reaction_29; protected double rate_reaction_3; protected double rate_reaction_30; protected double rate_reaction_31; protected double rate_reaction_32; protected double rate_reaction_33; protected double rate_reaction_34; protected double rate_reaction_35; protected double rate_reaction_36; protected double rate_reaction_37; protected double rate_reaction_38; protected double rate_reaction_39; protected double rate_reaction_4; protected double rate_reaction_40; protected double rate_reaction_41; protected double rate_reaction_42; protected double rate_reaction_43; protected double rate_reaction_44; protected double rate_reaction_45; protected double rate_reaction_46; protected double rate_reaction_47; protected double rate_reaction_48; protected double rate_reaction_49; protected double rate_reaction_5; protected double rate_reaction_50; protected double rate_reaction_51; protected double rate_reaction_52; protected double rate_reaction_53; protected double rate_reaction_54; protected double rate_reaction_55; protected double rate_reaction_56; protected double rate_reaction_6; protected double rate_reaction_7; protected double rate_reaction_8; protected double rate_reaction_9; protected double compartment_0; protected double reaction_0_K; protected double reaction_0_m; protected double reaction_0_vsb; protected double reaction_10_k; protected double reaction_11_Km; protected double reaction_11_V; protected double reaction_12_Km; protected double reaction_12_V; protected double reaction_13_k1; protected double reaction_13_k2; protected double reaction_14_Km; protected double reaction_14_V; protected double reaction_15_Km; protected double reaction_15_V; protected double reaction_16_k1; protected double reaction_16_k2; protected double reaction_17_k1; protected double reaction_18_k1; protected double reaction_19_k1; protected double reaction_1_k; protected double reaction_20_K; protected double reaction_20_Vs; protected double reaction_20_n; protected double reaction_21_Km; protected double reaction_21_V; protected double reaction_22_k1; protected double reaction_23_k1; protected double reaction_23_k2; protected double reaction_24_Km; protected double reaction_24_V; protected double reaction_25_Km; protected double reaction_25_V; protected double reaction_26_Km; protected double reaction_26_V; protected double reaction_27_k1; protected double reaction_28_k1; protected double reaction_29_k1; protected double reaction_2_k1; protected double reaction_30_k1; protected double reaction_31_k1; protected double reaction_32_k1; protected double reaction_33_Km; protected double reaction_33_V; protected double reaction_34_k1; protected double reaction_35_Km; protected double reaction_35_V; protected double reaction_36_Km; protected double reaction_36_V; protected double reaction_37_Km; protected double reaction_37_V; protected double reaction_38_k1; protected double reaction_39_Km; protected double reaction_39_V; protected double reaction_3_Km; protected double reaction_3_V; protected double reaction_40_k1; protected double reaction_41_Km; protected double reaction_41_V; protected double reaction_42_Km; protected double reaction_42_V; protected double reaction_43_Km; protected double reaction_43_V; protected double reaction_44_Km; protected double reaction_44_V; protected double reaction_45_Km; protected double reaction_45_V; protected double reaction_46_k1; protected double reaction_47_Km; protected double reaction_47_V; protected double reaction_48_K; protected double reaction_48_Vs; protected double reaction_48_n; protected double reaction_49_k1; protected double reaction_4_k1; protected double reaction_4_k2; protected double reaction_50_Km; protected double reaction_50_V; protected double reaction_51_k; protected double reaction_52_k1; protected double reaction_52_k2; protected double reaction_53_Km; protected double reaction_53_V; protected double reaction_54_k1; protected double reaction_55_Km; protected double reaction_55_V; protected double reaction_56_k1; protected double reaction_5_k; protected double reaction_6_k1; protected double reaction_7_Km; protected double reaction_7_V; protected double reaction_8_Km; protected double reaction_8_V; protected double reaction_9_K; protected double reaction_9_Vs; protected double reaction_9_n; public double[] extendResult(double time,double [] x) { this.time = time; double[] y = new double[19]; 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]; return y; } public double[] getInitialValues() { double [] x = new double[19]; this.time = 0.0; x[0] = 0.0; // - $"compartment_0.species_0" x[1] = 0.0; // - $"compartment_0.species_1" x[2] = 0.0; // - $"compartment_0.species_10" x[3] = 0.0; // - $"compartment_0.species_11" x[4] = 0.0; // - $"compartment_0.species_12" x[5] = 0.0; // - $"compartment_0.species_13" x[6] = 0.0; // - $"compartment_0.species_14" x[7] = 0.0; // - $"compartment_0.species_15" x[8] = 0.0; // - $"compartment_0.species_16" x[9] = 0.0; // - $"compartment_0.species_17" x[10] = 0.0; // - $"compartment_0.species_18" x[11] = 0.0; // - $"compartment_0.species_2" x[12] = 0.0; // - $"compartment_0.species_3" x[13] = 0.0; // - $"compartment_0.species_4" x[14] = 0.0; // - $"compartment_0.species_5" x[15] = 0.0; // - $"compartment_0.species_6" x[16] = 0.0; // - $"compartment_0.species_7" x[17] = 0.0; // - $"compartment_0.species_8" x[18] = 0.0; // - $"compartment_0.species_9" __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 'BIOMD0000000074.xml' model */ public void __internalDyDt_0(double time, double [] x, double[] result) { result[0] = +rate_reaction_0-rate_reaction_24-rate_reaction_2; result[1] = +rate_reaction_1-rate_reaction_34-rate_reaction_3+rate_reaction_41-rate_reaction_4; result[2] = +rate_reaction_13-rate_reaction_14-rate_reaction_16-rate_reaction_32+rate_reaction_47; result[3] = +rate_reaction_14-rate_reaction_15-rate_reaction_31-rate_reaction_47; result[4] = +rate_reaction_16-rate_reaction_21-rate_reaction_23+rate_reaction_45-rate_reaction_46; result[5] = -rate_reaction_19+rate_reaction_36-rate_reaction_37-rate_reaction_42; result[6] = -rate_reaction_17+rate_reaction_21-rate_reaction_33-rate_reaction_45; result[7] = +rate_reaction_23-rate_reaction_38-rate_reaction_39; result[8] = +rate_reaction_48-rate_reaction_49-rate_reaction_50; result[9] = +rate_reaction_51-rate_reaction_52-rate_reaction_53-rate_reaction_54; result[10] = +rate_reaction_52-rate_reaction_55-rate_reaction_56; result[11] = -rate_reaction_18-rate_reaction_35+rate_reaction_3-rate_reaction_41; result[12] = -rate_reaction_23-rate_reaction_36-rate_reaction_40+rate_reaction_42+rate_reaction_4; result[13] = -rate_reaction_13-rate_reaction_28+rate_reaction_43+rate_reaction_5-rate_reaction_7; result[14] = +rate_reaction_20-rate_reaction_25-rate_reaction_6; result[15] = -rate_reaction_30-rate_reaction_43+rate_reaction_7-rate_reaction_8; result[16] = -rate_reaction_22-rate_reaction_26+rate_reaction_9; result[17] = +rate_reaction_10-rate_reaction_12-rate_reaction_13-rate_reaction_27+rate_reaction_44; result[18] = -rate_reaction_11+rate_reaction_12-rate_reaction_29-rate_reaction_44; } 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 ); } protected double function_0(double vsb, double K, double m, double Bn) { return vsb*Math.pow(K, m)/(Math.pow(K, m) + Math.pow(Bn, m)); } protected double function_1(double k, double mRNA) { return k*mRNA; } protected double function_2(double V, double substrate, double Km) { return V*substrate/(Km + substrate); } protected double function_3(double Vs, double B, double n, double K) { return Vs*Math.pow(B, n)/(Math.pow(K, n) + Math.pow(B, n)); } } // class ...