Ticket #1971: TestTwoOut.mo
File TestTwoOut.mo, 440 bytes (added by , 12 years ago) |
---|
Line | |
---|---|
1 | model TestTwoOut |
2 | Real out; |
3 | Real[3] si; |
4 | Real[3] so(start={0,0,0},fixed=true); |
5 | |
6 | equation |
7 | si={1,2,3}*time; |
8 | when |
9 | (sample(0,0.1)) then |
10 | (out, so) = funcTwoOut(si); |
11 | end when; |
12 | |
13 | end TestTwoOut; |
14 | |
15 | function funcTwoOut |
16 | input Real[3] inp1; |
17 | output Real out1; |
18 | output Real[3] out2; |
19 | algorithm |
20 | out2[1]:=10*inp1[1]; |
21 | out2[2]:=10*inp1[2]; |
22 | out2[3]:=10*inp1[3]; |
23 | |
24 | out1:=-(inp1[1] + inp1[2] + inp1[3]); |
25 | end funcTwoOut; |