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
2 answers

Reusable Templates

Instead of creating text boxes everytime for the displaying the name of the blocks, I thought of creating a reusable template for the same. Following is what I created partial block BlockTemplate annotation(Icon(coordinateSystem(extent =…
MSK
  • 448
  • 2
  • 5
  • 18
0
votes
2 answers

Creating Replaceable models

I wanted to know if Modelica allows us to create replaceable models? I was trying to redeclare the Modelica.Blocks.Sources.Constant to a block which goves constant voltage. I only need to change the unit of the variable k. (from nothing to…
MSK
  • 448
  • 2
  • 5
  • 18
0
votes
0 answers

OpenModelica internal error reinit called with wrong args?

I'm writing a program that from an Functional Mock-Up Unit generates a complete Modelica model. It works just fine when I simulate the model in Dymola but in OpenModelica I get this error: internal error reinit called with wrong args I call…
FluxxSimon
  • 27
  • 5
0
votes
1 answer

Is it possible to modify compiler include path for Dymola?

This question is raised due to a situation that I encountered Say I have these external files and some declarations or definitions in them: foo1.h extern void ext_func(); foo1.c void ext_func(){ .... } foo2.c …
Hang Yu
  • 476
  • 2
  • 14
0
votes
1 answer

Why parameters bounds are not respected using dymola optimization library?

I am trying to optimize (minimize) variable "emissions" using the ModelOptimization function in the library optimization for dymola using the following code: model opt parameter Real electricity=999; Real x2(start=0); Real x1(start=0); Real…
bmorvaj
  • 55
  • 1
  • 7
0
votes
0 answers

Dymola optimisation library constraints

Again me. Sorry for possibly stupid questions but I'm new to this so i Have this initial problems and dilemas. I would like to optimize carbon emission using dymola optimization library on this theoretical case. There is grid and PV as means of…
bmorvaj
  • 55
  • 1
  • 7
0
votes
1 answer

What is a theretical way to write i++ in Dymola? And have hybrid continous and discrete model?

I am just started to learn modelica and I have one (newbie) question. The problem for me is to change the way of thinking from convential programming thinking to modelica way of thinking. I want to do simple program. I have input array with PV…
bmorvaj
  • 55
  • 1
  • 7
0
votes
1 answer

How to use the real input connector in OpenModelica?

I would like to have a OpenModelica model like the following: On the left side there is a "Real Input Connector" called u and on the right side there is a "Real Output Connector" called y. The Porpose of the model is just to take a value (u)…
jonie83
  • 1,136
  • 2
  • 17
  • 28
0
votes
3 answers

Vary frequency of sin voltage source in Modelica

I am working with open Modelica now a days and i wanted to know if there is any way to change the frequency of the sine voltage source e.g the frequency of the source doubles or triples every 3 seconds so that when i draw the graph for a low pass…
danny
  • 400
  • 2
  • 18
0
votes
2 answers

Why same OpenModelica code behaves differently in two files?

I'm trying to model the trajectory of projectile in modelica, but when I model air_pressure dependency on the height I get weird result, now if I simply copy only the air_pressure's code to another file, I get pretty fine output. Why's that so? This…
Salman Azmat
  • 298
  • 6
  • 18
0
votes
1 answer

Modelica : variables of class during instantiation

The variables of Modelica classes are instantiated per object. Can anyone clarify this statement?
shilu
  • 135
  • 1
  • 6
0
votes
2 answers

Modelica - mapping non modelica function to model

If i have a non-modelica function which has no input and no output like void foo(void) { variable1; variable2; for loop { if conditions } variable2=foobar(); // another function call, foobar() is not modelica function } then can…
shilu
  • 135
  • 1
  • 6
0
votes
3 answers

how to resolve a dimensionality-related error in this code?

I have written a code in Modelica to train a feedforward two-layer neural network for my Master thesis. The code receives a vector of six elements (u[nin]) and provides an output vector of two elements y[nout]. When I translate the code in dymola, I…
0
votes
1 answer

Dymola_InlineAfterIndexReduction

This question is related to an issue that I encountered when I was playing with some blocks. Here's the model that I have, As you can see, there are two kinds of connections, the inputs of the first connection(from the top to bottom) is…
Hang Yu
  • 476
  • 2
  • 14
0
votes
1 answer

transform Modelica to FMU? How to implement the process through Java

everyone. I want to simulate some modelica model, but not use openmodelica or dymola, so I think if I can transform the model code into fmu, then call jfmi to process. I read the corresponding material, but still can not find some material very…
xing
  • 95
  • 1
  • 12