/[ascend]/trunk/models/johnpye/newton.a4c
ViewVC logotype

Diff of /trunk/models/johnpye/newton.a4c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 962 by johnpye, Mon Dec 11 14:43:02 2006 UTC revision 963 by johnpye, Tue Dec 12 13:36:52 2006 UTC
# Line 2  REQUIRE "ivpsystem.a4l"; Line 2  REQUIRE "ivpsystem.a4l";
2  REQUIRE "atoms.a4l";  REQUIRE "atoms.a4l";
3    
4  (*  (*
5      Simple dynamic model of object under gravity (for use in test suite)      Simple dynamic model of object under gravity (for use in test suite).
6        We expect an inverted parabola. Check that after the expected elapsed time,
7        x returns to its starting value and velocity is the negative of the starting
8        value.
9  *)  *)
10  MODEL newton;  MODEL newton;
11      x IS_A distance;      x IS_A distance;
12      dx_dt IS_A speed;      dx_dt IS_A speed;
13      v IS_A speed;      v IS_A speed;
14      dv_dt IS_A acceleration;      dv_dt IS_A acceleration;
15      g IS_A gravity_constant;      g IS_A real_constant;
16      g :== 1{EARTH_G};      g :== 10{N/kg};
17    
18      xderiv: dx_dt = v;      xderiv: dx_dt = v;
19      vderiv: dv_dt = -g;      vderiv: dv_dt = -g;
# Line 33  METHOD ode_init; Line 36  METHOD ode_init;
36      t.ode_type := -1; t := 0 {s};      t.ode_type := -1; t := 0 {s};
37      dx_dt.ode_id := 1; x.ode_id := 1; dx_dt.ode_type := 2; x.ode_type := 1;      dx_dt.ode_id := 1; x.ode_id := 1; dx_dt.ode_type := 2; x.ode_type := 1;
38      dv_dt.ode_id := 2; v.ode_id := 2; dv_dt.ode_type := 2; v.ode_type := 1;      dv_dt.ode_id := 2; v.ode_id := 2; dv_dt.ode_type := 2; v.ode_type := 1;
39      x.obs_id := 1;      t.obs_id := 1;
40      v.obs_id := 2;      x.obs_id := 2;
41      dv_dt.obs_id := 3;      v.obs_id := 3;
42        dv_dt.obs_id := 4;
43      v.ode_atol := 1e-8;      v.ode_atol := 1e-8;
44      x.ode_atol := 1e-8;      x.ode_atol := 1e-8;
45  END ode_init;  END ode_init;

Legend:
Removed from v.962  
changed lines
  Added in v.963

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