I am trying to add measurement noise to a simulation. This is possible to do in for example Simulink but seems to be more difficult in Modelica and SystemModeler.
Any ideas on how to do this?
I am trying to add measurement noise to a simulation. This is possible to do in for example Simulink but seems to be more difficult in Modelica and SystemModeler.
Any ideas on how to do this?
You can add white noise in Wolfram SystemModeler via external C-code.
Modelica code (I've removed the diagram annotations from the code, so that it might be easier to read):
External code:
ext_intRandNormal.c
ext_RandNormal.c
An alternative is to use
Modelica.Blocks.Noise
to avoid writing external code yourself (added in Modelica Standard Library 3.2.2 released April 3, 2016; i.e. it would not have helped when the original question was asked).One benefit of
Modelica.Blocks.Noise
is that the tricky questions with sampling, multiple seeds, etc are solved.