compile_fmu fails down with Modelica random number generator

3 posts / 0 new
Last post
Peugny
Offline
Joined: 2017-02-27
compile_fmu fails down with Modelica random number generator

When trying to compile a fmu with use of the package Modelica.Blocks.Noise the IPython interface writes the following:

sources/VDP_pack_useVDP_funcs.c :  In function 'func_Modelica_Math_Random_Utilities_initialStateWithXorshift64star_def1:

sources/VDP_pack_useVDP_funcs.c :59:1: error: 'i_4i' undeclared (first use in this function)

sources/VDP_pack_useVDP_funcs.c :59:1: note: each undeclared identifier is reported only once for each function it appears in

...

I had also experienced the same message when trying to generate real random numbers with the package Modelica.Math.Random

Is it the good Random number package of the JModelica.org-1.11-sdk that can be found under install/ThirdParty/MSL/Modelica?

Any idea would be highly appreciated. I would simulate a white noise with a Van der Pol model, then use it to test a parameter estimation algorithm.

 

The model:

package VDP_pack
  connector Inport = input Real;

  model VDP
    // State start values
    parameter Real x1_0 = 0;
    parameter Real x2_0 = 1;
    parameter Real eps =0.1;
    parameter Real ohm = 1;

    // The states
    Real x1(start = x1_0);
    Real x2(start = x2_0);
    Real y(start = 0.0);
    // The control signal
    Inport u;
//the noise signal
     Inport u_dist;

  equation
    der(x1) = eps*(1 - x2^2) * x1 - ohm^2*x2 + u;
    der(x2) = x1;
    y=x2+u_dist;
  end VDP;

  model VDP_scaled_input
    // State start values
    parameter Real x1_0 = 0;
    parameter Real x2_0 = 1;

    // The states
    Real x1(start = x1_0);
    Real x2(start = x2_0);

    // The control signal
    input Real u(nominal=10);

  equation
    der(x1) = (1 - x2^2) * x1 - x2 + u;
    der(x2) = x1;
  end VDP_scaled_input;

model useVDP
  VDP VDPinst;
  Modelica.Blocks.Sources.Sine uin(freqHz=0.5);
  inner Modelica.Blocks.Noise.GlobalSeed globalSeed;
  Modelica.Blocks.Noise.NormalNoise dist(mu=0.0, sigma=0.5,samplePeriod=0.1);
//  Modelica.Blocks.Noise.UniformNoise dist(y_min=-0.1,y_max=0.1,samplePeriod=0.1);
  equation
     connect(uin.y, VDPinst.u);
     connect(dist.y, VDPinst.u_dist);
end useVDP;

end VDP_pack;

 

levi9
Offline
Joined: 2017-12-29
Did you find a solution? I

Did you find a solution? I really wanted to know.

____________________

JSON formatter validator

PattyDavis
Offline
Joined: 2018-02-11
Exquisitely professional thoughts.

Exquisitely professional thoughts. I merely hit upon ukessays review this web site and desired to enunciate that I've definitely delighted in reckoning your blog articles or blog posts. Rest assured I'll subsist pledging to your RSS and I wish you write-up after much more shortly

Login or register to post comments