How to do parameter transfer in activate in this case

yugang
yugang Altair Community Member
edited February 2022 in Community Q&A

Hello everybody, 

The background is like this,

Suggest there is a bar permanent magnet, closed by the frame, to create a magnetic circuit.

Like showed in the picture below. The black component is permanent magnet, the blue one is iron frame.

image

If I move the iron frame in a speed defined by the curve. I want to know the flux deviation in the frame, so I can get voltage curve.

I use magnetic components in the Modelica library. I use integrate function to get the travel from speed. Then I want to add this travel to the length of the iron model.

 

image

 

I try to use ‘send to base’, and ‘get from base’. But I fail, the move not changes in the simulation. So, the length of the iron frame is fixed, not changed.

The model is attached.

It is kind of anybody can give me a solution how to do this parameters transferring.
Or any other simulation strategy can solve this issue.

Thanks.

Answers

  • João Marabisa
    João Marabisa
    Altair Employee
    edited February 2022

    Hi yugang,

    Instead of using "From Base" and "To Base" blocks, you should use "Set" and "Get" blocks.

    With your setup, the model indeed will not change the variable's value, once "From Base" takes the variable's value during the initialization, and "To Base" saves in base the last value in input to hit (at the end of the simulation) - Generally speaking this setup is used in Optimization problem that runs the model several times.

    The point here is: Using standard Modelica components you cannot use "Get" value as input, once the parameter's values are in the "Parameters" section.

    My suggestion would be using "Modelica Custom Component" and include an input port to set the variable's value (I discussed about it here) in order to use "Set" and "Get" blocks.

    Thanks, João.