Parent Directory | Revision Log
Corrected syntax in testcmslv. Changed instance.cpp so that residuals are not called for logrels. Added CONOPT_BOUNDLIMIT to both slv8 and slv9. Changed limits for colsta in slv9 (needs checking)
1 | REQUIRE "atoms.a4l"; |
2 | |
3 | (* |
4 | Model the solution of a piecewise-specified continuous x-y curve |
5 | |
6 | + 3 |
7 | | ' |
8 | | / (y-2)=(x-1)^2 for x > 1 |
9 | | .` ... 'parab' |
10 | + 2 .-'` |
11 | | .' |
12 | | .' y = x + 1 otherwise |
13 | |.' ... 'diag' |
14 | # 1 |
15 | # x = 0 for y < 1; |
16 | # ... 'vert' |
17 | #------+------+-----+-> |
18 | 0 1 2 3 |
19 | *) |
20 | MODEL testcmslv; |
21 | x IS_A factor; |
22 | y IS_A factor; |
23 | |
24 | vert: x = 0; |
25 | diag: y = x + 1; |
26 | parab:y - 2 = (x - 1)^2; |
27 | |
28 | CONDITIONAL |
29 | isvert: y <= 1; |
30 | isparab: x > 1; |
31 | END CONDITIONAL; |
32 | |
33 | isvertp IS_A boolean_var; |
34 | isvertp == SATISFIED(isvert); |
35 | |
36 | isparabp IS_A boolean_var; |
37 | isparabp == SATISFIED(isparab); |
38 | |
39 | WHEN (isvertp, isparabp) |
40 | CASE TRUE,FALSE: |
41 | USE vert; |
42 | CASE FALSE,TRUE: |
43 | USE parab; |
44 | OTHERWISE : |
45 | USE diag; |
46 | END WHEN; |
47 | |
48 | METHODS |
49 | METHOD default_self; |
50 | isvert := FALSE; |
51 | isparam := FALSE; |
52 | y := 0.5; |
53 | x := 0.5; |
54 | END default_self; |
55 | |
56 | METHOD values; |
57 | x := 3; |
58 | END values; |
59 | |
60 | METHOD specify; |
61 | FIX x; |
62 | END specify; |
63 | |
64 | METHOD on_load; |
65 | RUN default_self; RUN values; RUN specify; |
66 | END on_load; |
67 | |
68 | END testcmslv; |
Name | Value |
---|---|
svn:executable | * |
john.pye@anu.edu.au | ViewVC Help |
Powered by ViewVC 1.1.22 |