REQUIRE "ivpsystem.a4l"; REQUIRE "atoms.a4l"; (* ASCEND model based on the 'idadenx.c' example problem that accompanies IDA. The root-finding part isn't yet implemented though. ---------------------------------------------------------------------------- This simple example problem for IDA, due to Robertson, is from chemical kinetics, and consists of the following three equations: dy1/dt = -.04*y1 + 1.e4*y2*y3 dy2/dt = .04*y1 - 1.e4*y2*y3 - 3.e7*y2**2 0 = y1 + y2 + y3 - 1 on the interval from t = 0.0 to t = 4.e10, with initial conditions: y1 = 1, y2 = y3 = 0. This model is tested (using the same parameters as used by idadenx.c) by the script pygtk/test.py. *) MODEL idadenx; y1, y2, y3 IS_A factor; dy1_dt IS_A factor; dy2_dt IS_A factor; eq1: dy1_dt = -0.04 * y1 + 1e4 * y2*y3; eq2: dy2_dt = +0.04 * y1 - 1e4 * y2*y3 - 3e7*y2^2; eq3: 0 = y1 + y2 + y3 - 1; t IS_A time; METHODS METHOD values; (* initial values *) y1 := 1; y2 := 0; y3 := 0; t := 0 {s}; END values; METHOD specify; FIX y1, y2; END specify; METHOD ode_init; FREE y1, y2; t.ode_type := -1; t := 0 {s}; dy1_dt.ode_id := 1; dy1_dt.ode_type := 2; y1.ode_id := 1; y1.ode_type := 1; dy2_dt.ode_id := 2; dy2_dt.ode_type := 2; y2.ode_id := 2; y2.ode_type := 1; (* y3.ode_id := 3; *) t.obs_id := 1; y1.obs_id := 2; y2.obs_id := 3; y3.obs_id := 4; dy1_dt.obs_id := 5; dy2_dt.obs_id := 6; y1.ode_atol := 1e-8; y2.ode_atol := 1e-14; y3.ode_atol := 1e-6; END ode_init; METHOD on_load; RUN reset; RUN values; RUN ode_init; END on_load; END idadenx;