# Diff of /trunk/models/johnpye/beam.a4c

revision 838 by johnpye, Fri Sep 8 06:57:55 2006 UTC revision 839 by johnpye, Fri Sep 8 07:46:53 2006 UTC
# Line 15  MODEL beam_parameterised( Line 15  MODEL beam_parameterised(
15      a,b IS_A distance;      a,b IS_A distance;
16      a + b = L;      a + b = L;
17
18      isrightp[1..n] IS_A distance;      isrightp[1..n] IS_A boolean_var;
19
20      FOR i IN [1..n] CREATE      FOR i IN [1..n] CREATE
21          v_left[i]: v[i] = P*b/(6*E*I*L)*((L^2 - b^2)*x[i] - x[i]^3);          v_left[i]: v[i] = P*b/(6*E*I*L)*((L^2 - b^2)*x[i] - x[i]^3);
22          v_right[i]: v[i] = P*b/(6*E*I*L)*((L^2 - b^2)*x[i] - x[i]^3 + (L/b)*(x[i]-a)^3 );          v_right[i]: v[i] = P*b/(6*E*I*L)*((L^2 - b^2)*x[i] - x[i]^3 + (L/b)*(x[i]-a)^3 );
23        END FOR;
24          CONDITIONAL
25        CONDITIONAL
26            FOR i IN [1..n] CREATE
27              isright[i]: x[i] > a;              isright[i]: x[i] > a;
28          END CONDITIONAL;          END FOR;
29        END CONDITIONAL;
30
31        FOR i IN [1..n] CREATE
32          isrightp[i] == SATISFIED(isright[i]);          isrightp[i] == SATISFIED(isright[i]);
33
34          WHEN (isrightp[i])          WHEN (isrightp[i])
# Line 34  MODEL beam_parameterised( Line 38  MODEL beam_parameterised(
38                  USE v_left[i];                  USE v_left[i];
39          END WHEN;          END WHEN;
40      END FOR;      END FOR;
41    METHODS
42    METHOD specify;
43        FIX P, a, x[1..n];
44    END specify;
45    METHOD values;
46        a.upper_bound := 100 {m};
47        b.upper_bound := 100 {m};
48        L.upper_bound := 100 {m};
49    END values;
50
51  END beam_parameterised;  END beam_parameterised;
52

Legend:
 Removed from v.838 changed lines Added in v.839