MoCustomComponent block

Dear Experts,
I built a simple model that contains a MoCustomComponent block that represent a mass (see attached Activate model). The script in the block is just copied from Mass modelica block.
The model issued the error (see the picture attched). What should I modify?
Thanks,
Minoru Yubuchi
<?xml version="1.0" encoding="UTF-8"?>
Answers
-
Hello Minoru,
Your modelica Code should be something like that:
model C_Mass 'Sliding mass with inertia'
parameter Modelica.SIunits.Mass m(min = 0, start = 1) 'Mass of the sliding mass';extends Modelica.Mechanics.Translational.Interfaces.PartialRigid(L = 0, s(start = 0));
Modelica.SIunits.Velocity v(start = 0) 'Absolute velocity of component';
Modelica.SIunits.Acceleration a(start = 0) 'Absolute acceleration of component';
equation
m * a = flange_a.f + flange_b.f;
a = der(v);
v = der(s);
end C_Mass;Note that I've removed the stateselect since it is not a block parameter, you can put it back if needed.
Thanks
Fady
0 -
Fady,
Thank you so much!
Let me ask you one question. The original script of Modelica Mass block in Activate has a line 'parameter SI.Mass m(....', not 'parameter Modelica.SIunits.Mass m(....' as you mentioned.
Why does the original script not issue any errors?
Regards,
Minoru Yubuchi
0 -
At the top of package Translational SI is defined as placeholder for Modelica.SIunits.
import SI = Modelica.SIunits;
Everywhere else in this file you can use SI instead of Modelica.SIunits.
0