- Index
- » Usage and Applications
- » OpenModelica Usage and Applications
- » when-end when
Page Start Prev 1 Next End
when-end when
when-end when
Jul-01-15 01:51:16
Hi There,
I do assign boolean value to variable with when command.
such as below sample.
Code:
when condition1 then
x = true;
end when;
and then i want to re-assign new value with new condition.
Code:
when condition2 then
x = false;
end when;
But OM give me this error. " Error: Model is structurally singular, error found sorting equations "
How can re-assign x value after when condition.
Thanks
Oki
Re: when-end when
Jul-01-15 04:36:37
You need to use elsewhen. Otherwise, if condition1 and condition2 become true at the same time, you have two different assignments to x.
- sjoelund.se
- 1700 Posts
Page Start Prev 1 Next End
- Index
- » Usage and Applications
- » OpenModelica Usage and Applications
- » when-end when
There are 0 guests and 0 other users also viewing this topic