🎉Community Raffle - Win $25

An exclusive raffle opportunity for active members like you! Complete your profile, answer questions and get your first accepted badge to enter the raffle.
Join and Win

Creating a python script to interact with model during simulation

User: "sudo"
Altair Community Member

I am running a simulation analysis of an automatic motorcycle. Is it possible to create a python script that could gather the realtime data of the motorcycle during simulation, and also interact with the model to change its attributes for example, throttle position, torque, etc.?

Thanks in advance!

Find more posts tagged with

Sort by:
1 - 1 of 11
    User: "GTT Adam"
    Altair Employee
    Accepted Answer

    Hi @sudo,

    Depending on the complexity of this process, you may need to instead implement this AI model using Twin Activate. In this example, Twin Activate would be the primary interface, with a MotionSolve FMU block and your AI Model implemented as a python or OML block as shown:

    image.png

    This is obviously a very simple representation, but it will hopefully paint the picture for how you can alternatively layer this simulation.

    If the goal is to compare fuel economy between the standard Driver Model and the AI Model, then you can easily set a speed profile for the MotionSolve model to try and follow, to which the AI Model is governing your shift logic as designed. Then, compare the results from the original and improved models to evaluate the change in shifting performance.

    Hope this helps!

    Adam Reid