Last change
on this file since 702 was
465,
checked in by Argimiro Resende Secchi, 15 years ago
|
Adding a new index-3 example.
|
File size:
833 bytes
|
Line | |
---|
1 | using "types"; |
---|
2 | |
---|
3 | # index-1 formulation |
---|
4 | |
---|
5 | FlowSheet index_prob |
---|
6 | PARAMETERS |
---|
7 | e as negative; |
---|
8 | |
---|
9 | VARIABLES |
---|
10 | y1 as Real; |
---|
11 | y2 as Real; |
---|
12 | x as Real; |
---|
13 | |
---|
14 | EQUATIONS |
---|
15 | diff(y1)*'s' = y2; |
---|
16 | diff(y2)*'s' = x; |
---|
17 | y1 - e*x = sin(time*'rad/s'); |
---|
18 | |
---|
19 | SET |
---|
20 | e = -0.1; # system is unstable if e > 0, and index-3 if e = 0 |
---|
21 | |
---|
22 | INITIAL |
---|
23 | # y1 = 1; # initial condition that tends to be inconsistent when e goes to zero |
---|
24 | y1 = 0; |
---|
25 | y2 = 1; |
---|
26 | |
---|
27 | OPTIONS |
---|
28 | DAESolver (File = "dasslc"); |
---|
29 | TimeStep = 0.1; |
---|
30 | TimeEnd = 10; |
---|
31 | TimeUnit = 's'; |
---|
32 | end |
---|
33 | |
---|
34 | # index-3 formulation |
---|
35 | |
---|
36 | FlowSheet index_prob2 |
---|
37 | VARIABLES |
---|
38 | y1 as Real; |
---|
39 | y2 as Real; |
---|
40 | x as Real; |
---|
41 | |
---|
42 | EQUATIONS |
---|
43 | diff(y1)*'s' = y2; |
---|
44 | diff(y2)*'s' = x; |
---|
45 | y1 = sin(time*'rad/s'); |
---|
46 | |
---|
47 | OPTIONS |
---|
48 | DAESolver (File = "dasslc"); |
---|
49 | TimeStep = 0.1; |
---|
50 | TimeEnd = 10; |
---|
51 | TimeUnit = 's'; |
---|
52 | end |
---|
Note: See
TracBrowser
for help on using the repository browser.