/[ascend]/trunk/models/johnpye/dopri5/aren.a4c
ViewVC logotype

Contents of /trunk/models/johnpye/dopri5/aren.a4c

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1474 - (show annotations) (download) (as text)
Mon Jun 4 13:11:05 2007 UTC (12 years, 8 months ago) by jpye
File MIME type: text/x-ascend
File size: 1044 byte(s)
'aren' model, test case for DOPRI5, added. Ongoing.
1 REQUIRE "ivpsystem.a4l";
2 REQUIRE "atoms.a4l";
3
4 IMPORT "johnpye/dopri5/dopri5";
5
6 MODEL aren;
7
8 amu, amup IS_A real_constant;
9 r1, r2, sqr IS_A factor;
10 y[0..3] IS_A factor;
11 f[0..3] IS_A factor;
12
13 amu :== 0.012277471;
14 amup :== 1.0 - amu;
15
16 ode0: f[0] = y[2];
17 ode1: f[1] = y[3];
18 sqr = y[0] + amu;
19 r1 = sqr*sqr + y[1]*y[1];
20 r1 = r1 * sqrt(r1);
21 sqr = y[0] - amup;
22 r2 = sqr*sqr + y[1]*y[1];
23 r2 = r2 * sqrt(r2);
24 ode2: f[2] = y[0] + 2.0 * y[3] - amup * (y[0]+amu) / r1 - amu * (y[0]-amup) / r2;
25 ode3: f[3] = y[1] - 2.0 * y[2] - amup * y[1] / r1 - amu * y[1] / r2;
26
27 x IS_A time;
28 METHODS
29 METHOD on_load;
30 x := 0.0 {s};
31 y[0] := 0.994;
32 y[1] := 0.0;
33 y[2] := 0.0;
34 y[3] := -2.00158510637908252240537862224;
35 (* xend = 17.0652165601579625588917206249; *)
36 FOR i IN [0..3] DO
37 y[i].ode_id := i+1;
38 y[i].ode_type := 1;
39 FIX y[i];
40 f[i].ode_id := i+1;
41 f[i].ode_type := 2;
42 y[i].obs_id := i+1;
43 END FOR;
44 x.ode_type := -1;
45 END on_load;
46 METHOD specify;
47 FREE y[0..3];
48 FIX f[0..3];
49 f[0..3] := 0;
50 END specify;
51 END aren;

john.pye@anu.edu.au
ViewVC Help
Powered by ViewVC 1.1.22