/* * This code is generated by BioUML FrameWork * for BIOMD0000000001.xml diagram at 2008.03.20 15:03:06 */ import biouml.plugins.simulation.ae.NewtonSolver; import biouml.plugins.simulation.java.JavaBaseModel; import ru.biosoft.math.MathRoutines; public class BIOMD0000000001 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_React0 = comp1*(kf_0*(x[2]/comp1) - kr_0*(x[9]/comp1)); rate_React1 = comp1*(kf_1*(x[9]/comp1) - kr_1*(x[3]/comp1)); rate_React10 = comp1*(kf_10*(x[8]/comp1) - kr_10*(x[11]/comp1)); rate_React11 = comp1*(kf_11*(x[1]/comp1) - kr_11*(x[7]/comp1)); rate_React12 = comp1*(kf_12*(x[4]/comp1) - kr_12*(x[10]/comp1)); rate_React13 = comp1*(kf_13*(x[10]/comp1) - kr_13*(x[5]/comp1)); rate_React14 = comp1*(kf_14*(x[6]/comp1) - kr_14*(x[4]/comp1)); rate_React15 = comp1*(kf_15*(x[11]/comp1) - kr_15*(x[10]/comp1)); rate_React16 = comp1*(kf_16*(x[7]/comp1) - kr_16*(x[5]/comp1)); rate_React2 = comp1*(kf_2*(x[3]/comp1) - kr_2*(x[1]/comp1)); rate_React3 = comp1*(kf_3*(x[0]/comp1) - kr_3*(x[8]/comp1)); rate_React4 = comp1*(kf_4*(x[8]/comp1) - kr_4*(x[1]/comp1)); rate_React5 = comp1*(kf_5*(x[2]/comp1) - kr_5*(x[0]/comp1)); rate_React6 = comp1*(kf_6*(x[9]/comp1) - kr_6*(x[8]/comp1)); rate_React7 = comp1*(kf_7*(x[6]/comp1) - kr_7*(x[11]/comp1)); rate_React8 = comp1*(kf_8*(x[11]/comp1) - kr_8*(x[7]/comp1)); rate_React9 = comp1*(kf_9*(x[0]/comp1) - kr_9*(x[6]/comp1)); } public void Init() { initialValues = getInitialValues(); /* * Initialize variables */ comp1 = 1.0E-16; // initial value of $comp1 kf_0 = 3000.0; // initial value of kf_0 kf_1 = 1500.0; // initial value of kf_1 kf_10 = 19.85; // initial value of kf_10 kf_11 = 20.0; // initial value of kf_11 kf_12 = 3000.0; // initial value of kf_12 kf_13 = 1500.0; // initial value of kf_13 kf_14 = 0.05; // initial value of kf_14 kf_15 = 0.05; // initial value of kf_15 kf_16 = 0.05; // initial value of kf_16 kf_2 = 30000.0; // initial value of kf_2 kf_3 = 3000.0; // initial value of kf_3 kf_4 = 1500.0; // initial value of kf_4 kf_5 = 0.54; // initial value of kf_5 kf_6 = 130.0; // initial value of kf_6 kf_7 = 3000.0; // initial value of kf_7 kf_8 = 1500.0; // initial value of kf_8 kf_9 = 19.7; // initial value of kf_9 kr_0 = 8000.0; // initial value of kr_0 kr_1 = 16000.0; // initial value of kr_1 kr_10 = 1.74; // initial value of kr_10 kr_11 = 0.81; // initial value of kr_11 kr_12 = 4.0; // initial value of kr_12 kr_13 = 8.0; // initial value of kr_13 kr_14 = 0.0012; // initial value of kr_14 kr_15 = 0.0012; // initial value of kr_15 kr_16 = 0.0012; // initial value of kr_16 kr_2 = 700.0; // initial value of kr_2 kr_3 = 8.64; // initial value of kr_3 kr_4 = 17.28; // initial value of kr_4 kr_5 = 10800.0; // initial value of kr_5 kr_6 = 2740.0; // initial value of kr_6 kr_7 = 4.0; // initial value of kr_7 kr_8 = 8.0; // initial value of kr_8 kr_9 = 3.74; // initial value of kr_9 t2 = 20.0; // initial value of t2 } /* * Model variables initial values */ protected double rate_React0; protected double rate_React1; protected double rate_React10; protected double rate_React11; protected double rate_React12; protected double rate_React13; protected double rate_React14; protected double rate_React15; protected double rate_React16; protected double rate_React2; protected double rate_React3; protected double rate_React4; protected double rate_React5; protected double rate_React6; protected double rate_React7; protected double rate_React8; protected double rate_React9; protected double comp1; protected double kf_0; protected double kf_1; protected double kf_10; protected double kf_11; protected double kf_12; protected double kf_13; protected double kf_14; protected double kf_15; protected double kf_16; protected double kf_2; protected double kf_3; protected double kf_4; protected double kf_5; protected double kf_6; protected double kf_7; protected double kf_8; protected double kf_9; protected double kr_0; protected double kr_1; protected double kr_10; protected double kr_11; protected double kr_12; protected double kr_13; protected double kr_14; protected double kr_15; protected double kr_16; protected double kr_2; protected double kr_3; protected double kr_4; protected double kr_5; protected double kr_6; protected double kr_7; protected double kr_8; protected double kr_9; protected double t2; 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] = kf_0; y[13] = kf_1; y[14] = kf_12; y[15] = kf_13; y[16] = kf_3; y[17] = kf_4; y[18] = kf_7; y[19] = kf_8; return y; } public double[] getInitialValues() { double [] x = new double[12]; this.time = 0.0; x[0] = 0.0; // - $"comp1.A" x[1] = 0.0; // - $"comp1.ALL" x[2] = 1.66057788110262E-21; // - $"comp1.B" x[3] = 0.0; // - $"comp1.BLL" x[4] = 0.0; // - $"comp1.D" x[5] = 0.0; // - $"comp1.DLL" x[6] = 0.0; // - $"comp1.I" x[7] = 0.0; // - $"comp1.ILL" x[8] = 0.0; // - $comp1.AL x[9] = 0.0; // - $comp1.BL x[10] = 0.0; // - $comp1.DL x[11] = 0.0; // - $comp1.IL __internalRateVarInitFunc_0(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); } /* * calculate dy/dt for 'BIOMD0000000001.xml' model */ public void __internalDyDt_0(double time, double [] x, double[] result) { result[0] = -rate_React3+rate_React5-rate_React9; result[1] = -rate_React11+rate_React2+rate_React4; result[2] = -rate_React0-rate_React5; result[3] = +rate_React1-rate_React2; result[4] = -rate_React12+rate_React14; result[5] = +rate_React13+rate_React16; result[6] = -rate_React14-rate_React7+rate_React9; result[7] = +rate_React11-rate_React16+rate_React8; result[8] = -rate_React10+rate_React3-rate_React4+rate_React6; result[9] = +rate_React0-rate_React1-rate_React6; result[10] = +rate_React12-rate_React13+rate_React15; result[11] = +rate_React10-rate_React15+rate_React7-rate_React8; } protected double [] calculateResult(double time, double[] x) { double[] result = new double[12]; __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); double [] flags = new double[1]; flags[0] = (time > t2) ? +1 : -1; //RemovalACh return flags; } public void processEvent(int __internalVar12060037864530, double time, double[] x) { this.time = time; if ( __internalVar12060037864530 == 0) //RemovalACh { kf_0 = 0.0; kf_3 = 0.0; kf_7 = 0.0; kf_12 = 0.0; kf_1 = 0.0; kf_4 = 0.0; kf_8 = 0.0; kf_13 = 0.0; } } } // class ...