Error in Activate (Modelica Block)

Sangeet Yadav
Sangeet Yadav Altair Community Member
edited January 2023 in Community Q&A

Hi All!

I am using the Power Converter block DCAC (Multiphase Inverter). 

I am getting the below error while running the simulation:image

"

[ThreePhaseInvertre]: Error: Error, (in MapleSim:-Modelica:-Flatten) in `vss_ThreePhaseInvertre_im.container.subcontainer` connecting scalar to array in connect(BooleanPulse.y,inverter.fire_p)

( 99 )

Block(s): connecting scalar to array in connect(BooleanPulse

Model: ThreePhaseInvertre

"

 

As far as I understand, I am not able to connect the Gating signals at inverter, neither using the singal boolean signal or using MUX to give pulses.

Can anyone guide me how to give pulses to this inverter block.

 

Thanks,

Sangeet

Answers

  • RoKet_21298
    RoKet_21298
    Altair Employee
    edited January 2023

    Hi Sangeet,

    You just have to set type Vector and size 3 in ToModelica. The inputs are expected as vectors of size m, basically 3.

    image

  • Sangeet Yadav
    Sangeet Yadav Altair Community Member
    edited January 2023

    Thanks, the way you suggested worked.

    I would also like to know how can I saperate the 3-phase AC signals generated, to connect to a load or voltage sensors.

     

    Thanks

  • RoKet_21298
    RoKet_21298
    Altair Employee
    edited January 2023

    If you use the multiphase sensor you get the 3 phases in one vector signal

    image

    If you want to handle the phases separately, the demo Modelica/Electrical/QuasiStationary/MultiPhase/Unsymmetrical load.scm in demo browser shows how this can be realized.

  • Filippo Donida_21546
    Filippo Donida_21546
    Altair Employee
    edited January 2023

    Hi Sangeet,

    on top of what Ronald has shown in the previous posts, you can also get inspiration from the demo/Modelica diagrams content.

    As an example, the Modelica/Blocks/PID_Controller.scm demo illustrates how to take advantage of a ModelicaExtras/Routing/VectorScalar block that can do the job in this case.

    The same goes for the output signal selection.

    Please do not hesitate to ask for more example references if you feel it can speed up the learning/development process.

    Best,

    Filippo.

    image

  • Sangeet Yadav
    Sangeet Yadav Altair Community Member
    edited January 2023

    Hi Filippo!

    Thanks for the valuable suggestion.

     

    I want to use the python block to implement a functionality. For trial I have created a simple function, using if-else in the python code. 

    image

    The name which I am giving to the ports are showing as undefined in the error.

     

    Could you please help me out how this python block works?

     

    Thanks,

    Sangeet

  • Filippo Donida_21546
    Filippo Donida_21546
    Altair Employee
    edited January 2023

    HI Sangeet,

    I presume you have to define the 'x' and 'y' I/O variables in your python snippet. Can you please check they both are defined?

    Best,

    Filippo.

  • Sangeet Yadav
    Sangeet Yadav Altair Community Member
    edited January 2023

    image

    You asking about the Function code?

  • Filippo Donida_21546
    Filippo Donida_21546
    Altair Employee
    edited January 2023

    Yes Sangeet, exactly. The 'x' variable needs to be defined before being used.

    More precisely to avoid this:

    image

    you can, for example, get the x variable catching the input (e.g. with 'x = int(input())') or be assigned a certain value/reference (e.g. 5).

    image

    Best,

    Filippo.