Parent Directory | Revision Log
Removed some debug output from cond_config.c Added superposition test (beam2.a4c) Fixed up problems in beam.a4c (ongoing).
1 | johnpye | 839 | REQUIRE "johnpye/beam.a4c"; |
2 | |||
3 | (* | ||
4 | Simple superposition of two loads | ||
5 | *) | ||
6 | |||
7 | MODEL beam2; | ||
8 | |||
9 | n IS_A integer_constant; | ||
10 | n:== 2; | ||
11 | |||
12 | E IS_A youngs_modulus; | ||
13 | I IS_A second_moment_of_area; | ||
14 | L IS_A distance; | ||
15 | |||
16 | B[1..2] IS_A beam_parameterised(n,E,I,L); | ||
17 | |||
18 | P1 ALIASES B[1].P; | ||
19 | a1 ALIASES B[1].a; | ||
20 | P2 ALIASES B[2].P; | ||
21 | a2 ALIASES B[2].a; | ||
22 | |||
23 | v[1..n] IS_A distance; | ||
24 | x[1..n] IS_A distance; | ||
25 | FOR i IN [1..n] CREATE | ||
26 | B[1..n].x[i], x[i] ARE_THE_SAME; | ||
27 | v[i] = SUM[B[j].v[i] | j IN [1..2]]; | ||
28 | END FOR; | ||
29 | |||
30 | METHODS | ||
31 | METHOD specify; | ||
32 | RUN B[1..n].specify; | ||
33 | FIX E,I,L; | ||
34 | END specify; | ||
35 | |||
36 | METHOD values; | ||
37 | RUN B[1..n].values; | ||
38 | E := 200 {GPa}; | ||
39 | I := 0.5e6{mm^4}; | ||
40 | L := 3 {m}; | ||
41 | P1 := 10 {kN}; a1 := 1 {m}; | ||
42 | P2 := 10 {kN}; a2 := 2 {m}; | ||
43 | x[1] := 1{m}; | ||
44 | x[2] := 2{m}; | ||
45 | END values; | ||
46 | |||
47 | METHOD on_load; | ||
48 | RUN reset; RUN values; | ||
49 | END on_load; | ||
50 | |||
51 | END beam2; |
john.pye@anu.edu.au | ViewVC Help |
Powered by ViewVC 1.1.22 |