how to set hmax in MotionSolve 2021

Luca Cavagna
Luca Cavagna Altair Community Member

Hi,

I am using a template to solve my problem. First there is a dummy transient which I would like to solve quickly. Then the real simulation starts and I need to reduce hmax.

I have different calls to "Simulate" command in the template and I want to set hmax. How?

Best Answers

  • GTT Adam
    GTT Adam
    Altair Employee
    Answer ✓

    Hi @Luca Cavagna,

    This can be solved using a Sensor in which the output step size or integration step size can be changed after a certain time value has been reached:

    Typically, this approach is used when you are waiting for a system to reach a certain position/condition, when the setup isn't important. The output step size or integration step size can be set very coarsely in the event settings and then changed to a mew refined value after a TIME value has been reached or a certain distance measurement has been achieved.

    As for Templates, the https://help.altair.com/hwsolvers/ms/topics/solvers/ms/xml-format_31.htm command in a Template can only change the following values:

    However, https://help.altair.com/hwsolvers/ms/topics/solvers/ms/xml-format_79.htm the can be used to change the h_max and integrator tolerance to speed things up:

    Therefore, you can use something like the following in a Template to achieve the coarse run and then the refined run:

    Which can be shown to work in the LOG file.

    First TRANSIENT:

    Second TRANSIENT:

    Hope this helps!

    Adam Reid

  • Luca Cavagna
    Luca Cavagna Altair Community Member
    Answer ✓

    Hi Adam, thanks a lot for your detailed answer. Good job as always!

    Before opening the question, I had tried with the sensor but could not get what I wanted. I triggered the sensor by checking TIME but then I got confused because from the MV panel I cannot get the hmax information according to:

    hmax is not written in the xml file and despite I hacked the xml file I could not make it work. It seems like the MV panel sets "stepsize" and "dt":

    Important to note: stepsize expires after one step. Maybe I went too quick but the hmax set in the xml file was not doing the job. In any case, your second proposal is exactly what I was looking for (my bad I should watch more carefully the documentation).

    Thanks a lot for the answer!

Answers

  • GTT Adam
    GTT Adam
    Altair Employee
    Answer ✓

    Hi @Luca Cavagna,

    This can be solved using a Sensor in which the output step size or integration step size can be changed after a certain time value has been reached:

    Typically, this approach is used when you are waiting for a system to reach a certain position/condition, when the setup isn't important. The output step size or integration step size can be set very coarsely in the event settings and then changed to a mew refined value after a TIME value has been reached or a certain distance measurement has been achieved.

    As for Templates, the https://help.altair.com/hwsolvers/ms/topics/solvers/ms/xml-format_31.htm command in a Template can only change the following values:

    However, https://help.altair.com/hwsolvers/ms/topics/solvers/ms/xml-format_79.htm the can be used to change the h_max and integrator tolerance to speed things up:

    Therefore, you can use something like the following in a Template to achieve the coarse run and then the refined run:

    Which can be shown to work in the LOG file.

    First TRANSIENT:

    Second TRANSIENT:

    Hope this helps!

    Adam Reid

  • Luca Cavagna
    Luca Cavagna Altair Community Member
    Answer ✓

    Hi Adam, thanks a lot for your detailed answer. Good job as always!

    Before opening the question, I had tried with the sensor but could not get what I wanted. I triggered the sensor by checking TIME but then I got confused because from the MV panel I cannot get the hmax information according to:

    hmax is not written in the xml file and despite I hacked the xml file I could not make it work. It seems like the MV panel sets "stepsize" and "dt":

    Important to note: stepsize expires after one step. Maybe I went too quick but the hmax set in the xml file was not doing the job. In any case, your second proposal is exactly what I was looking for (my bad I should watch more carefully the documentation).

    Thanks a lot for the answer!

  • GTT Adam
    GTT Adam
    Altair Employee
    edited January 17

    Hi @Luca Cavagna,

    Interesting! I did not know that the Sensor does not overwrite the hmax value in the xml. Luckily, I typically only use the Sensor method for changing the output step size, as this is enough of a time saving technique for when I am getting things into a correct position. Noted!

    Another method is to use the Template as above but also to also turn off the H3D output altogether until the model gets to the desired position. Not only does it cut down on solver time, but file sizes as well if the settling simulation is actually quite long:

    <H3DOutput

    switch_on = "off"

    >

    ….

    <H3DOutput

    switch_on = "on"

    >

    ps. Please make sure to mark my first response as correct (assuming it is acceptable) to make sure others can find it quickly as well.

    Hope this helps!

    Adam Reid

  • Luca Cavagna
    Luca Cavagna Altair Community Member

    ;) you see my question was good after all. I agree: not elegant to use sensors for this reason.

    Yes, I chop the entire output for the dummy transient by setting all the outputs to off not only the h3d.

    Thanks Adam!!