Question: How to implement normal distributed noise in maplesim

Hi

I am trying to implement normally distributed noise into a maplesim simulation. I thought this would be done most easily thru adding a modelica custom component. There are some examples to go on on the web however Modelica are not really good at explaining there implementation. 

The code for my implemented block can be seen below. 

 

model Noise2
    import MBI = Modelica.Blocks.Interfaces;
    import MBN = Modelica.Blocks.Noise;
    import MMD = Modelica.Math.Distributions.Uniform;
    
    output MBI.RealOutput out annotation (Placement(transformation(extent={{100,-10},{120,10}}))); 

    inner Modelica.Blocks.Noise.GlobalSeed globalSeed(fixedSeed=42);
    
    MBN.NormalNoise generator(samplePeriod=0.1,distribution=MMD.density(0, -1, 1));

    
    Real y(useGlobalSeed=true, useAutomaticLocalSeed = false, fixedLocalSeed=false, startTime = 0);
    
equation
    out = generator.y;
end Noise2;

 

However this results in the following error

Argument 1 must have integer[4] data type

 

Due to my inexperience with Modelica, I don't even know were to start searching for the error. So I turn to this wonderful community in my hour of need, How do I implement normal distributed noise in maplesim?

Mvh

Eric Ragnarsson

Please Wait...