Jump to content

How to make mass of body as parameters during dynamic simulation ?

Recommended Posts


I am user of activate.

I have one question in simulation.

For example, following simulation, how can I change the mass of the moving part, making the mass as a function depends on the travel.

As below:

0<Travel<50,  mass=50

50<Travel<100, mass=30


background for this requirement.

It is due to the design of actuator. We use activate, to simulation the dynamic behavior of actuators. The moving core contains 2 parts, iron part and copper part. The magnetic force is due to the iron part. The total travel is 10mm. But the copper part will stop at 8mm, the iron part will continue to finish the last 2mm.

So, I simplified the topic to the following model. It is like a force is applied to an object. While the mass of the object is dependent of the travel, I need to remove one part of the mass, when the travel reaches specific value.





Share this post

Link to post
Share on other sites


Thanks for your reply.

If like this, I need to change too much of my models.

The model with friction, with stops are built in Modelica model.


Is possible to add Mass as a function of the travel in the models?

Because, I see the Mass is a parameter here.









Share this post

Link to post
Share on other sites

Hi Yugang, of course it is possible ;-)!

You need to create a Modelica Custom Component for it. This component allows you to leverage the existing modelica components by creating your own customization.



Enclosed you find an example with the component you ar looking for.

I'm switching the mass between 1 and 2 kg according to the displacement.

Best Regards,





Share this post

Link to post
Share on other sites


Thanks for your reply.

I have downloaded your model, and run on my computer.

Some errors.

I don't know why.

I am new users of activate.

I think your solution should be the right one this topic.

It is kind if you can show me where I can get this information  on how to make the custom block.

I click on the help, it is not enough.

Or you can give me the name of the documents, I can download from Altair connect by myself.


Thank you very much.



Share this post

Link to post
Share on other sites

Hi Yugang,


The model is setup with Activate 2019. Which version are you using?


More information about the Modelica custom block and how to use it you can get from "Activate Extended Definitions", a pdf with very helpful information about Activate. It is linked in the help of the custom block (Activate Extended Topics Guide).


BR Ronald

Share this post

Link to post
Share on other sites

Thanks for your information

I have checked the version of my software, it is 2017.3.

I have downloaded 2019, but the license is not ready in China. I have called the sales in China, they advised us to wait.


Thanks, I have downloaded the pdf, I will read it.


Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now