Hi all,
I have a problem that I cannot use the mod function in my simulation model. Whe I try to start the simulation I'm getting this error message:
Simulation failed
Did not find initial state for model:
-modTest: Undefined function 'mod'
The formula is this one: mod(4, 3)
Do you know what is wrong in my model?
Thanks a lot
Thomas
mod function not working
-
- Posts: 4
- Joined: December 19th, 2015, 12:31 pm
mod function not working
- Attachments
-
- Function
- usage.PNG (4.08 KiB) Viewed 56411 times
-
- Failure
- failure.PNG (10.66 KiB) Viewed 56411 times
-
- Site Admin
- Posts: 31
- Joined: March 11th, 2013, 3:14 pm
Re: mod function not working
Hi,
There's nothing wrong with your model, it's a bug in the tool. While waiting for a solution, you can simulate the model by using the OpenModelica solver, the solver can be switched in Window -> Preferences -> Solver. You need to have the version of the tool installed which has OpenModelica included, or you can use a custom OpenModelica installation, the installation used is selected in Window -> Preferences -> Modelica.
There's nothing wrong with your model, it's a bug in the tool. While waiting for a solution, you can simulate the model by using the OpenModelica solver, the solver can be switched in Window -> Preferences -> Solver. You need to have the version of the tool installed which has OpenModelica included, or you can use a custom OpenModelica installation, the installation used is selected in Window -> Preferences -> Modelica.
-
- Posts: 4
- Joined: December 19th, 2015, 12:31 pm
Re: mod function not working
I've used the latest version v1.9.3. But the problem still exists.
Wrote my own mod function:
This works fine.
Thanks a lot.
Wrote my own mod function:
Code: Select all
input Real a;
input Real b;
output Real z;
algorithm
z := a - floor(a/b)*b;
Thanks a lot.
-
- Site Admin
- Posts: 31
- Joined: March 11th, 2013, 3:14 pm
Re: mod function not working
The mod function is now working in the internal solver as well. It's available in the next nightly build (http://www.simantics.org/download/sysdyn/nightly/trunk/).
-
- Posts: 4
- Joined: December 19th, 2015, 12:31 pm
Re: mod function not working
Cool. Thanks a lot.
I'll try it out with the latest version![Smile :-)](./images/smilies/icon_e_smile.gif)
I'll try it out with the latest version
![Smile :-)](./images/smilies/icon_e_smile.gif)
Re: mod function not working
Is it working for you now Thomas?thomas_schlotter wrote:Cool. Thanks for suggesting these accountants in Tunbridge Wells a lot. With the latest version