Archived OpenModelica forums. Posting is disabled.

Alternative forums include GitHub discussions or StackOverflow (make sure to read the Stack Overflow rules; you need to have well-formed questions)


Forgot password? | Forgot username? | Register
  • Index
  • » Users
  • » Abhi
  • » Profile

Posts

Posts

Oct-16-14 07:17:01
Defining 2 different connectors in a programme and using one based on a parameter from an...
Category: Programming

I have two connectors with different elements namely, mol_port and energy_port . In a model, I use the first connector and I add an if-else clause after it as:
>>Chemical.Interfaces.mol_port In[nin](n = system.set_n) if not system.use_EnergyBal
Now, I inherit this model into a second one and I use the second connector as:
>>Chemical.Interfaces.energy_port In[nin](n = system.set_n)
Here, "system" is used as inner-outer connector and "use_EnergyBal" is a parameter in it.

The first model is working fine if I give "use_EnergyBal" as false in "system". But, when I tried simulating the second model by giving  "use_EnergyBal" as true, the Connect equations are not generated and hence number of equations are less than the number of variables.

Kindly suggest if it is a bug or it is not possible to do this in OM.

  • Index
  • » Users
  • » Abhi
  • » Profile
You are here: