Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Belonging to [master]: - OpenModelica/OMCompiler#3011 - OpenModelica/OpenModelica-testsuite#1151
- Loading branch information
1 parent
3c40164
commit f193e07
Showing
3 changed files
with
83 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
// name: When7 | ||
// keywords: | ||
// status: correct | ||
// cflags: -d=newInst | ||
// | ||
// | ||
|
||
model When7 | ||
Real x; | ||
equation | ||
when time > 0 then | ||
x = 1; | ||
elsewhen time > 1 then | ||
reinit(x, 2); | ||
end when; | ||
end When7; | ||
|
||
// Result: | ||
// class When7 | ||
// Real x; | ||
// equation | ||
// when time > 0.0 then | ||
// x = 1.0; | ||
// elsewhen time > 1.0 then | ||
// reinit(x, 2.0); | ||
// end when; | ||
// end When7; | ||
// endResult |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
// name: When8 | ||
// keywords: | ||
// status: correct | ||
// cflags: -d=newInst | ||
// | ||
// | ||
|
||
model When8 | ||
Real x[3]; | ||
Real y; | ||
Real z[3]; | ||
equation | ||
when time > 0 then | ||
x = {1, 2, 3}; | ||
y = 2; | ||
z = {4, 5, 6}; | ||
elsewhen time > 1 then | ||
x[1:2] = {3, 2}; | ||
x[3] = 5; | ||
z = {9, 8, 7}; | ||
y = 4; | ||
end when; | ||
end When8; | ||
|
||
// Result: | ||
// class When8 | ||
// Real x[1]; | ||
// Real x[2]; | ||
// Real x[3]; | ||
// Real y; | ||
// Real z[1]; | ||
// Real z[2]; | ||
// Real z[3]; | ||
// equation | ||
// when time > 0.0 then | ||
// x[1] = 1.0; | ||
// x[2] = 2.0; | ||
// x[3] = 3.0; | ||
// y = 2.0; | ||
// z[1] = 4.0; | ||
// z[2] = 5.0; | ||
// z[3] = 6.0; | ||
// elsewhen time > 1.0 then | ||
// x[1] = 3.0; | ||
// x[2] = 2.0; | ||
// x[3] = 5.0; | ||
// z[1] = 9.0; | ||
// z[2] = 8.0; | ||
// z[3] = 7.0; | ||
// y = 4.0; | ||
// end when; | ||
// end When8; | ||
// endResult |