Archived OpenModelica forums. Posting is disabled.

Alternative forums include GitHub discussions or StackOverflow (make sure to read the Stack Overflow rules; you need to have well-formed questions)


Forgot password? | Forgot username? | Register

too many warnings about the use of the Pulse block

too many warnings about the use of the Pulse block

I want to use the Pulse signal generator block, inside my model,


model PowerConsumerMod "Model of the dynamics of the load"
  import SI = Modelica.SIunits;
  import SO = Modelica.Blocks.Sources;
  parameter SI.Time tau_circuit_eau=2400;                       // s
  SI.Power pow_ech(start=380);                                  // kW
  SO.Pulse pulse(amplitude(quantity=380), width(quantity=10));  // real [kW}
  SI.Power pow_bias=240;                                         // kW
  SI.Power pow_ref=pulse.y+pow_bias;                             // kW

equation
  d(pow_ech) = (1/tau_circuit_eau)*(pow_ref - pow_ech);

end PowerConsumerMod;

but when I tried to translate it, the compiler gave me back lots of warnings.


PowerPlant.PowerConsumer.PowerConsumerMod:
Warning: Type error.
Warning: Type error.
Warning: Found function d without explicit declaration in  (model PowerPlant.PowerConsumer.PowerConsumerMod).
Warning: Type error.
Warning: Type error.
Warning: Type error.
In quantity attribute for pulse.amplitude.
Ignoring quantity attribute.
Used in component pulse.
  Modelica Text: near line 6
Warning: Type error.
In quantity attribute for pulse.width.
Ignoring quantity attribute.
Used in component pulse.
  Modelica Text: near line 6
Model having the same number of unknowns and equations: 6
WARNING: 7 warnings were issued

Are they normal? Can I ignore them? I didn't simulate it yet, but I'm just wondering if this warnings are normal

thanks
have a good day

Re: too many warnings about the use of the Pulse block

This is what I got when running the code....

Code:

$ omc a.mo Modelica

Error processing file: a.mo
[/usr/share/omlibrary/modelicalib//Modelica/Blocks/Sources.mo:194:7-194:54:readonly] Error: Variable pulse.amplitude: Wrong type on builtin attribute quantity of type Integer, expected String
[/usr/share/omlibrary/modelicalib//Modelica/Blocks/Sources.mo:194:7-194:54:readonly] Error: Variable pulse.amplitude: In modifier quantity = 380, not processed in the built-in class Real
[/usr/share/omlibrary/modelicalib//Modelica/Blocks/Sources.mo:194:7-194:54:readonly] Error: Variable pulse.amplitude: Wrong type on builtin attribute quantity of type Integer, expected String
[/usr/share/omlibrary/modelicalib//Modelica/Blocks/Sources.mo:194:7-194:54:readonly] Error: Variable pulse.amplitude: In modifier quantity = 380, not processed in the built-in class Real

I think you are using quantity wrong. If you are using a variable with unit "Volt" in Modelica, that means quantity="Current", unit="V".

If you want to set that the amplitude is equal something, use:

Code:

SO.Pulse pulse(amplitude =380, width =10)

Re: too many warnings about the use of the Pulse block

thank you

There are 0 guests and 0 other users also viewing this topic
You are here: