Questions tagged [modelica]

Modelling language for multi-domain physical and control systems.

The free Modelica language is developed by the non-profit Modelica Association. The Modelica Association also develops the free Modelica Standard Library.

1319 questions
0
votes
0 answers

Induction Motor Modelica

I have to made an Induction Motor Model by myself and my first step was to just replicate an already existing example i.e. Electrical.Machines.Examples.AsynchronousInductionMachines.AIMC_DOL. Now I have replicated it but I can't parameterize the…
0
votes
2 answers

Sample a Signal to an Array in Modelica

I am new to Modelica and am having trouble trying to sample a continuous, real, input signal to an array. I have tried using 'when sample' but can't get it to work. The problem with the code below is that every x[i] is an identical sampled version…
jackfrost9p
  • 243
  • 3
  • 10
0
votes
2 answers

Modelica Time Dependent Equations

I am new to Modelica, and I am wondering if it is possible to write a kind of dynamic programming equation. Assume time is discretized by an integer i, and in my specific application x is boolean and f is a boolean function of x. x(t_i) =…
jackfrost9p
  • 243
  • 3
  • 10
0
votes
3 answers

Controls Implementation using Dymola

I've been having issues implementing a built-in controls algorithm (LQR) in Modelica/Dymola. I've created a simpler model that shows the problems I've been having. Basically, I am calling LQR externally and passing it a matrix with an entry (named…
0
votes
2 answers

How can I execute 2 models one by one in one simulation?

I was trying to execute 2 models one by one in a simulation via state chart. The pseudo-code follows. In model test, there are two blocks, stateA and stateB. At the beginning of the simulation, stateA is executed. 10 seconds later, stateA is stopped…
Rui
  • 3
  • 2
0
votes
2 answers

Increment of Variable goes wrong

the variable is now starting with j = 1, but the increment is wrong. For t = 0.5 it should have the value of 2 and for t = 1, j = 3 and so on... You see the error on the following image class abc import Modelica.SIunits; parameter SIunits.Time…
lars
  • 23
  • 3
0
votes
1 answer

Modelica - set the minimum (maximum) of a transmitted variable over several components in a line

The following construct generates an error saying that there are too many equations. model Model1 model myBlock input Modelica.Blocks.Interfaces.RealInput u(start=1e99); output Modelica.Blocks.Interfaces.RealOutput y; parameter Real p=1…
Geronimo
  • 46
  • 3
0
votes
1 answer

Modelica.Media: BaseProperties versus setState_XXX

The Modelica Standard Library comes with the Modelica.Media library which makes available thermodynamic properties of fluids. Quoting from the Modelica.Media documentation: Media models in Modelica.Media are provided by packages, inheriting from…
matth
  • 2,568
  • 2
  • 21
  • 41
0
votes
1 answer

Connection Restrictions on Input and Output Connectors

I would like to enforce that the user cannot connect an input to an input. I expected the code below to give a compile-time error but it gives no error. How can I fix this? Another issue is the package-global compile-time constant C. It is sort of a…
Ali
  • 56,466
  • 29
  • 168
  • 265
0
votes
1 answer

Member not replaced as expected, why?

Aims: all the derived classes should inherit some default equations from their base class. When the default equation is not valid for a derived class then it should redeclare it. Here is a somewhat silly minimalistic example. package Pkg class…
Ali
  • 56,466
  • 29
  • 168
  • 265
-1
votes
1 answer

Dymola- interpolateTrajectory failed to expand

I am dealing with a problem with the interpolateTrajectory command of Dymola. I have been trying with a lot of possibilites to make the command run, but i always receive the same error "Failed to expand InterpolateTrajectory" --First input, I tried…
ichubi
  • 1
-1
votes
1 answer

why package does not open in modelica after rename it

I had a package of models that worked perfectly until I duplicated it and gave it a new name. The new package now won't open and displays an error message. [C:/Users/moi/Desktop/VCR_model_29_12_2022/package.mo: 2:1-3:14]: I expected the package to…
-1
votes
1 answer

Set the Y-axis in the right side in Modelica OMEdit plot

For specific reasons i want to change the Y-axis location from left to right. so if anyone can help me with the way. thanks
-1
votes
1 answer

Summation of a variable variation values in Modelica

In my model i have the evolution of a variable lets say the electric power during time and i want to calculate the summation of the total electric power during the simulation time ,if anyone have an idea of how i will be thankfull.
-1
votes
1 answer

Transform OpenModelica code to a schematic model

I created my personal program of a system similar to a heat pump. Can I transform this code to a schematic model where I can see the changes happening within a system in a sort of animation for example let's say a liquid variation level in a tank?
1 2 3
87
88