-
Notifications
You must be signed in to change notification settings - Fork 296
/
Pow.mo
42 lines (40 loc) · 856 Bytes
/
Pow.mo
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
// name: Pow
// keywords: pow, exponentation, simplification, bug1161
// status: correct
//
// Test fix for bug #1161: http://openmodelica.ida.liu.se:8080/cb/issue/1161?navigation=true
//
model Pow
parameter Integer pi = 3;
parameter Real pr = 4.0;
Real i, j, k, l, m, n, o;
equation
i = 3 * (2 ^ pi);
j = 3 * (pi ^ 2);
k = 3.0 * (2 ^ pr);
l = 3.0 * (pr ^ 2);
m = (3.0 ^ pr) ^ (1/pr);
n = time ^ (2 ^ 3);
o = (time ^ 2) ^ 3;
end Pow;
// Result:
// class Pow
// parameter Integer pi = 3;
// parameter Real pr = 4.0;
// Real i;
// Real j;
// Real k;
// Real l;
// Real m;
// Real n;
// Real o;
// equation
// i = 3.0 * 2.0 ^ /*Real*/(pi);
// j = 3.0 * /*Real*/(pi) ^ 2.0;
// k = 3.0 * 2.0 ^ pr;
// l = 3.0 * pr ^ 2.0;
// m = 3.0;
// n = time ^ 8.0;
// o = abs(time) ^ 6.0;
// end Pow;
// endResult