How to map the output from the motionview model to FMU block?

sudo
sudo Altair Community Member
edited March 12 in Community Q&A

I am trying to integrate this AI model to the motorcycle with CVT model in twin activate.

I have created python block which contains the AI model since it is written in python. This accepts inputs that should come from the motorcycle model during simulation.

I have manually added all those inputs and outputs and connected them. I imported the .xml file of the motorcyle model in the FMU block.

However how can I map the values from the models to these outputs? Like how can this FMU block tell which are these outputs will come from?

Thanks.

Welcome!

It looks like you're new here. Sign in or register to get started.

Best Answer

Answers

  • GTT Adam
    GTT Adam
    Altair Employee
    Answer ✓

    Hi @sudo,

    Can you please elaborate on your question? It is not clear to me where you need assistance.

    • Are you looking to change the labels for the u1, u2, u3, u4, and u5 inputs in the Python block?
    • Are you looking to add Scopes to measure the signals during simulation?
    • Do your models not automatically produce inputs and outputs shown?

    I am assuming point 3 is the hang-up. The XML file of the MotionView model needs to have inputs and outputs defined before being used in the FMU block shown. These are accomplished with Plant Input and Plant Output entities in the MotionView model:

    https://help.altair.com/hwsolvers/ms/topics/solvers/ms/xml-format_51.htm?zoom_highlight=plant+input

    https://help.altair.com/hwsolvers/ms/topics/solvers/ms/xml-format_52.htm?zoom_highlight=plant+output

    Hope this helps!

    Adam Reid

  • Hi @sudo ,

    Can you specify if this Twin Activate Model is in the demo files, online resource or self made? If you are referring to the MotionView Model outputs. There will be a plant input and output array created in the model that specify solver variables which should have been defined to capture the required requests. Twin Activate will be looking over that xml file for the plant input/output arrays.

    Hope this helps!

    Christopher Fadanelli

  • sudo
    sudo Altair Community Member
    edited March 12

    Hello @Christopher_Fadanelli @GTT Adam

    This is a self made, not from demo files. I have created output solver arrays and it indeed was automatically detected by the motionsolve block from twin activate when I imported the xml file.

    I tried to run the simulation, however I got this error:

  • GTT Adam
    GTT Adam
    Altair Employee

    Hi @sudo,

    Please use the links provided in my previous post for tutorials on how to properly set up the cosimulation.

    It looks like you did not specify a MRF file path in the MotionSolve block and it is trying to write it into your installation directory.

    Hope this helps!

    Adam Reid

  • Hi @sudo ,

    Going off what @GTT Adam said about the mrf file. I would suggest overwriting the '*.mrf" found in the Motionsolve Signals to the same location the xml file is found. Or you can overwrite it manually.

    Hope this helps!

    Christopher Fadanelli

  • sudo
    sudo Altair Community Member

    Thanks @Christopher_Fadanelli and @GTT Adam

    Now I've added these outputs in the motionview block:

    And these as inputs:



    But when I run the simulation, I am getting this error:

  • GTT Adam
    GTT Adam
    Altair Employee

    Hi @sudo,

    Your Twin Activate model contains an algebraic loop, meaning the model can't initialize because too many dependencies exist. You likely need to set initial values for you Solver Variables and/or values in your AI model such that they have an initialized value:

    Hope this helps!

    Adam Reid

  • sudo
    sudo Altair Community Member
    edited March 12

    Thanks @GTT Adam .

    Also, is it possible to view and save the simulation video of the motionsolve block in twin activate?

  • GTT Adam
    GTT Adam
    Altair Employee

    Hi @sudo,

    The completed cosimulation will still create the output H3D and ABF/PLT files, just like a standalone MotionSolve simulation would. Therefore, the results can be reviewed in the same manner as before using HyperView and HyperGraph.

    Scope blocks can also be added to your Twin Activate model for important plots to be created while solving the cosimulation.

    Hope this helps!

    Adam Reid

Welcome!

It looks like you're new here. Sign in or register to get started.

Welcome!

It looks like you're new here. Sign in or register to get started.