🎉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

Switching Modelica Blocks

User: "Minoru Yubuchi_21420"
New Altair Community Member
Updated by Minoru Yubuchi_21420

Dear Experts,

 

I would like to know how to switch two Modelica blocks based on a situation of the simulation.

 

For example, please assume two SpringDamper blocks, A and B are contained in an Actibvate model which are applied at the same location. SpringDamper block (A or B)used in the simulation is decided based on situation of simulation and might be changed during the simulation.

 

I created a model (attached) where MoCustomComponent based on Spring is used. In the model, spring constant of the Spring block can be switched during simulation but Spring block cannot be switched in this way?

 

Are there any ways to switch Modelica blocks?

 

Regards,

Minoru Yubuchi

Unable to find an attachment - read this blog

Find more posts tagged with

Sort by:
1 - 3 of 31
    User: "ChristianKehrer"
    Altair Community Member
    Updated by ChristianKehrer

    Dear Yubuchi-san,

     

    as far as I understood, it is not possible to switch between two different Modelica components during a running simulation, because that would require a new compilation to create a new set of equations (before the simulation you could use the include diagram block, but that is not your question, right?).

     

    One option (maybe, not the smartest implementation;) could be to use both Modelica components in parallel and switch between their outputs depending on a specific condition.

    I attached a very simple example for that.

     

    Does that help?

     

    Best regards

    Christian

    Unable to find an attachment - read this blog

    User: "RoKet"
    Altair Employee
    Updated by RoKet

    Hi Christian,

     

    I fully agree to your explanations.

     

    An additional question: You mentioned the include diagram block (a very interesting and powerful element!). Can I use it with Modelica ports or is it limited to Activate signals? Many of my models have super models with Modelica content and Modelica ports, It would be very helpful if I could exchange a super models by another one by changing a configuration parameter.

     

    Thanks,
    Ronald

    User: "Minoru Yubuchi_21420"
    New Altair Community Member
    OP
    Updated by Minoru Yubuchi_21420

    Christian,

     

    Thank you so much! Your advice is very useful for me.

     

    Thanks,

    Minoru Yubuchi