1 | package A
|
---|
2 |
|
---|
3 | package AA
|
---|
4 | model AAA
|
---|
5 | parameter Real a(start=0.1);
|
---|
6 | parameter Real L(start=0.2);
|
---|
7 | Real x;
|
---|
8 | Real u;
|
---|
9 | equation
|
---|
10 | der(x) = -a*L*x + u;
|
---|
11 | end AAA;
|
---|
12 |
|
---|
13 | partial model AAB
|
---|
14 | parameter Real area(start=0.5);
|
---|
15 | end AAB;
|
---|
16 |
|
---|
17 | model AAC
|
---|
18 | extends AAB(final area=aaa1.L+aaa2.L+aaa3.L);
|
---|
19 | AAA aaa1(a=0.7,L=0.1);
|
---|
20 | AAA aaa2(a=0.01,L=0.4);
|
---|
21 | AAA aaa3(a=0.5,L=0.1);
|
---|
22 | Real u;
|
---|
23 | Real y;
|
---|
24 | equation
|
---|
25 | u = aaa1.u;
|
---|
26 | aaa2.u = aaa1.x;
|
---|
27 | aaa3.u = aaa2.x;
|
---|
28 | y = aaa3.x;
|
---|
29 | end AAC;
|
---|
30 |
|
---|
31 | partial model AAD
|
---|
32 | replaceable AAC aac(aaa2(L=0.01),aaa3(L=0.012));
|
---|
33 | Real u;
|
---|
34 | Real y;
|
---|
35 | equation
|
---|
36 | u = aac.u;
|
---|
37 | y = aac.y;
|
---|
38 | end AAD;
|
---|
39 | end AA;
|
---|
40 |
|
---|
41 | package AB
|
---|
42 |
|
---|
43 | model ABA
|
---|
44 | extends AA.AAD(aac(aaa3(L=aac.aaa1.L)));
|
---|
45 | end ABA;
|
---|
46 |
|
---|
47 | model ABB
|
---|
48 | ABA aba;
|
---|
49 | equation
|
---|
50 | aba.u = sin(0.1*time);
|
---|
51 | end ABB;
|
---|
52 | end AB;
|
---|
53 |
|
---|
54 | end A;
|
---|